Add proposals index in admin

This commit is contained in:
Javi Martín
2018-11-15 13:38:06 +01:00
parent 7891efee32
commit 4770217373
9 changed files with 94 additions and 2 deletions

View File

@@ -0,0 +1,37 @@
<% provide(:title) do %>
<%= t("admin.header.title") %> - <%= t("admin.proposals.index.title") %>
<% end %>
<h2><%= t("admin.proposals.index.title") %></h2>
<% if @proposals.any? %>
<h3><%= page_entries_info @proposals %></h3>
<table>
<thead>
<tr>
<th class="text-center"><%= t("admin.proposals.index.id") %></th>
<th><%= t("admin.proposals.index.title") %></th>
<th><%= t("admin.proposals.index.author") %></th>
<th><%= t("admin.proposals.index.milestones") %></th>
</tr>
</thead>
<tbody>
<% @proposals.each do |proposal| %>
<tr id="<%= dom_id(proposal) %>" class="proposal">
<td class="text-center"><%= proposal.id %></td>
<td><%= link_to proposal.title, admin_proposal_path(proposal) %></td>
<td><%= proposal.author.username %></td>
<td><%= proposal.milestones.count %></td>
</tr>
<% end %>
</tbody>
</table>
<%= paginate @proposals %>
<% else %>
<div class="callout primary">
<%= t("admin.proposals.index.no_proposals") %>
</div>
<% end %>