<% unless voting_finished? %>
- <%= render partial: "budget_summary", locals: { include_heading: false } %>
+ <%= render partial: "budget_summary" %>
<% end %>
diff --git a/decidim-budgets/config/locales/ca.yml b/decidim-budgets/config/locales/ca.yml
index 519b9f8ea68fd..f640182444fe4 100644
--- a/decidim-budgets/config/locales/ca.yml
+++ b/decidim-budgets/config/locales/ca.yml
@@ -103,6 +103,10 @@ ca:
update: "%{user_name} ha actualitzat el projecte %{resource_name} de l'espai %{space_name}"
budget:
view: Veure tots els projectes de pressupost
+ budgets:
+ index:
+ date: Dates de votació
+ instructions: Com participar
budget_information_modal:
back_to: Tornar a %{component_name}
close_modal: Tancar el modal
@@ -119,6 +123,9 @@ ca:
highlighted_cta: Votar a %{name}
if_change_opinion: Si has canviat d'opinió, pots
my_budgets: Els meus pressupostos
+ progress: Finalitza la votació
+ show: Veure projectes
+ vote: Vota
voted_on: Has votat a %{links}
limit_announcement:
cant_vote: No pots votar a aquests pressupostos.
Prova amb un altre pressupost .
@@ -158,27 +165,31 @@ ca:
budget_summary:
are_you_sure: Segur que vols cancel·lar el teu vot?
assigned: 'Assignat:'
+ back_to_budgets: Tornar a %{component_name}
+ back_to_projects: Tornar a %{budget_name}
cancel_order: eliminar el teu vot i començar de nou
checked_out:
description: Ja has votat pel pressupost. Si has canviat d'idea, pots %{cancel_link}.
title: Vot pels pressupostos completat
minimum_projects_rule:
- description: A quins projectes creus que hem de destinar el pressupost? Selecciona com a mínim %{minimum_number} projectes i vota segons les teves preferències per a definir el pressupost.
- instruction: "
Selecciona com a mínim %{minimum_number} projectes i vota segons les teves preferències per a definir el pressupost."
+ description: A quins projectes creus que hem de destinar el pressupost? Selecciona
com a mínim %{minimum_number} projectes i vota segons les teves preferències per a definir el pressupost.
+ instruction: "Selecciona
com a mínim %{minimum_number} projectes i vota segons les teves preferències per a definir el pressupost."
projects_rule:
- description: A quins projectes creus que hem de destinar el pressupost? Selecciona entre %{minimum_number} i %{maximum_number} projectes i vota segons les teves preferències per a definir el pressupost.
- instruction: "
Selecciona entre %{minimum_number} i %{maximum_number} projectes i vota segons les teves preferències per a definir el pressupost."
+ description: A quins projectes creus que hem de destinar el pressupost? Selecciona
entre %{minimum_number} i %{maximum_number} projectes i vota segons les teves preferències per a definir el pressupost.
+ instruction: "Selecciona
entre %{minimum_number} i %{maximum_number} projectes i vota segons les teves preferències per a definir el pressupost."
projects_rule_maximum_only:
- description: A quins projectes creus que hem de destinar el pressupost? Selecciona fins a %{maximum_number} projectes i vota segons les teves preferències per a definir el pressupost.
- instruction: "
Selecciona fins a %{maximum_number} projectes i vota segons les teves preferències per a definir el pressupost."
+ description: A quins projectes creus que hem de destinar el pressupost? Selecciona
fins a %{maximum_number} projectes i vota segons les teves preferències per a definir el pressupost.
+ instruction: "Selecciona
fins a %{maximum_number} projectes i vota segons les teves preferències per a definir el pressupost."
+ remaining: 'Restant:'
rules:
title: Regles de votació
title: Tu decideixes el pressupost
total_budget: Pressupost total
total_projects: Vots totals
vote_threshold_percent_rule:
- description: A quins projectes creus que hem de destinar el pressupost? Assigna com a mínim %{minimum_budget} als projectes que vulguis i vota segons les teves preferències per a definir el pressupost.
- instruction: "
Assigna com a mínim %{minimum_budget} als projectes que vulguis i vota segons les teves preferències per a definir el pressupost."
+ description: A quins projectes creus que hem de destinar el pressupost? Assigna
com a mínim %{minimum_budget} als projectes que vulguis i vota segons les teves preferències per a definir el pressupost.
+ instruction: "Assigna
com a mínim %{minimum_budget} als projectes que vulguis i vota segons les teves preferències per a definir el pressupost."
+ vote: Vota
count:
projects_count:
one: 1 projecte
@@ -245,6 +256,7 @@ ca:
budget_voting_rule_only_one: Cal activar com a mínim una norma per a la votació
budget_voting_rule_required: Es requereix una norma per a la votació
landing_page_content: Pàgina d'inici de pressupostos
+ landing_page_instructions: Instruccions per la pàgina d'inici de pressupostos
more_information_modal: Finestra de "Més informació"
projects_per_page: Projectes per pàgina
resources_permissions_enabled: Es poden establir permisos d'accions per a cada projecte
@@ -268,6 +280,7 @@ ca:
comments_blocked: Comentaris bloquejats
highlighted_heading: Capçalera destacada
landing_page_content: Pàgina d'inici de pressupostos
+ landing_page_instructions: Instruccions per la pàgina d'inici de pressupostos
list_heading: Títol de la llista
more_information_modal: Finestra de "Més informació"
show_votes: Mostra els suports
diff --git a/decidim-budgets/config/locales/en.yml b/decidim-budgets/config/locales/en.yml
index 9d82cc6f76799..439b5b5b91869 100644
--- a/decidim-budgets/config/locales/en.yml
+++ b/decidim-budgets/config/locales/en.yml
@@ -112,6 +112,10 @@ en:
budget_list_item:
voting_finished: You have voted in this budget
voting_started: You have started to vote in this budget
+ budgets:
+ index:
+ date: Voting dates
+ instructions: How to participate
budgets_list:
cancel_order:
more_than_one: delete your vote on %{name} and start over
@@ -120,6 +124,9 @@ en:
highlighted_cta: Vote on %{name}
if_change_opinion: If you've changed your mind, you can
my_budgets: My budgets
+ progress: Finish voting
+ show: See projects
+ vote: Vote
voted_on: You've voted on %{links}
limit_announcement:
cant_vote: You can't vote on this budget.
Try on another budget.
@@ -159,27 +166,30 @@ en:
budget_summary:
are_you_sure: Are you sure you want to cancel your vote?
assigned: 'Assigned:'
+ back_to_budgets: Back to %{component_name}
+ back_to_projects: Back to %{budget_name}
cancel_order: delete your vote and start over
checked_out:
description: You've already voted for the budget. If you've changed your mind, you can %{cancel_link}.
title: Budget vote completed
minimum_projects_rule:
- description: What projects do you think we should allocate budget for? Select at least %{minimum_number} projects you want and vote according to your preferences to define the budget.
- instruction: "
Select at least %{minimum_number} projects you want and vote according to your preferences to define the budget."
+ description: What projects do you think we should allocate budget for? Select
at least %{minimum_number} projects you want and vote according to your preferences to define the budget.
+ instruction: "Select
at least %{minimum_number} projects you want and vote according to your preferences to define the budget."
projects_rule:
- description: What projects do you think we should allocate budget for? Select at least %{minimum_number} and up to %{maximum_number} projects you want and vote according to your preferences to define the budget.
- instruction: "
Select at least %{minimum_number} and up to %{maximum_number} projects you want and vote according to your preferences to define the budget."
+ description: What projects do you think we should allocate budget for? Select
at least %{minimum_number} and up to %{maximum_number} projects you want and vote according to your preferences to define the budget.
+ instruction: "Select
at least %{minimum_number} and up to %{maximum_number} projects you want and vote according to your preferences to define the budget."
projects_rule_maximum_only:
- description: What projects do you think we should allocate budget for? Select up to %{maximum_number} projects you want and vote according to your preferences to define the budget.
- instruction: "
Select up to %{maximum_number} projects you want and vote according to your preferences to define the budget."
+ description: What projects do you think we should allocate budget for? Select
up to %{maximum_number} projects you want and vote according to your preferences to define the budget.
+ instruction: "Select
up to %{maximum_number} projects you want and vote according to your preferences to define the budget."
+ remaining: 'Remaining:'
rules:
title: Budget rules
title: You decide the budget
total_budget: Total budget
total_projects: Total votes
vote_threshold_percent_rule:
- description: What projects do you think we should allocate budget for? Assign at least %{minimum_budget} to the projects you want and vote according to your preferences to define the budget.
- instruction: "
Assign at least %{minimum_budget} to the projects you want and vote according to your preferences to define the budget."
+ description: What projects do you think we should allocate budget for? Assign
at least %{minimum_budget} to the projects you want and vote according to your preferences to define the budget.
+ instruction: "Assign
at least %{minimum_budget} to the projects you want and vote according to your preferences to define the budget."
count:
projects_count:
one: 1 project
@@ -247,6 +257,7 @@ en:
budget_voting_rule_only_one: Only one voting rule must be enabled
budget_voting_rule_required: One voting rule is required
landing_page_content: Budgets landing page
+ landing_page_instructions: Budgets landing page instructions
more_information_modal: More information modal
projects_per_page: Projects per page
resources_permissions_enabled: Actions permissions can be set for each project
@@ -270,6 +281,7 @@ en:
comments_blocked: Comments blocked
highlighted_heading: Highlighted heading
landing_page_content: Budgets landing page
+ landing_page_instructions: Budgets landing page instructions
list_heading: List heading
more_information_modal: More information modal
show_votes: Show votes
diff --git a/decidim-budgets/config/locales/es.yml b/decidim-budgets/config/locales/es.yml
index bd62ac00ea5f3..426c03d7ca548 100644
--- a/decidim-budgets/config/locales/es.yml
+++ b/decidim-budgets/config/locales/es.yml
@@ -103,6 +103,10 @@ es:
update: "%{user_name} actualizó el proyecto %{resource_name} en el espacio %{space_name}"
budget:
view: Ver todos los proyectos de presupuesto
+ budgets:
+ index:
+ date: Fechas de votación
+ instructions: Cómo participar
budget_information_modal:
back_to: Volver a %{component_name}
close_modal: Cierra el modal
@@ -119,6 +123,9 @@ es:
highlighted_cta: Votar en %{name}
if_change_opinion: Si has cambiado de opinión, puedes
my_budgets: Mis presupuestos
+ progress: Finaliza la votación
+ show: Ver proyectos
+ vote: Vota
voted_on: Has votado en %{links}
limit_announcement:
cant_vote: No puedes votar en este presupuesto.
Prueba con otro presupuesto.
@@ -158,27 +165,31 @@ es:
budget_summary:
are_you_sure: '¿Estás seguro de que deseas cancelar tu voto?'
assigned: 'Asignado:'
+ back_to_budgets: Volver a %{component_name}
+ back_to_projects: Volver a %{budget_name}
cancel_order: eliminar tu voto y empezar de nuevo
checked_out:
description: Ya has votado para el presupuesto. Si has cambiado de idea, puedes %{cancel_link}.
title: Voto para los presupuestos completado
minimum_projects_rule:
- description: '¿A qué proyectos crees que deberíamos destinar el presupuesto? Selecciona por lo menos %{minimum_number} y vota según tus preferencias para definir el presupuesto.'
- instruction: "
Selecciona al menos %{minimum_number} proyectos que quieras y vota de acuerdo a tus preferencias para definir el presupuesto."
+ description: '¿A qué proyectos crees que deberíamos destinar el presupuesto? Selecciona
por lo menos %{minimum_number} proyectos y vota según tus preferencias para definir el presupuesto.'
+ instruction: "Selecciona
al menos %{minimum_number} proyectos que quieras y vota de acuerdo a tus preferencias para definir el presupuesto."
projects_rule:
- description: '¿A qué proyectos crees que deberíamos destinar el presupuesto? Selecciona entre %{minimum_number} y %{maximum_number} proyectos, y vota según tus preferencias para definir el presupuesto.'
- instruction: "
Selecciona al menos %{minimum_number} y hasta %{maximum_number} proyectos que quieras y vota de acuerdo a tus preferencias para definir el presupuesto."
+ description: '¿A qué proyectos crees que deberíamos destinar el presupuesto? Selecciona
entre %{minimum_number} y %{maximum_number} proyectos, y vota según tus preferencias para definir el presupuesto.'
+ instruction: "Selecciona
al menos %{minimum_number} y hasta %{maximum_number} proyectos que quieras y vota de acuerdo a tus preferencias para definir el presupuesto."
projects_rule_maximum_only:
- description: '¿A qué proyectos crees que deberíamos destinar el presupuesto? Selecciona hasta %{maximum_number} y vota según tus preferencias para definir el presupuesto.'
- instruction: "
Selecciona hasta %{maximum_number} proyectos que quieras y vota de acuerdo a tus preferencias para definir el presupuesto."
+ description: '¿A qué proyectos crees que deberíamos destinar el presupuesto? Selecciona
hasta %{maximum_number} proyectos y vota según tus preferencias para definir el presupuesto.'
+ instruction: "Selecciona
hasta %{maximum_number} proyectos que quieras y vota de acuerdo a tus preferencias para definir el presupuesto."
+ remaining: 'Restante:'
rules:
title: Reglas de presupuesto
title: Tú decides el presupuesto
total_budget: Presupuesto total
total_projects: Total de votos
vote_threshold_percent_rule:
- description: '¿A qué proyectos crees que deberíamos asignar el presupuesto? Asigna por lo menos %{minimum_budget} a los proyectos que desees y vota para definir el presupuesto.'
- instruction: "
Selecciona al menos %{minimum_budget} proyectos que quieras y vota de acuerdo a tus preferencias para definir el presupuesto."
+ description: '¿A qué proyectos crees que deberíamos asignar el presupuesto? Asigna
por lo menos %{minimum_budget} a los proyectos que desees y vota para definir el presupuesto.'
+ instruction: "Selecciona
al menos %{minimum_budget} proyectos que quieras y vota de acuerdo a tus preferencias para definir el presupuesto."
+ vote: Vota
count:
projects_count:
one: 1 proyecto
@@ -245,6 +256,7 @@ es:
budget_voting_rule_only_one: Hay que activar por lo menos una norma para la votación
budget_voting_rule_required: Se requiere una norma para la votación
landing_page_content: Página de inicio de presupuestos
+ landing_page_instructions: Instrucciones para la página de inicio de presupuestos
more_information_modal: Modal de "Más información"
projects_per_page: Proyectos por página
resources_permissions_enabled: Se pueden establecer permisos de acciones para cada proyecto
@@ -268,6 +280,7 @@ es:
comments_blocked: Comentarios bloqueados
highlighted_heading: Encabezado destacado
landing_page_content: Página de inicio de presupuestos
+ landing_page_instructions: Instrucciones para la página de inicio de presupuestos
list_heading: Título de lista
more_information_modal: Modal de "Más información"
show_votes: Mostrar los votos
diff --git a/decidim-budgets/lib/decidim/budgets/component.rb b/decidim-budgets/lib/decidim/budgets/component.rb
index f52389af467e1..2dce34ef6435a 100644
--- a/decidim-budgets/lib/decidim/budgets/component.rb
+++ b/decidim-budgets/lib/decidim/budgets/component.rb
@@ -94,6 +94,7 @@
settings.attribute :announcement, type: :text, translated: true, editor: true
settings.attribute :landing_page_content, type: :text, translated: true, editor: true
+ settings.attribute :landing_page_instructions, type: :text, translated: true, editor: true
settings.attribute :more_information_modal, type: :text, translated: true
end
@@ -104,6 +105,7 @@
settings.attribute :announcement, type: :text, translated: true, editor: true
settings.attribute :landing_page_content, type: :text, translated: true, editor: true
+ settings.attribute :landing_page_instructions, type: :text, translated: true, editor: true
settings.attribute :more_information_modal, type: :text, translated: true
settings.attribute :announcement, type: :text, translated: true, editor: true
end
diff --git a/decidim-budgets/lib/decidim/budgets/test/factories.rb b/decidim-budgets/lib/decidim/budgets/test/factories.rb
index 251c0066f9c90..419ae4e2d15c2 100644
--- a/decidim-budgets/lib/decidim/budgets/test/factories.rb
+++ b/decidim-budgets/lib/decidim/budgets/test/factories.rb
@@ -98,6 +98,22 @@
}
end
end
+
+ trait :with_landing_page_content do
+ transient do
+ landing_page_content { Decidim::Faker::Localized.wrapped("
", "
") }
+ landing_page_instructions { Decidim::Faker::Localized.wrapped("
", "
") }
+ end
+
+ step_settings do
+ {
+ participatory_space.active_step.id => {
+ landing_page_content: landing_page_content,
+ landing_page_instructions: landing_page_instructions
+ }
+ }
+ end
+ end
end
factory :budget, class: "Decidim::Budgets::Budget" do
diff --git a/decidim-budgets/spec/system/explore_budgets_spec.rb b/decidim-budgets/spec/system/explore_budgets_spec.rb
index b28c02250df48..2c5ba00c074a4 100644
--- a/decidim-budgets/spec/system/explore_budgets_spec.rb
+++ b/decidim-budgets/spec/system/explore_budgets_spec.rb
@@ -6,6 +6,29 @@
include_context "with a component"
let(:manifest_name) { "budgets" }
+ let!(:component) do
+ create(:budgets_component,
+ :with_vote_threshold_percent,
+ :with_landing_page_content,
+ manifest: manifest,
+ participatory_space: participatory_process,
+ landing_page_content: { en: "
Big title
" },
+ landing_page_instructions: { en: "
Follow your instincts
" })
+ end
+
+ let!(:current_step) do
+ create(:participatory_process_step,
+ start_date: 1.day.ago,
+ end_date: 3.days.from_now,
+ participatory_process: participatory_process
+ )
+ end
+
+ before do
+ participatory_process.steps.first.update(start_date: 1.month.ago, end_date: 1.day.ago - 1.hour, active: false)
+ participatory_process.steps.last.update(active: true)
+ end
+
context "with only one budget" do
let!(:budgets) { create_list(:budget, 1, component: component) }
@@ -17,15 +40,86 @@
end
context "with many budgets" do
- let!(:budgets) { create_list(:budget, 6, component: component) }
+ let!(:budgets) do
+ 1.upto(6).to_a.map { |x| create(:budget, component: component, total_budget: x * 10_000_000, description: { en: "This is budget #{x}" }) }
+ end
- it "lists all the budgets" do
+ before do
visit_component
+ end
+ it "shows the content" do
+ expect(page).to have_content("Big title")
+ end
+
+ it "shows the dates" do
+ expect(page).to have_content("Voting dates")
+
+ within ".extra__date-container" do
+ expect(page).to have_content(I18n.l(current_step.start_date, format: "%B"))
+ expect(page).to have_content(current_step.start_date.day)
+ expect(page).to have_content(I18n.l(current_step.end_date, format: "%B"))
+ expect(page).to have_content(current_step.end_date.day)
+ end
+ end
+
+ it "shows the instructions" do
+ expect(page).to have_content("How to participate")
+ expect(page).to have_content("Follow your instincts")
+ end
+
+ it "lists all the budgets" do
expect(page).to have_selector(".card--list__item", count: 6)
budgets.each do |budget|
expect(page).to have_content(translated(budget.title))
+ expect(page).to have_content("This is budget 1")
+ expect(page).to have_content("€10,000,000")
+ end
+ end
+
+ describe "budget list item" do
+ let(:budget) { budgets.first }
+ let(:item) { page.find(".budget-list .card--list__item:first-child", match: :first) }
+ let!(:projects) { create_list(:project, 3, budget: budget, budget_amount: 10_000_000) }
+
+ before do
+ login_as user, scope: :user
+ end
+
+ it "has a clickable title" do
+ expect(item).to have_link(translated(budget.title), href: budget_path(budget))
+ end
+
+ context "when an item is bookmarked" do
+ let!(:order) { create(:order, user: user, budget: budget) }
+ let!(:line_item) { create(:line_item, order: order, project: projects.first) }
+
+ it "shows the bookmark icon" do
+ visit_component
+
+ expect(item).to have_selector(".budget-list__icon .icon--bookmark")
+ expect(item).to have_link("Finish voting", href: budget_path(budget))
+ end
+ end
+
+ context "when an item is voted" do
+ let(:item) { page.find("#voted-budgets .card--list__item:first-child") }
+
+ let!(:order) do
+ order = create(:order, user: user, budget: budget)
+ order.projects = [projects.first]
+ order.checked_out_at = Time.current
+ order.save!
+ order
+ end
+
+ it "shows the check icon" do
+ visit_component
+
+ expect(item).to have_selector(".budget-list__icon .icon--check")
+ expect(item).to have_link("Show", href: budget_path(budget))
+ end
end
end
end
@@ -35,4 +129,8 @@
let(:target_path) { Decidim::EngineRouter.main_proxy(component).budget_path(99_999_999) }
end
end
+
+ def budget_path(budget)
+ Decidim::EngineRouter.main_proxy(component).budget_path(budget.id)
+ end
end
diff --git a/decidim-budgets/spec/system/explore_projects_spec.rb b/decidim-budgets/spec/system/explore_projects_spec.rb
index ca97bbbd83b63..60734722f56d6 100644
--- a/decidim-budgets/spec/system/explore_projects_spec.rb
+++ b/decidim-budgets/spec/system/explore_projects_spec.rb
@@ -14,8 +14,13 @@
let(:categories) { create_list(:category, 3, participatory_space: component.participatory_space) }
describe "index" do
- it "shows all resources for the given component" do
+ before do
visit_budget
+ end
+
+ it_behaves_like "has focus mode", "TOTAL BUDGET"
+
+ it "shows all resources for the given component" do
within "#projects" do
expect(page).to have_selector(".budget-list__item", count: projects_count)
end
diff --git a/decidim-budgets/spec/system/orders_spec.rb b/decidim-budgets/spec/system/orders_spec.rb
index af1362b7f6d73..4c9e27c9157fd 100644
--- a/decidim-budgets/spec/system/orders_spec.rb
+++ b/decidim-budgets/spec/system/orders_spec.rb
@@ -21,9 +21,13 @@
context "when the user is not logged in" do
let!(:projects) { create_list(:project, 1, budget: budget, budget_amount: 25_000_000) }
- it "is given the option to sign in" do
+ before do
visit_budget
+ end
+ it_behaves_like "has focus mode", "TOTAL BUDGET"
+
+ it "is given the option to sign in" do
within "#project-#{project.id}-item" do
page.find(".budget-list__action").click
end
@@ -44,15 +48,12 @@
visit_budget
end
+ it_behaves_like "has focus mode", "You decide the budget"
+
context "when voting by percentage threshold" do
- it "displays description messages" do
+ it "displays description messages and voting rules" do
within ".budget-summary" do
- expect(page).to have_content("You decide the budget\nWhat projects do you think we should allocate budget for? Assign at least €70,000,000 to the projects you want and vote according to your preferences to define the budget.")
- end
- end
-
- it "displays rules" do
- within ".voting-rules" do
+ expect(page).to have_content("You decide the budget")
expect(page).to have_content("Assign at least €70,000,000 to the projects you want and vote according to your preferences to define the budget.")
end
end
@@ -66,15 +67,23 @@
participatory_space: participatory_process)
end
- it "displays description messages" do
+ it "displays voting rules" do
within ".budget-summary" do
- expect(page).to have_content("What projects do you think we should allocate budget for? Select at least 3 projects you want and vote according to your preferences to define the budget.")
+ expect(page).to have_content("Select at least 3 projects you want and vote according to your preferences to define the budget.")
end
end
- it "displays rules" do
- within ".voting-rules" do
- expect(page).to have_content("Select at least 3 projects you want and vote according to your preferences to define the budget.")
+ it "shows the project count in the progress bar" do
+ within ".progress-meter-text" do
+ expect(page).to have_content("0 projects selected")
+ end
+
+ within "#project-#{project.id}-item" do
+ page.find(".budget-list__action").click
+ end
+
+ within ".progress-meter-text" do
+ expect(page).to have_content("1 project selected")
end
end
end
@@ -88,14 +97,8 @@
participatory_space: participatory_process)
end
- it "displays description messages" do
+ it "displays voting rules" do
within ".budget-summary" do
- expect(page).to have_content("What projects do you think we should allocate budget for? Select up to 6 projects you want and vote according to your preferences to define the budget.")
- end
- end
-
- it "displays rules" do
- within ".voting-rules" do
expect(page).to have_content("Select up to 6 projects you want and vote according to your preferences to define the budget.")
end
end
@@ -109,14 +112,8 @@
participatory_space: participatory_process)
end
- it "displays description messages" do
+ it "displays voting rules" do
within ".budget-summary" do
- expect(page).to have_content("What projects do you think we should allocate budget for? Select at least 3 and up to 6 projects you want and vote according to your preferences to define the budget.")
- end
- end
-
- it "displays rules" do
- within ".voting-rules" do
expect(page).to have_content("Select at least 3 and up to 6 projects you want and vote according to your preferences to define the budget.")
end
end
@@ -137,6 +134,7 @@
expect(page).to have_selector ".budget-list__data--added", count: 1
expect(page).to have_content "ASSIGNED: €25,000,000"
+ expect(page).to have_content "REMAINING: €75,000,000"
expect(page).to have_content "1 project selected"
within ".budget-summary__selected" do
@@ -172,6 +170,7 @@
expect(page).to have_selector ".budget-list__data--added", count: 1
expect(page).to have_content "ASSIGNED: €25,000,000"
+ expect(page).to have_content "REMAINING: €75,000,000"
expect(page).to have_content "1 project selected"
within ".budget-summary__selected" do
@@ -179,7 +178,7 @@
end
within "#order-progress .budget-summary__progressbox" do
- expect(page).to have_content "25%"
+ expect(page).to have_content "1 project selected"
expect(page).to have_selector("button.small:disabled")
end
end
@@ -295,6 +294,7 @@
visit_budget
expect(page).to have_content "ASSIGNED: €25,000,000"
+ expect(page).to have_content "REMAINING: €75,000,000"
within "#project-#{project.id}-item" do
page.find(".budget-list__action").click
@@ -317,11 +317,13 @@
visit_budget
expect(page).to have_content "ASSIGNED: €25,000,000"
+ expect(page).to have_content "REMAINING: €75,000,000"
# Note that this is not a default alert box, this is the default browser
# prompt for verifying the page unload. Therefore, `dismiss_prompt` is
# used instead of `dismiss_confirm`.
dismiss_prompt do
+ page.find(".focus-mode__close").click
page.find(".logo-wrapper a").click
end
@@ -491,6 +493,7 @@
expect(page).to have_content("Budget vote completed")
+ page.find(".focus-mode__close").click
page.find(".logo-wrapper a").click
expect(page).to have_current_path decidim.root_path
@@ -562,7 +565,7 @@
visit_budget
- expect(page).to have_selector("[id^=project-]", count: 1)
+ expect(page).to have_selector("[id^=project-][id$=-item]", count: 1)
end
it "respects the projects_per_page setting when it matches total projects" do
@@ -572,7 +575,7 @@
visit_budget
- expect(page).to have_selector("[id^=project-]", count: 2)
+ expect(page).to have_selector("[id^=project-][id$=-item]", count: 2)
end
it "respects the projects_per_page setting when over total projects" do
@@ -582,7 +585,7 @@
visit_budget
- expect(page).to have_selector("[id^=project-]", count: 2)
+ expect(page).to have_selector("[id^=project-][id$=-item]", count: 2)
end
end
diff --git a/decidim-core/app/cells/decidim/date_range/show.erb b/decidim-core/app/cells/decidim/date_range/show.erb
index 7f294f07796f4..84d6efdf2377d 100644
--- a/decidim-core/app/cells/decidim/date_range/show.erb
+++ b/decidim-core/app/cells/decidim/date_range/show.erb
@@ -1,4 +1,4 @@
-