This way we can simplify the way we generate form fields. In some cases, we also use the human attribute in table headers, which IMHO makes sense. I haven't moved all of them: for example, sometimes a label is different depending on whether it's shown to administrators, valuators, or users. And I haven't touched the ones related to devise, since I wasn't sure about possible side effects. Note I've also removed placeholders when they had the same text as their labels, since they weren't helpful. On the contrary, the added redundant text to the form, potentially distracting users.
49 lines
1.8 KiB
Plaintext
49 lines
1.8 KiB
Plaintext
<%= back_link_to admin_budgets_path, t("admin.budget_groups.index.back") %>
|
|
|
|
<div class="clear"></div>
|
|
|
|
<h2 class="inline-block"><%= @budget.name %></h2>
|
|
|
|
<%= link_to t("admin.budget_groups.form.create"),
|
|
new_admin_budget_group_path,
|
|
class: "button float-right" %>
|
|
|
|
<% if @groups.any? %>
|
|
<h3><%= t("admin.budget_groups.amount", count: @groups.count) %></h3>
|
|
<table>
|
|
<thead>
|
|
<tr id="<%= dom_id(@budget) %>">
|
|
<th><%= t("admin.budget_groups.name") %></th>
|
|
<th><%= Budget::Group.human_attribute_name(:max_votable_headings) %></th>
|
|
<th><%= t("admin.budget_groups.headings_name") %></th>
|
|
<th><%= t("admin.budget_groups.headings_edit") %></th>
|
|
<th><%= t("admin.actions.actions") %></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% @groups.each do |group| %>
|
|
<tr id="<%= dom_id(group) %>">
|
|
<td><%= link_to group.name, edit_admin_budget_group_path(@budget, group) %></td>
|
|
<td><%= group.max_votable_headings %></td>
|
|
<td><%= group.headings.count %></td>
|
|
<td><%= link_to t("admin.budget_groups.headings_manage"),
|
|
admin_budget_group_headings_path(@budget, group) %></td>
|
|
<td>
|
|
<%= link_to t("admin.actions.edit"),
|
|
edit_admin_budget_group_path(@budget, group),
|
|
class: "button hollow" %>
|
|
<%= link_to t("admin.actions.delete"),
|
|
admin_budget_group_path(@budget, group),
|
|
method: :delete,
|
|
class: "button hollow alert" %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
<% else %>
|
|
<div class="callout primary clear">
|
|
<%= t("admin.budget_groups.no_groups") %>
|
|
</div>
|
|
<% end %>
|