From dbc51bcdcdcbe19e5e9c7a24b0ccccc4ccc1e652 Mon Sep 17 00:00:00 2001 From: taitus Date: Tue, 12 Apr 2022 11:13:28 +0200 Subject: [PATCH 1/4] Improve hint information related to duration phases Specify that this field is for information purposes only and does not automatically update phase status. We also improve enable help text. --- app/assets/stylesheets/layout.scss | 4 ++++ app/components/admin/budget_phases/form_component.html.erb | 2 +- config/locales/en/admin.yml | 4 ++-- config/locales/es/admin.yml | 4 ++-- spec/system/admin/budget_phases_spec.rb | 4 ++++ 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index b4eecfd5f..46036acb7 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -450,6 +450,10 @@ button, .help-text { line-height: rem-calc(20); margin-top: 0; + + strong { + font-style: normal; + } } .menu-and-content { diff --git a/app/components/admin/budget_phases/form_component.html.erb b/app/components/admin/budget_phases/form_component.html.erb index 337eb0b60..9bc83b917 100644 --- a/app/components/admin/budget_phases/form_component.html.erb +++ b/app/components/admin/budget_phases/form_component.html.erb @@ -12,7 +12,7 @@

- <%= t("admin.budget_phases.edit.duration_description") %> + <%= sanitize(t("admin.budget_phases.edit.duration_description")) %>

diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index e26670d17..ae68400d0 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -215,8 +215,8 @@ en: title: "Edit phase" description_help_text: This text will appear in the header when the phase is active duration: "Phase's duration" - duration_description: "The period of time this phase will be active." - enabled_help_text: This phase will be public in the budget's phases timeline, as well as active for any other purpose + duration_description: "These fields are used for information purposes only and do not trigger an automatic update of the active phase. In order to update it, edit the budget and select the active phase." + enabled_help_text: This phase will be public in the budget's phases timeline. image_description: "If an image is uploaded it will be displayed next to the description of this phase." main_call_to_action: "Main call to action (optional)" main_call_to_action_description: "This link will appear on main banner of this participatory budget when this phase is enabled and encourages your user to perform a specific action like creating a proposal, voting for existing ones, or learn more about the process." diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index fd7a0d28c..a77b2148a 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -214,8 +214,8 @@ es: edit: description_help_text: Este texto aparecerá en la cabecera cuando la fase esté activa duration: "Duración de la fase" - duration_description: "El período de tiempo que esta fase estará activa." - enabled_help_text: Esta fase será pública en el calendario de fases del presupuesto y estará activa para otros propósitos + duration_description: "Estos campos se utilizan únicamente con fines informativos y no provocan una actualización automática de la fase activa. Para actualizarla, edita el presupuesto y selecciona la fase activa." + enabled_help_text: Esta fase será pública en el calendario de fases del presupuesto. image_description: "Si se proporciona una imagen se mostrará junto a la descripción de esta fase." main_call_to_action: "Enlace de acción principal (opcional)" main_call_to_action_description: "Este enlace aparecerá en la cabecera de este presupuesto participativo cuando esta fase esté activa y permite al usuario ejecutar una acción específica como crear una nueva propuesta, votar las existentes, o leer más sobre el funcionamiento de los presupuestos participativos." diff --git a/spec/system/admin/budget_phases_spec.rb b/spec/system/admin/budget_phases_spec.rb index 257b33141..f30cd3fc8 100644 --- a/spec/system/admin/budget_phases_spec.rb +++ b/spec/system/admin/budget_phases_spec.rb @@ -7,6 +7,10 @@ describe "Admin budget phases" do scenario "Update phase" do visit edit_admin_budget_budget_phase_path(budget, budget.current_phase) + expect(page).to have_content "These fields are used for information purposes only and do not trigger "\ + "an automatic update of the active phase. In order to update it, edit "\ + "the budget and select the active phase." + fill_in "start_date", with: Date.current + 1.day fill_in "end_date", with: Date.current + 12.days fill_in_ckeditor "Description", with: "New description of the phase." From 2464b517c1ad5f82bf07c4d036a29a53ad680c91 Mon Sep 17 00:00:00 2001 From: taitus Date: Tue, 12 Apr 2022 11:15:07 +0200 Subject: [PATCH 2/4] Add hint information related to phase dates --- app/components/admin/budget_phases/form_component.html.erb | 4 ++-- config/locales/en/admin.yml | 1 + config/locales/es/admin.yml | 1 + spec/system/admin/budget_phases_spec.rb | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/components/admin/budget_phases/form_component.html.erb b/app/components/admin/budget_phases/form_component.html.erb index 9bc83b917..dc0ed15ea 100644 --- a/app/components/admin/budget_phases/form_component.html.erb +++ b/app/components/admin/budget_phases/form_component.html.erb @@ -16,11 +16,11 @@

- <%= f.date_field :starts_at, id: "start_date" %> + <%= f.date_field :starts_at, id: "start_date", hint: t("admin.budget_phases.edit.dates_help_text") %>
- <%= f.date_field :ends_at, id: "end_date" %> + <%= f.date_field :ends_at, id: "end_date", hint: t("admin.budget_phases.edit.dates_help_text") %>
diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index ae68400d0..0b7a95011 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -213,6 +213,7 @@ en: budget_phases: edit: title: "Edit phase" + dates_help_text: "For information purposes only" description_help_text: This text will appear in the header when the phase is active duration: "Phase's duration" duration_description: "These fields are used for information purposes only and do not trigger an automatic update of the active phase. In order to update it, edit the budget and select the active phase." diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index a77b2148a..5658d3190 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -212,6 +212,7 @@ es: title: "Partidas de %{budget} / %{group}" budget_phases: edit: + dates_help_text: "Solo con fines informativos" description_help_text: Este texto aparecerá en la cabecera cuando la fase esté activa duration: "Duración de la fase" duration_description: "Estos campos se utilizan únicamente con fines informativos y no provocan una actualización automática de la fase activa. Para actualizarla, edita el presupuesto y selecciona la fase activa." diff --git a/spec/system/admin/budget_phases_spec.rb b/spec/system/admin/budget_phases_spec.rb index f30cd3fc8..0ea1dd612 100644 --- a/spec/system/admin/budget_phases_spec.rb +++ b/spec/system/admin/budget_phases_spec.rb @@ -10,6 +10,7 @@ describe "Admin budget phases" do expect(page).to have_content "These fields are used for information purposes only and do not trigger "\ "an automatic update of the active phase. In order to update it, edit "\ "the budget and select the active phase." + expect(page).to have_content "For information purposes only" fill_in "start_date", with: Date.current + 1.day fill_in "end_date", with: Date.current + 12.days From bdf4d6a79c781051e5f0025aa5cc0f523b704236 Mon Sep 17 00:00:00 2001 From: taitus Date: Tue, 12 Apr 2022 11:26:11 +0200 Subject: [PATCH 3/4] Do not use the wizard component when edit phases Currently we were using the wizard component to edit a phase when we were no longer in the wizard. This was a bit strange, as it took us out of the context and showed us information such as the CreationTimelineComponent or the HelpComponent that is meant for when navigating the Wizard. --- app/views/admin/budget_phases/edit.html.erb | 8 +++++++- spec/system/admin/budget_phases_spec.rb | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/views/admin/budget_phases/edit.html.erb b/app/views/admin/budget_phases/edit.html.erb index 27fbdd585..39df36274 100644 --- a/app/views/admin/budget_phases/edit.html.erb +++ b/app/views/admin/budget_phases/edit.html.erb @@ -1 +1,7 @@ -<%= render Admin::BudgetsWizard::Phases::EditComponent.new(@phase) %> +<%= back_link_to admin_budget_path(@budget) %> + +

<%= @budget.name %>

+ +

<%= "#{t("admin.budget_phases.edit.title")} - #{@phase.name}" %>

+ +<%= render "form" %> diff --git a/spec/system/admin/budget_phases_spec.rb b/spec/system/admin/budget_phases_spec.rb index 0ea1dd612..03de1cbdd 100644 --- a/spec/system/admin/budget_phases_spec.rb +++ b/spec/system/admin/budget_phases_spec.rb @@ -37,7 +37,7 @@ describe "Admin budget phases" do within("tr", text: "Accepting projects") { click_link "Edit" } end - expect(page).to have_css "h2", exact_text: "Edit phase - Accepting projects" + expect(page).to have_css "h3", exact_text: "Edit phase - Accepting projects" fill_in "Name", with: "My phase custom name" click_button "Save changes" From 703e28e6cdce8d67be8efacd9f67a5f85cd2b9cc Mon Sep 17 00:00:00 2001 From: taitus Date: Tue, 12 Apr 2022 11:42:49 +0200 Subject: [PATCH 4/4] Add information to the phase table to clarify its functionality. Add a help text on admin budget show page and improve text from Admin::Budgets::HelpComponent in order to clarify its functionality when we are using the wizard. --- app/assets/stylesheets/admin/budgets/show.scss | 6 ++++++ app/components/admin/budgets/show_component.html.erb | 3 ++- config/locales/en/admin.yml | 3 ++- config/locales/es/admin.yml | 3 ++- spec/system/admin/budgets_spec.rb | 3 +++ 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/admin/budgets/show.scss b/app/assets/stylesheets/admin/budgets/show.scss index a35465ce3..f71179422 100644 --- a/app/assets/stylesheets/admin/budgets/show.scss +++ b/app/assets/stylesheets/admin/budgets/show.scss @@ -13,4 +13,10 @@ h4 { @include header-font-size(h3); } + + .phases { + h3 { + margin-bottom: 0; + } + } } diff --git a/app/components/admin/budgets/show_component.html.erb b/app/components/admin/budgets/show_component.html.erb index b5e3e4cda..1ad9a1468 100644 --- a/app/components/admin/budgets/show_component.html.erb +++ b/app/components/admin/budgets/show_component.html.erb @@ -11,8 +11,9 @@ <%= render Admin::Budgets::GroupsAndHeadingsComponent.new(budget) %> -
+

