<%= t("budgets.show.investments_list") %>
diff --git a/app/views/budgets/_supports_info.html.erb b/app/views/budgets/_supports_info.html.erb
new file mode 100644
index 00000000000..8dcdc2111b4
--- /dev/null
+++ b/app/views/budgets/_supports_info.html.erb
@@ -0,0 +1,42 @@
+<% if budget.selecting? %>
+
+
+
<%= sanitize(t("budgets.index.supports_info.title")) %>
+
+
+
+
<%= t("budgets.index.supports_info.next") %>
+
<%= sanitize(t("budgets.index.supports_info.remember")) %>
+
<%= t("budgets.index.supports_info.different") %>
+
+
+
+
+ <% if current_user %>
+ <% if budget_investments_total_supports(current_user) == 1 %>
+ <%= sanitize(t("budgets.index.supports_info.supported_one")) %>
+ <% else %>
+ <%= sanitize(t("budgets.index.supports_info.supported",
+ count: budget_investments_total_supports(current_user))) %>
+ <% end %>
+ <% else %>
+ <%= sanitize(t("budgets.index.supports_info.supported_not_logged_in")) %>
+ <% end %>
+
+
+
+
+
+<% end %>
diff --git a/config/locales/en/budgets.yml b/config/locales/en/budgets.yml
index edcffcbecb6..19b5f47a9a9 100644
--- a/config/locales/en/budgets.yml
+++ b/config/locales/en/budgets.yml
@@ -75,6 +75,17 @@ en:
title: Help with participatory budgets
description: With the participatory budgets the citizens decide to which projects is destined a part of the budget.
milestones: Milestones
+ supports_info:
+ title: "It's time to
support projects!"
+ next: "Support the projects you would like to see move on to the next phase."
+ remember: "
Remember! You can only cast your support
once for each project and each support is
irreversible."
+ different: "You may support on as many different projects as you would like."
+ supported: "So far you supported
%{count} projects."
+ supported_one: "So far you supported
1 project."
+ supported_not_logged_in: "Log in to start
supporting projects."
+ time: "There's still time until %{phase_end_date} to support projects."
+ share: "You can share the projects you have supported on through social media and attract more attention and support to them!"
+ scrolling: "Keep scrolling to see all ideas"
investments:
form:
title: "Create a budget investment"
diff --git a/config/locales/es/budgets.yml b/config/locales/es/budgets.yml
index 9fd5c787483..0c292e8296e 100644
--- a/config/locales/es/budgets.yml
+++ b/config/locales/es/budgets.yml
@@ -75,6 +75,17 @@ es:
title: Ayuda sobre presupuestos participativos
description: Con los presupuestos participativos la ciudadanía decide a qué proyectos va destinada una parte del presupuesto.
milestones: Seguimiento de proyectos
+ supports_info:
+ title: "¡Es hora de
apoyar proyectos!"
+ next: "Apoya proyectos que te gustaría ver en la siguiente fase."
+ remember: "
¡Recuerda! Solo puedes emitir tu apoyo
una vez por cada proyecto y cada apoyo es
irreversible."
+ different: "Puedes apoyar tantos proyectos diferentes como quieras."
+ supported: "Hasta ahora has apoyado
%{count} proyectos."
+ supported_one: "Hasta ahora has apoyado
1 proyecto."
+ supported_not_logged_in: "Entra y empieza a
apoyar proyectos."
+ time: "Hay tiempo hasta el %{phase_end_date} para apoyar proyectos."
+ share: "Puedes compartir los proyectos que has apoyado en las redes sociales y ¡atraer más atención y apoyos para ellos!"
+ scrolling: "Sigue desplazándote para ver todas las ideas"
investments:
form:
title: "Crear nuevo proyecto"
diff --git a/spec/system/budgets/budgets_spec.rb b/spec/system/budgets/budgets_spec.rb
index e0136bb3635..2e52ab7b093 100644
--- a/spec/system/budgets/budgets_spec.rb
+++ b/spec/system/budgets/budgets_spec.rb
@@ -469,6 +469,67 @@
end
end
end
+
+ scenario "Show support info on selecting phase" do
+ budget = create(:budget)
+ group = create(:budget_group, budget: budget)
+ heading = create(:budget_heading, group: group)
+
+ voter = create(:user, :level_two)
+
+ %w[informing accepting reviewing valuating publishing_prices balloting reviewing_ballots
+ finished].each do |phase_name|
+ budget.update!(phase: phase_name)
+
+ visit budget_path(budget)
+
+ expect(page).not_to have_content "It's time to support projects!"
+ expect(page).not_to have_content "Support the projects you would like to see move on "\
+ "to the next phase."
+ expect(page).not_to have_content "Remember! You can only cast your support once for each project "\
+ "and each support is irreversible."
+ expect(page).not_to have_content "You may support on as many different projects as you would like."
+ expect(page).not_to have_content "So far you supported 0 projects."
+ expect(page).not_to have_content "Log in to start supporting projects."
+ expect(page).not_to have_content "There's still time until"
+ expect(page).not_to have_content "You can share the projects you have supported on through social "\
+ "media and attract more attention and support to them!"
+ expect(page).not_to have_link "Keep scrolling to see all ideas"
+ end
+
+ budget.update!(phase: "selecting")
+ visit budget_path(budget)
+
+ expect(page).to have_content "It's time to support projects!"
+ expect(page).to have_content "Support the projects you would like to see move on "\
+ "to the next phase."
+ expect(page).to have_content "Remember! You can only cast your support once for each project "\
+ "and each support is irreversible."
+ expect(page).to have_content "You may support on as many different projects as you would like."
+ expect(page).to have_content "Log in to start supporting projects"
+ expect(page).to have_content "There's still time until"
+ expect(page).to have_content "You can share the projects you have supported on through social "\
+ "media and attract more attention and support to them!"
+ expect(page).to have_link "Keep scrolling to see all ideas"
+
+ login_as(voter)
+
+ visit budget_path(budget)
+
+ expect(page).to have_content "So far you supported 0 projects."
+
+ create(:budget_investment, :selected, heading: heading, voters: [voter])
+
+ visit budget_path(budget)
+
+ expect(page).to have_content "So far you supported 1 project."
+
+ create_list(:budget_investment, 3, :selected, heading: heading, voters: [voter])
+
+ visit budget_path(budget)
+
+ expect(page).to have_content "So far you supported 4 projects."
+ end
end
context "In Drafting phase" do