Files
grecia/app/views/admin/budgets/_group.html.erb

42 lines
1.2 KiB
Plaintext

<table>
<thead>
<tr>
<th colspan="4" class="with-button">
<%= group.name %>
<%= link_to t("admin.budgets.form.add_heading"), "#", class: "button float-right js-toggle-link", data: { "toggle-selector" => "#group-#{group.id}-new-heading-form" } %>
</th>
</tr>
<% if headings.blank? %>
</thead>
<tbody>
<tr>
<td colspan="4">
<div class="callout primary">
<%= t("admin.budgets.form.no_heading") %>
</div>
</td>
</tr>
<% else %>
<tr>
<th><%= t("admin.budgets.form.table_heading") %></th>
<th class="text-right"><%= t("admin.budgets.form.table_amount") %></th>
<th class="text-right"><%= t("admin.budgets.form.table_population") %></th>
<th><%= t("admin.actions.actions") %></th>
</tr>
</thead>
<tbody>
<% end %>
<tr id="group-<%= group.id %>-new-heading-form" style="display:none">
<td colspan="4">
<%= render "admin/budgets/heading_form", group: group, budget: @budget, heading: Budget::Heading.new %>
</td>
</tr>
<% headings.each do |heading| %>
<%= render "admin/budgets/heading", group: group, budget: @budget, heading: heading %>
<% end %>
</tbody>
</table>