Commit fb786f5d authored by Wills Gomez's avatar Wills Gomez

vote tally count WIP

parent 6a870e05
@import "bootstrap-sprockets"; @import "bootstrap-sprockets";
@import "bootstrap"; @import "bootstrap";
@import "ver1.css.scss"
\ No newline at end of file
.box{
width: 400px;
height: 300px;
background-color: white;
border: none;
padding: 10px;
float: left;
}
table {
width: 100%;
padding-left: 10px;
padding-right: 10px;
}
th {
height: 50px;
padding-left: 10px;
}
td {
padding-left: 10px;
}
\ No newline at end of file
<h1>Candidates</h1> <center>
<h1>CANDIDATES</h1>
<%=link_to "Add a Candidate", new_admin_candidate_path%>
<%=link_to "Add a candidate", new_admin_candidate_path%>
</center>
<hr> <hr>
<% @positions.each do |p| %> <% @positions.each do |p| %>
<h5><%= p.name %></h5> <h3><%= p.name %></h3>
<ul > <ul >
<% p.candidates.each do |c|%> <% p.candidates.each do |c|%>
<li><%=link_to c.full_name, admin_candidate_path(c.id)%></li> <li><%=link_to c.full_name, admin_candidate_path(c.id)%></li>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<hr> <hr>
<% @positions.each do |c| %> <% @positions.each do |c| %>
<h2>(<%= c.id %>) <%= c.name %></h2> <h2><a href="/admin/positions/show"><% c.name %></a></h2>
<ul> <ul>
<% c.candidates.each do |p| %> <% c.candidates.each do |p| %>
<li><%= link_to "#{p.first_name} #{p.last_name}" , admin_candidate_path(p.id) %></li> <li><%= link_to "#{p.first_name} #{p.last_name}" , admin_candidate_path(p.id) %></li>
......
<h1>Halalan PH</h1> <h1><center>Current Vote Tally</center></h1>
<br>
<br>
<%@positions.each do |p|%> <%@positions.each do |p|%>
<h4><%=p.name%></h4> <div class ="section">
<table> <div class ="box">
<thead> <h4><center><%=p.name%></center></h4>
<td>&nbsp;</td> <table>
<td>Name</td> <thead>
<td>Slogan</td> <th><center>&nbsp;</center></th>
<td>Votes</td> <th><center>Name</center></th>
<td>&nbsp;</td> <th colspan="2"><center>Votes</center></th>
</thead> <th><center>&nbsp;</center></th>
<%total = 0%> </thead>
<%p.candidates.each do |c|%> <%total = 0%>
<%total = total+c.votes.count%> <%p.candidates.each do |c|%>
<%end%> <%total = total+c.votes.count%>
<%p.candidates.each do |c|%> <%end%>
<%p.candidates.each do |c|%>
<tr> <tr>
<td></td> <td></td>
<td><%=link_to c.full_name, admin_candidate_path(c.id)%></td> <td><center><%=link_to c.full_name, admin_candidate_path(c.id)%></center></td>
<td><%=c.slogan%></td> <td><center><%=c.votes.count%></center></td>
<td><%=c.votes.count%></td> <td><center><progress value="<%=c.votes.count%>" max="<%=total%>" >(<%=c.votes.count%>)</center></td>
<td><progress value="<%=c.votes.count%>" max="<%=total%>" ></td>
</tr> </tr>
<%end%> <%end%>
</table> </table>
</div>
</div>
<%end%> <%end%>
\ No newline at end of file
<h1>Votes</h1> <h1><center>VOTES</center></h1>
<h2>Hello, <%= current_user.full_name %>!</h2>
<hr> <hr>
<h2><center>Hello, <%= current_user.full_name %>!</center></h2>
<h4>Vote now for:</h4> <h4>Vote now for:</h4>
<ul> <ul>
<%@positions.each do |p|%> <%@positions.each do |p|%>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment