Adapt help component to multiple and single budget mode

This commit is contained in:
Julian Herrero
2020-03-15 06:51:52 +01:00
committed by Javi Martín
parent f126f2c154
commit 51bca66533
10 changed files with 34 additions and 17 deletions

View File

@@ -5,9 +5,17 @@ class Admin::Budgets::HelpComponent < ApplicationComponent
@i18n_namespace = i18n_namespace
end
def budget_mode
(helpers.budget_mode if helpers.respond_to?(:budget_mode)) || "multiple"
end
private
def text
t("admin.#{i18n_namespace}.index.help")
if t("admin.budgets.help.#{i18n_namespace}").is_a?(Hash)
t("admin.budgets.help.#{i18n_namespace}.#{budget_mode}")
else
t("admin.budgets.help.#{i18n_namespace}")
end
end
end

View File

@@ -2,5 +2,6 @@
<%= header %>
<%= render Admin::Budgets::HelpComponent.new("budgets") %>
<%= render Admin::BudgetsWizard::CreationTimelineComponent.new("budget") %>
<%= render Admin::Budgets::FormComponent.new(budget, wizard: true) %>

View File

@@ -2,7 +2,7 @@
<%= header %>
<%= render Admin::Budgets::HelpComponent.new("budget_groups") %>
<%= render Admin::Budgets::HelpComponent.new("groups") %>
<%= render Admin::BudgetsWizard::CreationTimelineComponent.new("groups") %>
<% unless single_heading? %>

View File

@@ -2,7 +2,7 @@
<%= header %>
<%= render Admin::Budgets::HelpComponent.new("budget_headings") %>
<%= render Admin::Budgets::HelpComponent.new("headings") %>
<%= render Admin::BudgetsWizard::CreationTimelineComponent.new("headings") %>
<% unless single_heading? %>

View File

@@ -2,7 +2,7 @@
<%= header %>
<%= render Admin::Budgets::HelpComponent.new("budget_phases") %>
<%= render Admin::Budgets::HelpComponent.new("phases") %>
<%= render Admin::BudgetsWizard::CreationTimelineComponent.new("phases") %>
<%= form_for budget, url: update_all_admin_budgets_wizard_budget_budget_phases_path(budget) do |f| %>

View File

@@ -7,5 +7,5 @@
<%= link_to t("admin.budget_groups.form.create"), new_admin_budget_group_path %>
</header>
<%= render Admin::Budgets::HelpComponent.new("budget_groups") %>
<%= render Admin::Budgets::HelpComponent.new("groups") %>
<%= render Admin::BudgetGroups::GroupsComponent.new(@groups) %>

View File

@@ -5,5 +5,5 @@
<%= link_to t("admin.budget_headings.form.create"), new_admin_budget_group_heading_path %>
</header>
<%= render Admin::Budgets::HelpComponent.new("budget_headings") %>
<%= render Admin::Budgets::HelpComponent.new("headings") %>
<%= render Admin::BudgetHeadings::HeadingsComponent.new(@headings) %>

View File

@@ -147,9 +147,7 @@ ignore_unused:
- "admin.hidden_proposal_notifications.index.filter*"
- "admin.budgets.index.filter*"
- "admin.budgets.edit.(administrators|valuators).*"
- "admin.budget_groups.index.*.help_block"
- "admin.budget_headings.index.*.help_block"
- "admin.budget_phases.index.help_block"
- "admin.budgets.help.*"
- "admin.budget_investments.index.filter*"
- "admin.budgets_wizard.heading_mode.*"
- "admin.organizations.index.filter*"

View File

@@ -78,7 +78,6 @@ en:
all: All
open: Open
finished: Finished
help: "Participatory budgets allow citizens to propose and decide directly how to spend part of the budget, with monitoring and rigorous evaluation of proposals by the institution."
budget_investments: Manage projects
table_completed: Completed
table_draft: "Draft"
@@ -135,6 +134,15 @@ en:
new:
title_multiple: New multiple headings budget
title_single: New single heading budget
help:
budgets: "Participatory budgets allow citizens to propose and decide directly how to spend part of the budget, with monitoring and rigorous evaluation of proposals by the institution."
groups:
multiple: "Groups are meant to organize headings. After a group is created and it contais headings, it's possible to determine in how many headings a user can vote per group."
single: "Groups are meant to organize headings, since this budget will only contain one heading, the same name can be used because it will not appear anywhere. You can just continue with the next step."
headings:
multiple: "Headings are meant to divide the money of the participatory budget. Here you can add headings for this group and assign the amount of money that will be used for each heading."
single: "Headings are meant to divide the money of the participatory budget. Since this budget will only contain one heading, this is the place where you stablish the money that will be spent in this participaroty budget."
phases: "Participatory budgets have different phases. Here you can enable or disable phases and also customize each individual phase."
winners:
calculate: Calculate Winner Investments
calculated: Winners being calculated, it may take a minute.
@@ -163,7 +171,6 @@ en:
submit: "Save group"
index:
back: "Go back to budgets"
help: "Groups are meant to organize headings. After a group is created and it contais headings, it's possible to determine in how many headings a user can vote per group."
new_button: "Add new group"
budget_headings:
no_headings: "There are no headings."
@@ -191,7 +198,6 @@ en:
the_other_group: "Manage headings from the %{group} group."
index:
back: "Go back to groups"
help: "Headings are meant to divide the money of the participatory budget. Here you can add headings for this group and assign the amount of money that will be used for each heading."
new_button: "Add new heading"
title: "%{budget} / %{group} headings"
budget_phases:
@@ -207,7 +213,6 @@ en:
name_help_text: "This is the title of the phase users will read on the header whenever this phase is active."
save_changes: Save changes
index:
help: "Participatory budgets have different phases. Here you can enable or disable phases and also customize each individual phase."
title: "%{budget} phases"
budget_investments:
index:

View File

@@ -78,7 +78,6 @@ es:
all: Todos
open: Abiertos
finished: Terminados
help: "Los presupuestos participativos permiten que los ciudadanos propongan y decidan de manera directa cómo gastar parte del presupuesto, con un seguimiento y evaluación riguroso de las propuestas por parte de la institución."
budget_investments: Gestionar proyectos de gasto
table_completed: Completado
table_draft: "Borrador"
@@ -135,6 +134,15 @@ es:
new:
title_multiple: Nuevo presupuesto de múltiples partidas
title_single: Nuevo presupuesto de partida única
help:
budgets: "Los presupuestos participativos permiten que los ciudadanos propongan y decidan de manera directa cómo gastar parte del presupuesto, con un seguimiento y evaluación riguroso de las propuestas por parte de la institución."
groups:
multiple: "Los grupos sirven para organizar las partidas del presupuesto. Después de que un grupo sea creado y éste contenga partidas, es posible determinar el número de partidas a las que un usuario puede votar por grupo."
single: "Los grupos sirven para organizar las partidas del presupuesto, como este presupuesto sólo contendrá una partida, se puede usar el mismo nombre y éste no aparecerá en ninguna parte. Puedes continuar con el siguiente paso."
headings:
multiple: "Las partidas sirven para dividir el dinero del presupuesto participativo. Aquí puedes ir añadiendo partidas para cada grupo y establecer la cantidad de dinero que se gastará en cada partida."
single: "Las partidas sirven para dividir el dinero del presupuesto participativo. Como este presupuesto solo tendrá una partida aquí podrás establecer la cantidad de dinero que se gastará en este presupuesto participativo."
phases: "Los presupuestos participativos tienen distintas fases. Aquí puedes habilitar o deshabilitar fases y también personalizar cada una de las fases."
winners:
calculate: Calcular proyectos ganadores
calculated: Calculando ganadores, puede tardar un minuto.
@@ -163,7 +171,6 @@ es:
submit: "Guardar grupo"
index:
back: "Volver a presupuestos"
help: "Los grupos sirven para organizar las partidas del presupuesto. Después de que un grupo sea creado y éste contenga partidas, es posible determinar el número de partidas a las que un usuario puede votar por grupo."
new_button: "Añadir un grupo nuevo"
budget_headings:
no_headings: "No hay partidas."
@@ -191,7 +198,6 @@ es:
the_other_group: "Ir a partidas del grupo %{group}."
index:
back: "Volver a grupos"
help: "Las partidas sirven para dividir el dinero del presupuesto participativo. Aquí puedes ir añadiendo partidas para cada grupo y establecer la cantidad de dinero que se gastará en cada partida."
new_button: "Añadir una partida nueva"
title: "Partidas de %{budget} / %{group}"
budget_phases:
@@ -207,7 +213,6 @@ es:
save_changes: Guardar cambios
title: "Editar fase"
index:
help: "Los presupuestos participativos tienen distintas fases. Aquí puedes habilitar o deshabilitar fases y también personalizar cada una de las fases."
title: "Fases de %{budget}"
budget_investments:
index: