Commit b12fafe5 authored by Galen Evilla's avatar Galen Evilla

last na talaga

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