Commit 24e7ad0a authored by Galen Evilla's avatar Galen Evilla

last na

parent b12fafe5
...@@ -8,8 +8,9 @@ ...@@ -8,8 +8,9 @@
<hr> <hr>
<h2><center>Hello, <%= current_user.full_name %>!</center></h2> <h2><center>Hello, <%= current_user.full_name %>!</center></h2>
<h4>Vote now for:</h4> <% if @positions.size > 0 %>
<ul> <h4>Vote now for:</h4>
<ul>
<%@positions.each do |p|%> <%@positions.each do |p|%>
<li><%=p.name%><br> <li><%=p.name%><br>
<%voted_for = false%> <%voted_for = false%>
...@@ -17,7 +18,7 @@ ...@@ -17,7 +18,7 @@
<% p.candidates.each do |c|%> <% p.candidates.each do |c|%>
<%c.votes.each do |v|%> <%c.votes.each do |v|%>
<%if v.user_id == current_user.id%> <%if v.user_id == current_user.id%>
You have already voted for <%= v.candidate.full_name%> You have already voted for <%= v.candidate.full_name %>
<%voted_for = true%> <%voted_for = true%>
<% end %> <% end %>
<%end%> <%end%>
...@@ -31,7 +32,11 @@ ...@@ -31,7 +32,11 @@
<%end%> <%end%>
</li> </li>
<%end%> <%end%>
</ul> </ul>
<%else%>
<h5>No available candidates to vote for.</h5>
<%end%>
<hr> <hr>
<br> <br>
</div> </div>
......
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