<%= t("admin.budgets.edit.phases_caption") %>

+ <%= t("admin.budgets.edit.phases_table_help_text") %> <%= render Admin::BudgetPhases::PhasesComponent.new(budget) %>
diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index 0b7a95011..e234e08dc 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -113,6 +113,7 @@ en: delete: Delete budget phase: Phase phases_caption: "Phases" + phases_table_help_text: "The configuration of these phases is used for information purposes only. Its function is to define the phases information displayed on the public page of the participatory budget." duration: "Duration" enabled: Enabled actions: Actions @@ -153,7 +154,7 @@ en: 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." + phases: "Participatory budgets have different phases. Here you can enable or disable phases and also customize each individual phase. The configuration of these phases is used for information purposes only and will be displayed on the public page of the participatory budget." show: add_group: "Add group" add_heading: "Add heading" diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index 5658d3190..d33daa508 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -113,6 +113,7 @@ es: delete: Eliminar presupuesto phase: Fase phases_caption: "Fases" + phases_table_help_text: "La configuración de estas fases se utiliza únicamente con fines informativos. Su función es definir la información de las fases que se muestra en la página pública del presupuesto participativo." duration: "Duración" enabled: Habilitada actions: Acciones @@ -153,7 +154,7 @@ es: 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." + phases: "Los presupuestos participativos tienen distintas fases. Aquí puedes habilitar o deshabilitar fases y también personalizar cada una de las fases. La configuración de estas fases se utiliza únicamente con fines informativos y se mostrará en la página pública del presupuesto participativo." show: add_group: "Añadir grupo" add_heading: "Añadir partida" diff --git a/spec/system/admin/budgets_spec.rb b/spec/system/admin/budgets_spec.rb index 207d40a0e..bfaf86320 100644 --- a/spec/system/admin/budgets_spec.rb +++ b/spec/system/admin/budgets_spec.rb @@ -235,6 +235,9 @@ describe "Admin budgets", :admin do visit admin_budget_path(budget) + expect(page).to have_content "The configuration of these phases is used for information purposes "\ + "only. Its function is to define the phases information displayed "\ + "on the public page of the participatory budget." expect(page).to have_table "Phases", with_cols: [ [ "Information",