Commit b12fafe5 authored by Galen Evilla's avatar Galen Evilla

last na talaga

parent 74a957db
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
<h2><center>Hello, <%= current_user.full_name %>!</center></h2> <h2><center>Hello, <%= current_user.full_name %>!</center></h2>
<h4>Vote now for:</h4> <h4>Vote now for:</h4>
<ul> <ul>
<% if @positions.size > 0 %>
<%@positions.each do |p|%> <%@positions.each do |p|%>
<li><%=p.name%><br> <li><%=p.name%><br>
<%voted_for = false%> <%voted_for = false%>
<% if p.candidates.size > 0 %>
<% 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%>
...@@ -22,15 +22,14 @@ ...@@ -22,15 +22,14 @@
<% end %> <% end %>
<%end%> <%end%>
<% end %> <% end %>
</ol>
<%if !voted_for%> <%if !voted_for%>
<%=link_to "Vote for a #{p.name}", "/voting/new/#{p.id}" %> <%=link_to "Vote for a #{p.name}", "/voting/new/#{p.id}" %>
<%else%> <%else%>
<%end%> <%end%>
</li>
<%end%>
<% else %> <% else %>
<h4>No available candidates to vote for.</h4> <h5>No available candidates to vote for.</h5>
<%end%>
</li>
<%end%> <%end%>
</ul> </ul>
<hr> <hr>
......
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