From c2898549d092698aab8ebb523cfa278a25920014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Verg=C3=A9s?= Date: Thu, 19 Sep 2024 18:53:57 +0200 Subject: [PATCH] make custom budgets optional --- .../budgets/project_vote_button/show.erb | 6 +++- .../budgets/projects/_budget_confirm.html.erb | 8 +++-- .../_order_selected_projects.html.erb | 8 +++-- config/initializers/budgets_overrides.rb | 34 +++++++++++++++---- config/locales/es.yml | 5 +++ 5 files changed, 47 insertions(+), 14 deletions(-) diff --git a/app/cells/decidim/budgets/project_vote_button/show.erb b/app/cells/decidim/budgets/project_vote_button/show.erb index eebd2c1..da0802f 100644 --- a/app/cells/decidim/budgets/project_vote_button/show.erb +++ b/app/cells/decidim/budgets/project_vote_button/show.erb @@ -14,7 +14,11 @@ disabled: vote_button_disabled?, title: vote_button_label do %> <% if resource_added? %> - <%= current_order.score_for(model) %> + <% if model.budget.settings.disable_custom_budgets %> + <%= icon("x", class: "icon--small", aria_label: vote_button_label, role: "img") %> + <% else %> + <%= current_order.score_for(model) %> + <% end %> <% else %> <%= icon("check", class: "icon--small", aria_label: vote_button_label, role: "img") %> <% end %> diff --git a/app/views/decidim/budgets/projects/_budget_confirm.html.erb b/app/views/decidim/budgets/projects/_budget_confirm.html.erb index 8a88e52..818a4ad 100644 --- a/app/views/decidim/budgets/projects/_budget_confirm.html.erb +++ b/app/views/decidim/budgets/projects/_budget_confirm.html.erb @@ -11,9 +11,11 @@