Since the message might appear several times on the same page, it's useful to give a bit more context. Besides, usability tests show that when there's a group with no headings, there's no clear indication on the page that the group is actually a group and not a heading. We're also adding some emphasis to the group name in the "Showing headings" message, to be consistent with the emphasis we've added the the group name in the "No headings" message.
34 lines
1.1 KiB
Plaintext
34 lines
1.1 KiB
Plaintext
<% if headings.any? %>
|
|
<table>
|
|
<caption><%= t("admin.budgets.show.headings_caption", group: group.name) %></caption>
|
|
<thead>
|
|
<tr>
|
|
<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><%= t("admin.actions.actions") %></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% headings.each do |heading| %>
|
|
<tr id="<%= dom_id(heading) %>" class="heading">
|
|
<td><%= heading.name %></td>
|
|
<td><%= budget.formatted_heading_price(heading) %></td>
|
|
<% if budget.approval_voting? %>
|
|
<td><%= heading.max_ballot_lines %></td>
|
|
<% end %>
|
|
<td>
|
|
<%= render Admin::TableActionsComponent.new(heading) %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
<% else %>
|
|
<div class="callout primary clear">
|
|
<%= sanitize(t("admin.budget_headings.no_headings", group: group.name)) %>
|
|
</div>
|
|
<% end %>
|