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.
22 lines
816 B
Plaintext
22 lines
816 B
Plaintext
<div class="budget-group-switcher">
|
|
<% if other_groups.one? %>
|
|
<p>
|
|
<%= currently_showing_text %>
|
|
<%= link_to t("admin.budget_headings.group_switcher.the_other_group", group: other_groups.first.name),
|
|
headings_path(other_groups.first) %>
|
|
</p>
|
|
<% else %>
|
|
<p><%= currently_showing_text %></p>
|
|
<ul class="dropdown menu" data-dropdown-menu data-disable-hover="true" data-click-open="true">
|
|
<li class="has-submenu">
|
|
<button type="button"><%= t("admin.budget_headings.group_switcher.different_group") %></button>
|
|
<ul class="menu" data-submenu>
|
|
<% other_groups.each do |other_group| %>
|
|
<li><%= link_to other_group.name, headings_path(other_group) %></li>
|
|
<% end %>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<% end %>
|
|
</div>
|