29 lines
1,003 B
Text
29 lines
1,003 B
Text
<h1 class="mb-5"><%= _("Votes") %></h1>
|
|
|
|
<table class="table table-striped mb-5">
|
|
<tbody>
|
|
<% @votes.reverse.each do |vote| %>
|
|
<tr>
|
|
<td><%= format_date(vote.created_at) %></td>
|
|
<td class="text-nowrap">
|
|
<% case vote.state
|
|
when 'draft' %>
|
|
<span class="badge bg-secondary"><%= _("Draft") %></span>
|
|
<% when 'open' %>
|
|
<span class="badge bg-primary"><%= _("Open") %></span>
|
|
<% when 'closed' %>
|
|
<SPAN class="badge bg-dark"><%= _("Closed") %></span>
|
|
<% end %>
|
|
<% if vote.users.exists?(current_user.id) %>
|
|
<span class="badge bg-warning text-bg-warning"><%= _("Organizer") %></span>
|
|
<% end %>
|
|
</td>
|
|
<td><a href="/votes/<%= vote.secure_id %>"><%= vote.title %></a></td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
|
|
<form action="/votes/new" method="get">
|
|
<button type="submit" class="btn btn-primary"><%= _("Create new vote") %></button>
|
|
</form>
|