Files
nairobi/app/views/admin/budget_headings/index.html.erb
Ziyan Junaideen 1e3e8c1304 Add approval voting to budgets
Co-Authored-By: Javi Martín <javim@elretirao.net>
2020-08-06 12:38:18 +02:00

54 lines
2.2 KiB
Plaintext

<%= back_link_to admin_budget_groups_path(@budget), t("admin.budget_headings.index.back") %>
<div class="clear"></div>
<h2 class="inline-block"><%= "#{@budget.name} / #{@group.name}" %></h2>
<%= link_to t("admin.budget_headings.form.create"),
new_admin_budget_group_heading_path,
class: "button float-right" %>
<% if @headings.any? %>
<h3><%= t("admin.budget_headings.amount", count: @headings.count) %></h3>
<table>
<thead>
<tr id="<%= dom_id(@group) %>">
<th><%= Budget::Heading.human_attribute_name(:name) %></th>
<th><%= Budget::Heading.human_attribute_name(:price) %></th>
<% if @budget.approval_voting? %>
<th><%= Budget::Heading.human_attribute_name(:max_ballot_lines) %></th>
<% end %>
<th><%= Budget::Heading.human_attribute_name(:population) %></th>
<th><%= Budget::Heading.human_attribute_name(:allow_custom_content) %></th>
<th><%= t("admin.actions.actions") %></th>
</tr>
</thead>
<tbody>
<% @headings.each do |heading| %>
<tr id="<%= dom_id(heading) %>" class="heading">
<td><%= link_to heading.name, edit_admin_budget_group_heading_path(@budget, @group, heading) %></td>
<td><%= @budget.formatted_heading_price(heading) %></td>
<% if @budget.approval_voting? %>
<td><%= heading.max_ballot_lines %></td>
<% end %>
<td><%= heading.population %></td>
<td>
<%= heading.allow_custom_content ? t("admin.shared.true_value") : t("admin.shared.false_value") %>
</td>
<td>
<%= link_to t("admin.actions.edit"),
edit_admin_budget_group_heading_path(@budget, @group, heading),
class: "button hollow" %>
<%= link_to t("admin.actions.delete"),
admin_budget_group_heading_path(@budget, @group, heading),
method: :delete,
class: "button hollow alert" %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% else %>
<div class="callout primary clear">
<%= t("admin.budget_headings.no_headings") %>
</div>
<% end %>