vedia/views/home.erb
2025-06-08 18:17:56 -06:00

29 lines
832 B
Text

<h1><%= _("Home") %></h1>
<h2><%= _("Votes") %></h2>
<ul>
<% @votes.reverse.each do |vote| %>
<li>
<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>
<% end %>
</ul>
<form action="/votes/new" method="get">
<button type="submit"><%= _("Create new vote") %></button>
</form>