Files
nairobi/app/views/admin/budgets/index.html.erb
Javi Martín fb23df2e5b Allow additional links in table actions component
This way we'll be able to make these links consistent.
2020-10-21 13:19:49 +02:00

53 lines
1.8 KiB
Plaintext

<h2 class="inline-block"><%= t("admin.budgets.index.title") %></h2>
<%= link_to t("admin.budgets.index.new_link"),
new_admin_budget_path,
class: "button float-right" %>
<%= render "shared/filter_subnav", i18n_namespace: "admin.budgets.index" %>
<% if @budgets.any? %>
<h3><%= page_entries_info @budgets %></h3>
<table>
<thead>
<tr>
<th><%= t("admin.budgets.index.table_name") %></th>
<th><%= t("admin.budgets.index.table_phase") %></th>
<th><%= t("admin.actions.actions") %></th>
</tr>
</thead>
<tbody>
<% @budgets.each do |budget| %>
<tr id="<%= dom_id(budget) %>" class="budget">
<td>
<%= budget.name %>
</td>
<td class="small">
<%= t("budgets.phase.#{budget.phase}") %>
</td>
<td>
<%= render Admin::TableActionsComponent.new(budget, actions: [:edit], edit_text: t("admin.budgets.index.edit_budget")) do |actions| %>
<%= actions.link_to t("admin.budgets.index.budget_investments"),
admin_budget_budget_investments_path(budget_id: budget.id),
class: "button hollow medium" %>
<%= actions.link_to t("admin.budgets.index.edit_groups"), admin_budget_groups_path(budget) %>
<% if budget.poll.present? %>
<%= actions.link_to t("admin.budgets.index.admin_ballots"), admin_poll_booth_assignments_path(budget.poll) %>
<% else %>
<%= link_to_create_budget_poll(budget) %>
<% end %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= paginate @budgets %>
<% else %>
<div class="callout primary">
<%= t("admin.budgets.index.no_budgets") %>
</div>
<% end %>