Display state of votes on Home
This commit is contained in:
parent
ac32ce243a
commit
75e9630b8f
1 changed files with 15 additions and 1 deletions
|
|
@ -5,9 +5,23 @@
|
||||||
<h2>Votes</h2>
|
<h2>Votes</h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<% @votes.each do |vote| %>
|
<% @votes.reverse.each do |vote| %>
|
||||||
<li>
|
<li>
|
||||||
<a href="/votes/<%= vote.secure_id %>"><%= vote.title %></a>
|
<a href="/votes/<%= vote.secure_id %>"><%= vote.title %></a>
|
||||||
|
<% case vote.state
|
||||||
|
when "draft" %>
|
||||||
|
<% if vote.users.exists?(current_user.id) %>(Draft, organized by you)
|
||||||
|
<% else %>(Draft)
|
||||||
|
<% end %>
|
||||||
|
<% when "open" %>
|
||||||
|
<% if vote.users.exists?(current_user.id) %>(Open, organized by you)
|
||||||
|
<% else %>(Open)
|
||||||
|
<% end %>
|
||||||
|
<% when "closed" %>
|
||||||
|
<% if vote.users.exists?(current_user.id) %>(Closed, organized by you)
|
||||||
|
<% else %>(Closed)
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue