Files
nairobi/app/components/admin/budgets/table_actions_component.html.erb
Julian Herrero 2b709f1a36 Groups and headings CRUD from budget view
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>
2021-10-25 18:01:47 +02:00

20 lines
933 B
Plaintext

<%= render Admin::TableActionsComponent.new(budget, edit_path: admin_budget_path(budget)) do |actions| %>
<%= actions.action(:investments,
text: t("admin.budgets.index.budget_investments"),
path: admin_budget_budget_investments_path(budget_id: budget.id)) %>
<% if budget.poll.present? %>
<%= actions.action(:ballots,
text: t("admin.budgets.index.admin_ballots"),
path: admin_poll_booth_assignments_path(budget.poll)) %>
<% else %>
<%= actions.action(:ballots,
text: t("admin.budgets.index.admin_ballots"),
path: create_budget_poll_path,
method: :post) %>
<% end %>
<%= actions.action(:preview,
text: t("admin.budgets.actions.preview"),
path: budget_path(budget),
target: "_blank") %>
<% end %>