Before, users needed to navigate to the list of groups in order to add, edit or delete a group. Also, they need to navigate to the list of groups first, and then to the list of headings for that group in order to add, edit or delete a heading. Now, it's possible to do all these actions for any group or heading from the participatory budget view to bring simplicity and to reduce the number of clicks from a user perspective. Co-Authored-By: Javi Martín <javim@elretirao.net>
27 lines
1023 B
Plaintext
27 lines
1023 B
Plaintext
<% budget.groups.each do |group| %>
|
|
<section id="<%= dom_id(group) %>" aria-labelledby="<%= dom_id(group, :header) %>">
|
|
<h4 id="<%= dom_id(group, :header) %>"><%= group.name %></h4>
|
|
|
|
<div class="groups-actions">
|
|
<%= action(:edit, group, "aria-label": true) %>
|
|
<%= action(:destroy, group, method: :delete, confirm: true, "aria-label": true) %>
|
|
<%= action(:new,
|
|
group,
|
|
text: t("admin.budgets.show.add_heading"),
|
|
path: new_admin_budget_group_heading_path(budget, group),
|
|
"aria-label": true) %>
|
|
</div>
|
|
|
|
<% if group.multiple_headings? %>
|
|
<dl>
|
|
<dt><%= Budget::Group.human_attribute_name(:max_votable_headings) %></dt>
|
|
<dd><%= group.max_votable_headings %></dd>
|
|
</dl>
|
|
<% end %>
|
|
|
|
<%= render Admin::BudgetHeadings::HeadingsComponent.new(group.headings) %>
|
|
</section>
|
|
<% end %>
|
|
|
|
<%= action(:new, budget, text: t("admin.budgets.show.add_group"), path: new_admin_budget_group_path(budget)) %>
|