From 37d9a0f3511d2393aea981c56bac444a94114316 Mon Sep 17 00:00:00 2001 From: quentinchampenois <26109239+Quentinchampenois@users.noreply.github.com> Date: Thu, 18 Jan 2024 11:03:26 +0100 Subject: [PATCH] fix: Fix button add vote in modal --- .../budgets/project_vote_button/show.erb | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 app/cells/decidim/budgets/project_vote_button/show.erb diff --git a/app/cells/decidim/budgets/project_vote_button/show.erb b/app/cells/decidim/budgets/project_vote_button/show.erb new file mode 100644 index 0000000..0179922 --- /dev/null +++ b/app/cells/decidim/budgets/project_vote_button/show.erb @@ -0,0 +1,20 @@ +<%= action_authorized_button_to( + "vote", + budget_order_line_item_path(model.budget, project_id: model), + method: vote_button_method, + remote: true, + class: "button #{scale_up} #{selected_budget} customized-budget display-block project-vote-button", + data: { + add: !resource_added?, + disable: true, + budget: model.budget_amount, + project_id: model.id, + allocation: resource_allocation, + "redirect-url": budget_voting_index_path + }, + disabled: vote_button_disabled?, + title: vote_button_label + ) do %> + <%= resource_added? ? t("remove_from_vote", scope: "decidim.budgets.project_vote_button") :t("add_to_vote", scope: "decidim.budgets.project_vote_button") %> +<% end %> +