Rewrite views with Bootstrap
This commit is contained in:
parent
529f7118b1
commit
5a278fcddf
19 changed files with 424 additions and 279 deletions
29
views/votes.erb
Normal file
29
views/votes.erb
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue