Files
grecia/app/components/admin/budgets_wizard/headings/group_switcher_component.html.erb
Javi Martín a03037f0ba Remove duplication in group switcher component
We can extract a method to reduce the amount of ERB code and remove the
duplication in the link texts. We also make the list consistent; now we
always use a <strong> tag in the group name, no matter whether there are
many groups or only one.
2025-04-02 13:40:45 +02:00

12 lines
311 B
Plaintext

<div class="budget-group-switcher">
<% if other_groups.one? %>
<p>
<%= currently_showing_text %>
<%= link_to_group(other_groups.first) %>
</p>
<% else %>
<p><%= currently_showing_text %></p>
<%= link_list(*other_groups.map { |group| link_to_group(group) }) %>
<% end %>
</div>