Commit fb786f5d authored by Wills Gomez's avatar Wills Gomez

vote tally count WIP

parent 6a870e05
@import "bootstrap-sprockets";
@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>
<%=link_to "Add a Candidate", new_admin_candidate_path%>
<center>
<h1>CANDIDATES</h1>
<%=link_to "Add a candidate", new_admin_candidate_path%>
</center>
<hr>
<% @positions.each do |p| %>
<h5><%= p.name %></h5>
<h3><%= p.name %></h3>
<ul >
<% p.candidates.each do |c|%>
<li><%=link_to c.full_name, admin_candidate_path(c.id)%></li>
......
......@@ -4,7 +4,7 @@
<hr>
<% @positions.each do |c| %>
<h2>(<%= c.id %>) <%= c.name %></h2>
<h2><a href="/admin/positions/show"><% c.name %></a></h2>
<ul>
<% c.candidates.each do |p| %>
<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|%>
<h4><%=p.name%></h4>
<table>
<thead>
<td>&nbsp;</td>
<td>Name</td>
<td>Slogan</td>
<td>Votes</td>
<td>&nbsp;</td>
</thead>
<%total = 0%>
<%p.candidates.each do |c|%>
<%total = total+c.votes.count%>
<%end%>
<%p.candidates.each do |c|%>
<div class ="section">
<div class ="box">
<h4><center><%=p.name%></center></h4>
<table>
<thead>
<th><center>&nbsp;</center></th>
<th><center>Name</center></th>
<th colspan="2"><center>Votes</center></th>
<th><center>&nbsp;</center></th>
</thead>
<%total = 0%>
<%p.candidates.each do |c|%>
<%total = total+c.votes.count%>
<%end%>
<%p.candidates.each do |c|%>
<tr>
<td></td>
<td><%=link_to c.full_name, admin_candidate_path(c.id)%></td>
<td><%=c.slogan%></td>
<td><%=c.votes.count%></td>
<td><progress value="<%=c.votes.count%>" max="<%=total%>" ></td>
<td><center><%=link_to c.full_name, admin_candidate_path(c.id)%></center></td>
<td><center><%=c.votes.count%></center></td>
<td><center><progress value="<%=c.votes.count%>" max="<%=total%>" >(<%=c.votes.count%>)</center></td>
</tr>
<%end%>
</table>
</div>
</div>
<%end%>
\ No newline at end of file
<h1>Votes</h1>
<h1><center>VOTES</center></h1>
<h2>Hello, <%= current_user.full_name %>!</h2>
<hr>
<h2><center>Hello, <%= current_user.full_name %>!</center></h2>
<h4>Vote now for:</h4>
<ul>
<%@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