From 59b7d5b58e198ad646620eda5232fa3c2861a14f Mon Sep 17 00:00:00 2001 From: taitus Date: Tue, 24 Sep 2019 18:10:24 +0200 Subject: [PATCH 01/48] Add new wizard section on admin sidebar menu - Add Wizard section - Add Wizard controller - Add Routes --- app/controllers/admin/wizards_controller.rb | 6 ++++++ app/views/admin/_menu.html.erb | 4 ++++ config/routes/admin.rb | 3 +++ 3 files changed, 13 insertions(+) create mode 100644 app/controllers/admin/wizards_controller.rb diff --git a/app/controllers/admin/wizards_controller.rb b/app/controllers/admin/wizards_controller.rb new file mode 100644 index 00000000000..f300c763a02 --- /dev/null +++ b/app/controllers/admin/wizards_controller.rb @@ -0,0 +1,6 @@ +class Admin::WizardsController < Admin::BaseController + + def index + end + +end diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb index 91245c0cf12..c1bb6519f1c 100644 --- a/app/views/admin/_menu.html.erb +++ b/app/views/admin/_menu.html.erb @@ -306,6 +306,10 @@
  • > <%= link_to t("admin.menu.local_census_records"), admin_local_census_records_path %>
  • + +
  • > + <%= link_to t("admin.menu.wizards"), admin_wizards_path %> +
  • diff --git a/config/routes/admin.rb b/config/routes/admin.rb index 09572542b92..986a8b5921c 100644 --- a/config/routes/admin.rb +++ b/config/routes/admin.rb @@ -260,4 +260,7 @@ namespace :local_census_records do resources :imports, only: [:new, :create, :show] end + + resources :wizards, only: :index + end From 484222a70c12b40ee25c0ec55ea4de57dd855fe8 Mon Sep 17 00:00:00 2001 From: taitus Date: Tue, 24 Sep 2019 18:13:23 +0200 Subject: [PATCH 02/48] Add wizard index --- app/controllers/admin/wizards_controller.rb | 1 + app/views/admin/wizards/_wizard.html.erb | 11 +++++++++++ app/views/admin/wizards/index.html.erb | 8 ++++++++ 3 files changed, 20 insertions(+) create mode 100644 app/views/admin/wizards/_wizard.html.erb create mode 100644 app/views/admin/wizards/index.html.erb diff --git a/app/controllers/admin/wizards_controller.rb b/app/controllers/admin/wizards_controller.rb index f300c763a02..5cc4bb959e7 100644 --- a/app/controllers/admin/wizards_controller.rb +++ b/app/controllers/admin/wizards_controller.rb @@ -1,6 +1,7 @@ class Admin::WizardsController < Admin::BaseController def index + @wizards = ["installation"].freeze end end diff --git a/app/views/admin/wizards/_wizard.html.erb b/app/views/admin/wizards/_wizard.html.erb new file mode 100644 index 00000000000..63a65ad18ff --- /dev/null +++ b/app/views/admin/wizards/_wizard.html.erb @@ -0,0 +1,11 @@ + + + <%= t("admin.settings.index.#{wizard}.title") %> +
    + + <%= t("admin.settings.index.#{wizard}.description") %> + + + + + diff --git a/app/views/admin/wizards/index.html.erb b/app/views/admin/wizards/index.html.erb new file mode 100644 index 00000000000..e912a25b844 --- /dev/null +++ b/app/views/admin/wizards/index.html.erb @@ -0,0 +1,8 @@ +

    <%= t("admin.settings.wizards.index.title") %>

    +
    + + + <%= render partial: "wizard", collection: @wizards %> + +
    +
    From 4f88ad94145373d4395fe486fb167fc169abcc52 Mon Sep 17 00:00:00 2001 From: taitus Date: Tue, 24 Sep 2019 18:16:10 +0200 Subject: [PATCH 03/48] Add new wizards installation controller --- app/controllers/admin/wizards/installer_controller.rb | 2 ++ app/views/admin/wizards/_wizard.html.erb | 1 + config/routes/admin.rb | 3 +++ 3 files changed, 6 insertions(+) create mode 100644 app/controllers/admin/wizards/installer_controller.rb diff --git a/app/controllers/admin/wizards/installer_controller.rb b/app/controllers/admin/wizards/installer_controller.rb new file mode 100644 index 00000000000..ccc47a2fdab --- /dev/null +++ b/app/controllers/admin/wizards/installer_controller.rb @@ -0,0 +1,2 @@ +class Admin::Wizards::InstallerController < Admin::BaseController +end diff --git a/app/views/admin/wizards/_wizard.html.erb b/app/views/admin/wizards/_wizard.html.erb index 63a65ad18ff..722904a508e 100644 --- a/app/views/admin/wizards/_wizard.html.erb +++ b/app/views/admin/wizards/_wizard.html.erb @@ -7,5 +7,6 @@ + <%= link_to t("admin.actions.configure"), new_admin_wizards_installer_path, class: "button hollow" %> diff --git a/config/routes/admin.rb b/config/routes/admin.rb index 986a8b5921c..045c80e957b 100644 --- a/config/routes/admin.rb +++ b/config/routes/admin.rb @@ -262,5 +262,8 @@ end resources :wizards, only: :index + namespace :wizards do + resources :installer, only: [:new, :show] + end end From 6d2fd34b4f0c0ca86687b8b1b601ff904afd2627 Mon Sep 17 00:00:00 2001 From: taitus Date: Tue, 24 Sep 2019 18:16:39 +0200 Subject: [PATCH 04/48] Add new layout for wizards --- .../admin/wizards/installer_controller.rb | 1 + app/views/layouts/wizard.html.erb | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 app/views/layouts/wizard.html.erb diff --git a/app/controllers/admin/wizards/installer_controller.rb b/app/controllers/admin/wizards/installer_controller.rb index ccc47a2fdab..e74ca6e996c 100644 --- a/app/controllers/admin/wizards/installer_controller.rb +++ b/app/controllers/admin/wizards/installer_controller.rb @@ -1,2 +1,3 @@ class Admin::Wizards::InstallerController < Admin::BaseController + layout "wizard" end diff --git a/app/views/layouts/wizard.html.erb b/app/views/layouts/wizard.html.erb new file mode 100644 index 00000000000..3062200b33b --- /dev/null +++ b/app/views/layouts/wizard.html.erb @@ -0,0 +1,25 @@ + + + + + <%= render "layouts/common_head", default_title: "Admin" %> + <%= content_for :head %> + + + "> +
    +
    +
    + <%= render "layouts/admin_header" %> + +
    +
    + <%= render "layouts/flash" %> + <%= yield %> +
    +
    +
    +
    +
    + + From 595ad7b5e962f56a5f9b6dd6d889872871d899ee Mon Sep 17 00:00:00 2001 From: taitus Date: Tue, 24 Sep 2019 18:20:23 +0200 Subject: [PATCH 05/48] Add initial step as action new from installation wizard --- .../admin/wizards/installer_controller.rb | 12 ++++++++++++ app/views/admin/wizards/_header_steps.html.erb | 9 +++++++++ app/views/admin/wizards/installer/new.html.erb | 9 +++++++++ 3 files changed, 30 insertions(+) create mode 100644 app/views/admin/wizards/_header_steps.html.erb create mode 100644 app/views/admin/wizards/installer/new.html.erb diff --git a/app/controllers/admin/wizards/installer_controller.rb b/app/controllers/admin/wizards/installer_controller.rb index e74ca6e996c..0dcbc91c591 100644 --- a/app/controllers/admin/wizards/installer_controller.rb +++ b/app/controllers/admin/wizards/installer_controller.rb @@ -1,3 +1,15 @@ class Admin::Wizards::InstallerController < Admin::BaseController layout "wizard" + + before_action :set_total_steps + + def new + end + + private + + def set_total_steps + @total_steps = 7 + end + end diff --git a/app/views/admin/wizards/_header_steps.html.erb b/app/views/admin/wizards/_header_steps.html.erb new file mode 100644 index 00000000000..e1df757feb7 --- /dev/null +++ b/app/views/admin/wizards/_header_steps.html.erb @@ -0,0 +1,9 @@ +

    Asistente de instalación

    +Paso <%= current_step %> de <%= total_steps %> + +<% if defined?(back_step) %> + <%= link_to "Atrás", back_step %> +<% end %> +<% if defined?(next_step) %> + <%= link_to "Siguiente", next_step, class: "button" %> +<% end %> diff --git a/app/views/admin/wizards/installer/new.html.erb b/app/views/admin/wizards/installer/new.html.erb new file mode 100644 index 00000000000..ab5e69f6198 --- /dev/null +++ b/app/views/admin/wizards/installer/new.html.erb @@ -0,0 +1,9 @@ +<%= render "admin/wizards/header_steps", current_step: 1, + total_steps: @total_steps %> + +
    + +

    Bienvenido al asistente de instalación de Consul

    +

    En este asistente realizaremos paso a paso toda la configuración necesaria para poder personalizar la aplicación a las necesidades de su Institución. Si no dispone de alguna información solicitada en el asistente podrá obviarlos y modificarlo en un futuro en la Sección de Settings relacionada o desde este mismo Asistente.

    + +<%= link_to "Empezar", admin_wizards_installer_path(:general_settings), class: "button" %> From f3444561bb48bae3111e768805729978c4a59688 Mon Sep 17 00:00:00 2001 From: taitus Date: Tue, 24 Sep 2019 18:23:28 +0200 Subject: [PATCH 06/48] Add general settings step --- .../admin/wizards/installer_controller.rb | 12 ++++++++++++ .../wizards/installer/general_settings.html.erb | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 app/views/admin/wizards/installer/general_settings.html.erb diff --git a/app/controllers/admin/wizards/installer_controller.rb b/app/controllers/admin/wizards/installer_controller.rb index 0dcbc91c591..630a700f4bc 100644 --- a/app/controllers/admin/wizards/installer_controller.rb +++ b/app/controllers/admin/wizards/installer_controller.rb @@ -2,14 +2,26 @@ class Admin::Wizards::InstallerController < Admin::BaseController layout "wizard" before_action :set_total_steps + before_action :set_settings, only: :show def new end + def show + render params[:id] + end + private def set_total_steps @total_steps = 7 end + def set_settings + case params[:id] + when "general_settings" + @settings = [Setting.find_by(key: "org_name"), Setting.find_by(key: "min_age_to_participate")] + end + end + end diff --git a/app/views/admin/wizards/installer/general_settings.html.erb b/app/views/admin/wizards/installer/general_settings.html.erb new file mode 100644 index 00000000000..7f524142e7c --- /dev/null +++ b/app/views/admin/wizards/installer/general_settings.html.erb @@ -0,0 +1,12 @@ +<%= render "admin/wizards/header_steps", current_step: 2, + total_steps: @total_steps, + back_step: new_admin_wizards_installer_path, + next_step: admin_wizards_installer_path(:participation_process) %> + +
    + +

    Configuración Global

    +

    En este paso podrá actualizar algunas de las Configuraciones Globales de la aplicación más importantes. +En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Configuración Global" o volviendo a ejecutar el Asistente de Instalación

    + +<%= render "admin/settings/settings_table", settings: @settings %> From fb285969c97adc8254596f0e6dcf7663423ca763 Mon Sep 17 00:00:00 2001 From: taitus Date: Tue, 24 Sep 2019 18:25:15 +0200 Subject: [PATCH 07/48] Add participation process step --- .../admin/wizards/installer_controller.rb | 2 ++ app/helpers/settings_helper.rb | 2 +- .../installer/participation_process.html.erb | 13 +++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 app/views/admin/wizards/installer/participation_process.html.erb diff --git a/app/controllers/admin/wizards/installer_controller.rb b/app/controllers/admin/wizards/installer_controller.rb index 630a700f4bc..13a58b52ada 100644 --- a/app/controllers/admin/wizards/installer_controller.rb +++ b/app/controllers/admin/wizards/installer_controller.rb @@ -21,6 +21,8 @@ def set_settings case params[:id] when "general_settings" @settings = [Setting.find_by(key: "org_name"), Setting.find_by(key: "min_age_to_participate")] + when "participation_process" + @settings = [[Setting.find_by(key: "process.debates"), Setting.find_by(key: "process.proposals"), Setting.find_by(key: "votes_for_proposal_success"), Setting.find_by(key: "process.polls"), Setting.find_by(key: "process.budgets")]] end end diff --git a/app/helpers/settings_helper.rb b/app/helpers/settings_helper.rb index 8ae88e89dc1..f1c581f74a2 100644 --- a/app/helpers/settings_helper.rb +++ b/app/helpers/settings_helper.rb @@ -24,7 +24,7 @@ def smtp_feature?(setting) end def is_feature?(setting) - social_feature?(setting) || advanced_feature?(setting) || smtp_feature?(setting) || regional_feature?(setting) + social_feature?(setting) || advanced_feature?(setting) || smtp_feature?(setting) || regional_feature?(setting) || feature?(setting.key.rpartition(".").last) end def regional_feature?(setting) diff --git a/app/views/admin/wizards/installer/participation_process.html.erb b/app/views/admin/wizards/installer/participation_process.html.erb new file mode 100644 index 00000000000..31b2de28445 --- /dev/null +++ b/app/views/admin/wizards/installer/participation_process.html.erb @@ -0,0 +1,13 @@ +<%= render "admin/wizards/header_steps", current_step: 3, + total_steps: @total_steps, + back_step: admin_wizards_installer_path(:general_settings), + next_step: admin_wizards_installer_path(:map) %> + +
    + +

    Procesos de Participación

    +

    En este paso podrán activar/desactivar los procesos de participación que decida utilizar cada Institución. +En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Procesos de Participación" o volviendo a ejecutar el Asistente de Instalación

    +<% @settings.each do |setting_group| %> + <%= render "admin/settings/mixed_settings_table", settings: setting_group %> +<% end %> From 6def14b510d6e3f765c297a729b636c97fa819a5 Mon Sep 17 00:00:00 2001 From: taitus Date: Tue, 24 Sep 2019 18:26:46 +0200 Subject: [PATCH 08/48] Add map configuration step --- .../admin/wizards/installer_controller.rb | 2 ++ app/helpers/settings_helper.rb | 2 +- .../admin/wizards/installer/map.html.erb | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 app/views/admin/wizards/installer/map.html.erb diff --git a/app/controllers/admin/wizards/installer_controller.rb b/app/controllers/admin/wizards/installer_controller.rb index 13a58b52ada..98d917e4ff0 100644 --- a/app/controllers/admin/wizards/installer_controller.rb +++ b/app/controllers/admin/wizards/installer_controller.rb @@ -23,6 +23,8 @@ def set_settings @settings = [Setting.find_by(key: "org_name"), Setting.find_by(key: "min_age_to_participate")] when "participation_process" @settings = [[Setting.find_by(key: "process.debates"), Setting.find_by(key: "process.proposals"), Setting.find_by(key: "votes_for_proposal_success"), Setting.find_by(key: "process.polls"), Setting.find_by(key: "process.budgets")]] + when "map" + @settings = [[Setting.find_by(key: "feature.map"), Setting.find_by(key: "map.latitude"), Setting.find_by(key: "map.longitude"), Setting.find_by(key: "map.zoom")]] end end diff --git a/app/helpers/settings_helper.rb b/app/helpers/settings_helper.rb index f1c581f74a2..2016eb0d981 100644 --- a/app/helpers/settings_helper.rb +++ b/app/helpers/settings_helper.rb @@ -24,7 +24,7 @@ def smtp_feature?(setting) end def is_feature?(setting) - social_feature?(setting) || advanced_feature?(setting) || smtp_feature?(setting) || regional_feature?(setting) || feature?(setting.key.rpartition(".").last) + social_feature?(setting) || advanced_feature?(setting) || smtp_feature?(setting) || regional_feature?(setting) || feature?(setting.key.rpartition(".").last) || setting.key == "feature.map" end def regional_feature?(setting) diff --git a/app/views/admin/wizards/installer/map.html.erb b/app/views/admin/wizards/installer/map.html.erb new file mode 100644 index 00000000000..7382710996f --- /dev/null +++ b/app/views/admin/wizards/installer/map.html.erb @@ -0,0 +1,19 @@ +<%= render "admin/wizards/header_steps", current_step: 4, + total_steps: @total_steps, + back_step: admin_wizards_installer_path(:participation_process), + next_step: admin_wizards_installer_path(:smtp) %> + +
    + +

    Configuración del Mapa

    +

    En este paso podrán activar/desactivar la geolocalización de las propuestas y proyectos de gasto, y personalizar la manera en que se muestra el mapa a los usuarios. +En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Configuración del mapa" o volviendo a ejecutar el Asistente de Instalación

    + +<%#= render "admin/settings/settings_table", settings: @settings %> +<% @settings.each do |setting_group| %> + <%= render "admin/settings/mixed_settings_table", settings: setting_group %> +<% end %> + +

    <%= t("admin.settings.index.map.help") %>

    + +<%= render "admin/settings/map_form" %> From 8796bc056298a08a31af870957b45eea7f0c9d9d Mon Sep 17 00:00:00 2001 From: taitus Date: Tue, 24 Sep 2019 18:27:26 +0200 Subject: [PATCH 09/48] Add smtp configuration step --- app/controllers/admin/wizards/installer_controller.rb | 2 ++ app/helpers/settings_helper.rb | 2 +- app/views/admin/wizards/installer/smtp.html.erb | 11 +++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 app/views/admin/wizards/installer/smtp.html.erb diff --git a/app/controllers/admin/wizards/installer_controller.rb b/app/controllers/admin/wizards/installer_controller.rb index 98d917e4ff0..734ed9bf7af 100644 --- a/app/controllers/admin/wizards/installer_controller.rb +++ b/app/controllers/admin/wizards/installer_controller.rb @@ -25,6 +25,8 @@ def set_settings @settings = [[Setting.find_by(key: "process.debates"), Setting.find_by(key: "process.proposals"), Setting.find_by(key: "votes_for_proposal_success"), Setting.find_by(key: "process.polls"), Setting.find_by(key: "process.budgets")]] when "map" @settings = [[Setting.find_by(key: "feature.map"), Setting.find_by(key: "map.latitude"), Setting.find_by(key: "map.longitude"), Setting.find_by(key: "map.zoom")]] + when "smtp" + @settings = [Setting.find_by(key: "feature.smtp_configuration"), Setting.find_by(key: "smtp.address"), Setting.find_by(key: "smtp.port"), Setting.find_by(key: "smtp.domain"), Setting.find_by(key: "smtp.username"), Setting.find_by(key: "smtp.password"), Setting.find_by(key: "smtp.authentication"), Setting.find_by(key: "smtp.enable_starttls_auto")] end end diff --git a/app/helpers/settings_helper.rb b/app/helpers/settings_helper.rb index 2016eb0d981..cb2fc1ecdbe 100644 --- a/app/helpers/settings_helper.rb +++ b/app/helpers/settings_helper.rb @@ -24,7 +24,7 @@ def smtp_feature?(setting) end def is_feature?(setting) - social_feature?(setting) || advanced_feature?(setting) || smtp_feature?(setting) || regional_feature?(setting) || feature?(setting.key.rpartition(".").last) || setting.key == "feature.map" + social_feature?(setting) || advanced_feature?(setting) || smtp_feature?(setting) || regional_feature?(setting) || feature?(setting.key.rpartition(".").last) || setting.key == "feature.map" || setting.key == "feature.smtp_configuration" end def regional_feature?(setting) diff --git a/app/views/admin/wizards/installer/smtp.html.erb b/app/views/admin/wizards/installer/smtp.html.erb new file mode 100644 index 00000000000..07e909ffbfe --- /dev/null +++ b/app/views/admin/wizards/installer/smtp.html.erb @@ -0,0 +1,11 @@ +<%= render "admin/wizards/header_steps", current_step: 5, + total_steps: @total_steps, + back_step: admin_wizards_installer_path(:map), + next_step: admin_wizards_installer_path(:regional) %> + +
    + +

    Conexión SMTP

    +

    En este paso podrán configurar la conexión SMTP para poder enviar correos desde la aplicación +En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Conexión SMTP" o volviendo a ejecutar el Asistente de Instalación

    +<%= render "admin/settings/mixed_settings_table", settings: @settings %> From d922f46509232a2252bca10a13bc15b84b12ec23 Mon Sep 17 00:00:00 2001 From: taitus Date: Tue, 24 Sep 2019 18:32:40 +0200 Subject: [PATCH 10/48] Add regional configuration step In available locales section we allow you to disable all languages except the application default locale --- .../admin/wizards/installer_controller.rb | 7 +++++++ .../admin/wizards/installer/regional.html.erb | 14 ++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 app/views/admin/wizards/installer/regional.html.erb diff --git a/app/controllers/admin/wizards/installer_controller.rb b/app/controllers/admin/wizards/installer_controller.rb index 734ed9bf7af..860a2b3073a 100644 --- a/app/controllers/admin/wizards/installer_controller.rb +++ b/app/controllers/admin/wizards/installer_controller.rb @@ -27,7 +27,14 @@ def set_settings @settings = [[Setting.find_by(key: "feature.map"), Setting.find_by(key: "map.latitude"), Setting.find_by(key: "map.longitude"), Setting.find_by(key: "map.zoom")]] when "smtp" @settings = [Setting.find_by(key: "feature.smtp_configuration"), Setting.find_by(key: "smtp.address"), Setting.find_by(key: "smtp.port"), Setting.find_by(key: "smtp.domain"), Setting.find_by(key: "smtp.username"), Setting.find_by(key: "smtp.password"), Setting.find_by(key: "smtp.authentication"), Setting.find_by(key: "smtp.enable_starttls_auto")] + when "regional" + all_settings = Setting.all.group_by { |setting| setting.type } + @settings = [all_settings["regional.default_locale"]] + [valid_regional_available_locales(all_settings)] + [all_settings["regional.time_zone"]] end end + def valid_regional_available_locales(all_settings) + all_settings["regional.available_locale"].select { |s| s.key.rpartition(".").last.to_sym != I18n.default_locale } + end + end diff --git a/app/views/admin/wizards/installer/regional.html.erb b/app/views/admin/wizards/installer/regional.html.erb new file mode 100644 index 00000000000..bb0f504ff5e --- /dev/null +++ b/app/views/admin/wizards/installer/regional.html.erb @@ -0,0 +1,14 @@ +<%= render "admin/wizards/header_steps", current_step: 6, + total_steps: @total_steps, + back_step: admin_wizards_installer_path(:smtp), + next_step: admin_wizards_installer_path(:finish) %> + +
    + +

    Idiomas y Zona horaria

    +

    En este paso podrán configurar el idioma por defecto de la aplicación, los idiomas disponibles y la zona horaria en la que se encuentra. +En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Regional Settings" o volviendo a ejecutar el Asistente de Instalación

    +<% @settings.each do |setting_group| %> +

    <%= t("admin.settings.index.regional.#{setting_group.first.key.split(".").second}") %>

    + <%= render "admin/settings/mixed_settings_table", settings: setting_group %> +<% end %> From 5d74cb20bc0f9aeef87d0645ad6537b79fe4045b Mon Sep 17 00:00:00 2001 From: taitus Date: Tue, 24 Sep 2019 18:33:00 +0200 Subject: [PATCH 11/48] Add finish step --- app/views/admin/wizards/installer/finish.html.erb | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 app/views/admin/wizards/installer/finish.html.erb diff --git a/app/views/admin/wizards/installer/finish.html.erb b/app/views/admin/wizards/installer/finish.html.erb new file mode 100644 index 00000000000..ae9cc60b15f --- /dev/null +++ b/app/views/admin/wizards/installer/finish.html.erb @@ -0,0 +1,10 @@ +<%= render "admin/wizards/header_steps", current_step: 7, + total_steps: @total_steps, + back_step: admin_wizards_installer_path(:regional) %> + +
    + +

    Asistente finalizado con éxito

    +

    En caso de querer modificar cualquier dato una vez realizado el Asistente podrá modificarlo en la sección "Configuración" o volviendo a ejecutar el Asistente de Instalación

    + +<%= link_to "Finalizar Asistente", admin_root_path, class: "button" %> From b3bf3371d98fe0259aa8ecab76037744f588a2a7 Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Thu, 12 Sep 2019 14:57:23 +0200 Subject: [PATCH 12/48] Add new scss wizard style file * Add wizard class to div wrapper. --- app/assets/stylesheets/application.scss | 1 + app/assets/stylesheets/wizard.scss | 2 ++ app/views/layouts/wizard.html.erb | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 app/assets/stylesheets/wizard.scss diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index ad1a0dd0ba6..b7ede32fe30 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -23,3 +23,4 @@ @import "autocomplete_overrides"; @import "jquery-ui/sortable"; @import "leaflet"; +@import "wizard"; diff --git a/app/assets/stylesheets/wizard.scss b/app/assets/stylesheets/wizard.scss new file mode 100644 index 00000000000..1053a2321ef --- /dev/null +++ b/app/assets/stylesheets/wizard.scss @@ -0,0 +1,2 @@ +.wizard { +} diff --git a/app/views/layouts/wizard.html.erb b/app/views/layouts/wizard.html.erb index 3062200b33b..e18fd4277ad 100644 --- a/app/views/layouts/wizard.html.erb +++ b/app/views/layouts/wizard.html.erb @@ -13,7 +13,7 @@ <%= render "layouts/admin_header" %>
    -
    +
    <%= render "layouts/flash" %> <%= yield %>
    From 3f95a33dd439b73d0e75ebb6242d31eee2495f22 Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Thu, 12 Sep 2019 15:06:09 +0200 Subject: [PATCH 13/48] New: Add padding to structure --- app/views/admin/wizards/installer/new.html.erb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/views/admin/wizards/installer/new.html.erb b/app/views/admin/wizards/installer/new.html.erb index ab5e69f6198..9458a6c3adf 100644 --- a/app/views/admin/wizards/installer/new.html.erb +++ b/app/views/admin/wizards/installer/new.html.erb @@ -1,9 +1,10 @@ <%= render "admin/wizards/header_steps", current_step: 1, total_steps: @total_steps %> - -
    - -

    Bienvenido al asistente de instalación de Consul

    -

    En este asistente realizaremos paso a paso toda la configuración necesaria para poder personalizar la aplicación a las necesidades de su Institución. Si no dispone de alguna información solicitada en el asistente podrá obviarlos y modificarlo en un futuro en la Sección de Settings relacionada o desde este mismo Asistente.

    - -<%= link_to "Empezar", admin_wizards_installer_path(:general_settings), class: "button" %> + +
    +
    +

    Bienvenido al asistente de instalación de Consul

    +

    En este asistente realizaremos paso a paso toda la configuración necesaria para poder personalizar la aplicación a las necesidades de su Institución. Si no dispone de alguna información solicitada en el asistente podrá obviarlos y modificarlo en un futuro en la Sección de Settings relacionada o desde este mismo Asistente.

    + <%= link_to "Empezar", admin_wizards_installer_path(:general_settings), class: "button" %> +
    +
    From ae69fbebd9b42564f05cb6d997de4c3ce62f16eb Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Thu, 12 Sep 2019 15:06:26 +0200 Subject: [PATCH 14/48] General Settings: Add padding to structure --- .../wizards/installer/general_settings.html.erb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/views/admin/wizards/installer/general_settings.html.erb b/app/views/admin/wizards/installer/general_settings.html.erb index 7f524142e7c..3422c8804b9 100644 --- a/app/views/admin/wizards/installer/general_settings.html.erb +++ b/app/views/admin/wizards/installer/general_settings.html.erb @@ -3,10 +3,11 @@ back_step: new_admin_wizards_installer_path, next_step: admin_wizards_installer_path(:participation_process) %> -
    - -

    Configuración Global

    -

    En este paso podrá actualizar algunas de las Configuraciones Globales de la aplicación más importantes. -En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Configuración Global" o volviendo a ejecutar el Asistente de Instalación

    - -<%= render "admin/settings/settings_table", settings: @settings %> +
    +
    +

    Configuración Global

    +

    En este paso podrá actualizar algunas de las Configuraciones Globales de la aplicación más importantes. + En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Configuración Global" o volviendo a ejecutar el Asistente de Instalación

    + <%= render "admin/settings/settings_table", settings: @settings %> +
    +
    From 54468e933ae54ec897ef135946fdc75526dde70f Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Thu, 12 Sep 2019 15:07:32 +0200 Subject: [PATCH 15/48] Partecipation process: Add padding to structure --- .../installer/participation_process.html.erb | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/views/admin/wizards/installer/participation_process.html.erb b/app/views/admin/wizards/installer/participation_process.html.erb index 31b2de28445..02543c787da 100644 --- a/app/views/admin/wizards/installer/participation_process.html.erb +++ b/app/views/admin/wizards/installer/participation_process.html.erb @@ -3,11 +3,13 @@ back_step: admin_wizards_installer_path(:general_settings), next_step: admin_wizards_installer_path(:map) %> -
    - -

    Procesos de Participación

    -

    En este paso podrán activar/desactivar los procesos de participación que decida utilizar cada Institución. -En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Procesos de Participación" o volviendo a ejecutar el Asistente de Instalación

    -<% @settings.each do |setting_group| %> - <%= render "admin/settings/mixed_settings_table", settings: setting_group %> -<% end %> +
    +
    +

    Procesos de Participación

    +

    En este paso podrán activar/desactivar los procesos de participación que decida utilizar cada Institución. + En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Procesos de Participación" o volviendo a ejecutar el Asistente de Instalación

    + <% @settings.each do |setting_group| %> + <%= render "admin/settings/mixed_settings_table", settings: setting_group %> + <% end %> +
    +
    From d420cbc56a6f8bcc98fdcb6efb4da9e383d6b763 Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Thu, 12 Sep 2019 15:10:03 +0200 Subject: [PATCH 16/48] Map: Add padding to structure --- .../admin/wizards/installer/map.html.erb | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/app/views/admin/wizards/installer/map.html.erb b/app/views/admin/wizards/installer/map.html.erb index 7382710996f..d2e2da554b7 100644 --- a/app/views/admin/wizards/installer/map.html.erb +++ b/app/views/admin/wizards/installer/map.html.erb @@ -3,17 +3,16 @@ back_step: admin_wizards_installer_path(:participation_process), next_step: admin_wizards_installer_path(:smtp) %> -
    - -

    Configuración del Mapa

    -

    En este paso podrán activar/desactivar la geolocalización de las propuestas y proyectos de gasto, y personalizar la manera en que se muestra el mapa a los usuarios. -En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Configuración del mapa" o volviendo a ejecutar el Asistente de Instalación

    - -<%#= render "admin/settings/settings_table", settings: @settings %> -<% @settings.each do |setting_group| %> - <%= render "admin/settings/mixed_settings_table", settings: setting_group %> -<% end %> - -

    <%= t("admin.settings.index.map.help") %>

    - -<%= render "admin/settings/map_form" %> +
    +
    +

    Configuración del Mapa

    +

    En este paso podrán activar/desactivar la geolocalización de las propuestas y proyectos de gasto, y personalizar la manera en que se muestra el mapa a los usuarios. + En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Configuración del mapa" o volviendo a ejecutar el Asistente de Instalación

    + <%#= render "admin/settings/settings_table", settings: @settings %> + <% @settings.each do |setting_group| %> + <%= render "admin/settings/mixed_settings_table", settings: setting_group %> + <% end %> +

    <%= t("admin.settings.index.map.help") %>

    + <%= render "admin/settings/map_form" %> +
    +
    From 370c83fb47954347196c3d841a337671c18e049c Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Thu, 12 Sep 2019 15:10:12 +0200 Subject: [PATCH 17/48] Smtp: Add padding to structure --- app/views/admin/wizards/installer/smtp.html.erb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/views/admin/wizards/installer/smtp.html.erb b/app/views/admin/wizards/installer/smtp.html.erb index 07e909ffbfe..63973eb09ef 100644 --- a/app/views/admin/wizards/installer/smtp.html.erb +++ b/app/views/admin/wizards/installer/smtp.html.erb @@ -3,9 +3,11 @@ back_step: admin_wizards_installer_path(:map), next_step: admin_wizards_installer_path(:regional) %> -
    - -

    Conexión SMTP

    -

    En este paso podrán configurar la conexión SMTP para poder enviar correos desde la aplicación -En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Conexión SMTP" o volviendo a ejecutar el Asistente de Instalación

    -<%= render "admin/settings/mixed_settings_table", settings: @settings %> +
    +
    +

    Conexión SMTP

    +

    En este paso podrán configurar la conexión SMTP para poder enviar correos desde la aplicación + En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Conexión SMTP" o volviendo a ejecutar el Asistente de Instalación

    + <%= render "admin/settings/mixed_settings_table", settings: @settings %> +
    +
    From c8ca953de768e393dc0d48c7f7448c0d650692b1 Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Thu, 12 Sep 2019 15:11:16 +0200 Subject: [PATCH 18/48] Regional: Add padding to structure --- .../admin/wizards/installer/regional.html.erb | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/app/views/admin/wizards/installer/regional.html.erb b/app/views/admin/wizards/installer/regional.html.erb index bb0f504ff5e..51b0b1db567 100644 --- a/app/views/admin/wizards/installer/regional.html.erb +++ b/app/views/admin/wizards/installer/regional.html.erb @@ -3,12 +3,14 @@ back_step: admin_wizards_installer_path(:smtp), next_step: admin_wizards_installer_path(:finish) %> -
    - -

    Idiomas y Zona horaria

    -

    En este paso podrán configurar el idioma por defecto de la aplicación, los idiomas disponibles y la zona horaria en la que se encuentra. -En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Regional Settings" o volviendo a ejecutar el Asistente de Instalación

    -<% @settings.each do |setting_group| %> -

    <%= t("admin.settings.index.regional.#{setting_group.first.key.split(".").second}") %>

    - <%= render "admin/settings/mixed_settings_table", settings: setting_group %> -<% end %> +
    +
    +

    Idiomas y Zona horaria

    +

    En este paso podrán configurar el idioma por defecto de la aplicación, los idiomas disponibles y la zona horaria en la que se encuentra. + En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Regional Settings" o volviendo a ejecutar el Asistente de Instalación

    + <% @settings.each do |setting_group| %> +

    <%= t("admin.settings.index.regional.#{setting_group.first.key.split(".").second}") %>

    + <%= render "admin/settings/mixed_settings_table", settings: setting_group %> + <% end %> +
    +
    From e74098c6b2afce9ddaea2d15f7619931709ac9c6 Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Thu, 12 Sep 2019 15:12:02 +0200 Subject: [PATCH 19/48] Finish: Add padding to structure --- app/views/admin/wizards/installer/finish.html.erb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/views/admin/wizards/installer/finish.html.erb b/app/views/admin/wizards/installer/finish.html.erb index ae9cc60b15f..ddfe0a3331b 100644 --- a/app/views/admin/wizards/installer/finish.html.erb +++ b/app/views/admin/wizards/installer/finish.html.erb @@ -2,9 +2,10 @@ total_steps: @total_steps, back_step: admin_wizards_installer_path(:regional) %> -
    - -

    Asistente finalizado con éxito

    -

    En caso de querer modificar cualquier dato una vez realizado el Asistente podrá modificarlo en la sección "Configuración" o volviendo a ejecutar el Asistente de Instalación

    - -<%= link_to "Finalizar Asistente", admin_root_path, class: "button" %> +
    +
    +

    Asistente finalizado con éxito

    +

    En caso de querer modificar cualquier dato una vez realizado el Asistente podrá modificarlo en la sección "Configuración" o volviendo a ejecutar el Asistente de Instalación

    + <%= link_to "Finalizar Asistente", admin_root_path, class: "button" %> +
    +
    From 704b26ebd5997596d26c4a54225a8a81676a3db2 Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Thu, 12 Sep 2019 15:27:34 +0200 Subject: [PATCH 20/48] Header: Fix style --- app/assets/stylesheets/wizard.scss | 38 +++++++++++++++++++ .../admin/wizards/_header_steps.html.erb | 26 +++++++++---- 2 files changed, 56 insertions(+), 8 deletions(-) diff --git a/app/assets/stylesheets/wizard.scss b/app/assets/stylesheets/wizard.scss index 1053a2321ef..6703e285a14 100644 --- a/app/assets/stylesheets/wizard.scss +++ b/app/assets/stylesheets/wizard.scss @@ -1,2 +1,40 @@ .wizard { + h3 { + margin-bottom: 0; + } + + h3, + .current-step { + display: inline-block; + } + + .current-step { + @include breakpoint(medium) { + margin-left: $line-height; + } + } + + .btn-back-step { + margin-right: $line-height; + } + + .btn-back-step i { + position: relative; + &:before { + position: absolute; + top: 2px; + left: -20px; + } + } + + .v-aligner { + display: flex; + align-items: center; + justify-content: center; + } + + .button { + margin-bottom: 0; + } + } diff --git a/app/views/admin/wizards/_header_steps.html.erb b/app/views/admin/wizards/_header_steps.html.erb index e1df757feb7..e0be01837cb 100644 --- a/app/views/admin/wizards/_header_steps.html.erb +++ b/app/views/admin/wizards/_header_steps.html.erb @@ -1,9 +1,19 @@ -

    Asistente de instalación

    -Paso <%= current_step %> de <%= total_steps %> +
    +
    +

    Asistente de instalación

    + Paso <%= current_step %> de <%= total_steps %> +
    -<% if defined?(back_step) %> - <%= link_to "Atrás", back_step %> -<% end %> -<% if defined?(next_step) %> - <%= link_to "Siguiente", next_step, class: "button" %> -<% end %> +
    + <% if defined?(back_step) %> + <%= link_to back_step, class: "btn-back-step" do %> + + <%= t("wizard.header.back_step") %> + <% end %> + <% end %> + <% if defined?(next_step) %> + <%= link_to "Siguiente", next_step, class: "button" %> + <% end %> +
    +
    +
    From c488cfece1712eec73261e6555eb79f8725cf0cc Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Thu, 12 Sep 2019 16:46:19 +0200 Subject: [PATCH 21/48] Add new Wizard yml --- config/locales/es/wizard.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 config/locales/es/wizard.yml diff --git a/config/locales/es/wizard.yml b/config/locales/es/wizard.yml new file mode 100644 index 00000000000..4e6d74e558c --- /dev/null +++ b/config/locales/es/wizard.yml @@ -0,0 +1,2 @@ +es: + wizard: From 33c96e8950646490f061eecf2b5e45aa57708c8c Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Thu, 12 Sep 2019 16:47:20 +0200 Subject: [PATCH 22/48] Header: Add translations --- app/views/admin/wizards/_header_steps.html.erb | 6 +++--- config/locales/es/wizard.yml | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/views/admin/wizards/_header_steps.html.erb b/app/views/admin/wizards/_header_steps.html.erb index e0be01837cb..d36b3a2035a 100644 --- a/app/views/admin/wizards/_header_steps.html.erb +++ b/app/views/admin/wizards/_header_steps.html.erb @@ -1,7 +1,7 @@
    -

    Asistente de instalación

    - Paso <%= current_step %> de <%= total_steps %> +

    <%= t("wizard.header.title") %>

    + <%= t("wizard.header.step") %> <%= current_step %> <%= t("wizard.header.step_of") %> <%= total_steps %>
    @@ -12,7 +12,7 @@ <% end %> <% end %> <% if defined?(next_step) %> - <%= link_to "Siguiente", next_step, class: "button" %> + <%= link_to t("wizard.header.next_step"), next_step, class: "button" %> <% end %>
    diff --git a/config/locales/es/wizard.yml b/config/locales/es/wizard.yml index 4e6d74e558c..6d5880517a9 100644 --- a/config/locales/es/wizard.yml +++ b/config/locales/es/wizard.yml @@ -1,2 +1,8 @@ es: wizard: + header: + title: Asistente de instalación + step: Paso + step_of: de + back_step: Atrás + next_step: Siguiente From 02d8099f0560606e662a4e37f14b6d1cfced36d0 Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Thu, 12 Sep 2019 16:47:52 +0200 Subject: [PATCH 23/48] New: Add translations --- app/views/admin/wizards/installer/new.html.erb | 8 ++++---- config/locales/es/wizard.yml | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/views/admin/wizards/installer/new.html.erb b/app/views/admin/wizards/installer/new.html.erb index 9458a6c3adf..7ad66858ab5 100644 --- a/app/views/admin/wizards/installer/new.html.erb +++ b/app/views/admin/wizards/installer/new.html.erb @@ -1,10 +1,10 @@ <%= render "admin/wizards/header_steps", current_step: 1, total_steps: @total_steps %> - +
    -

    Bienvenido al asistente de instalación de Consul

    -

    En este asistente realizaremos paso a paso toda la configuración necesaria para poder personalizar la aplicación a las necesidades de su Institución. Si no dispone de alguna información solicitada en el asistente podrá obviarlos y modificarlo en un futuro en la Sección de Settings relacionada o desde este mismo Asistente.

    - <%= link_to "Empezar", admin_wizards_installer_path(:general_settings), class: "button" %> +

    <%= t("wizard.new.title") %>

    +

    <%= t("wizard.new.description") %>

    + <%= link_to t("wizard.new.btn_start"), admin_wizards_installer_path(:general_settings), class: "button" %>
    diff --git a/config/locales/es/wizard.yml b/config/locales/es/wizard.yml index 6d5880517a9..a1bb0bb421d 100644 --- a/config/locales/es/wizard.yml +++ b/config/locales/es/wizard.yml @@ -6,3 +6,7 @@ es: step_of: de back_step: Atrás next_step: Siguiente + new: + title: Bienvenido al asistente de instalación de Consul + description: En este asistente realizaremos paso a paso toda la configuración necesaria para poder personalizar la aplicación a las necesidades de su Institución. Si no dispone de alguna información solicitada en el asistente podrá obviarlos y modificarlo en un futuro en la Sección de Settings relacionada o desde este mismo Asistente. + btn_start: Empezar From 2965a946612d206a89194c3ec8463dc383b38d4d Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Thu, 12 Sep 2019 16:48:17 +0200 Subject: [PATCH 24/48] General Settings: Add translations --- app/views/admin/wizards/installer/general_settings.html.erb | 5 ++--- config/locales/es/wizard.yml | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/admin/wizards/installer/general_settings.html.erb b/app/views/admin/wizards/installer/general_settings.html.erb index 3422c8804b9..c3669649de5 100644 --- a/app/views/admin/wizards/installer/general_settings.html.erb +++ b/app/views/admin/wizards/installer/general_settings.html.erb @@ -5,9 +5,8 @@
    -

    Configuración Global

    -

    En este paso podrá actualizar algunas de las Configuraciones Globales de la aplicación más importantes. - En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Configuración Global" o volviendo a ejecutar el Asistente de Instalación

    +

    <%= t("admin.settings.index.title") %>

    +

    <%= t("wizard.partecipation_process.description") %>

    <%= render "admin/settings/settings_table", settings: @settings %>
    diff --git a/config/locales/es/wizard.yml b/config/locales/es/wizard.yml index a1bb0bb421d..aca3fadb71b 100644 --- a/config/locales/es/wizard.yml +++ b/config/locales/es/wizard.yml @@ -10,3 +10,5 @@ es: title: Bienvenido al asistente de instalación de Consul description: En este asistente realizaremos paso a paso toda la configuración necesaria para poder personalizar la aplicación a las necesidades de su Institución. Si no dispone de alguna información solicitada en el asistente podrá obviarlos y modificarlo en un futuro en la Sección de Settings relacionada o desde este mismo Asistente. btn_start: Empezar + general_settings: + description: En este paso podrá actualizar algunas de las Configuraciones Globales de la aplicación más importantes. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Configuración Global" o volviendo a ejecutar el Asistente de Instalación From 38aa844c88564fe6ba3673a3219b580955d7e183 Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Thu, 12 Sep 2019 16:50:27 +0200 Subject: [PATCH 25/48] Partecipation process: Add translations --- .../admin/wizards/installer/participation_process.html.erb | 5 ++--- config/locales/es/wizard.yml | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/admin/wizards/installer/participation_process.html.erb b/app/views/admin/wizards/installer/participation_process.html.erb index 02543c787da..b8bb298ccf9 100644 --- a/app/views/admin/wizards/installer/participation_process.html.erb +++ b/app/views/admin/wizards/installer/participation_process.html.erb @@ -5,9 +5,8 @@
    -

    Procesos de Participación

    -

    En este paso podrán activar/desactivar los procesos de participación que decida utilizar cada Institución. - En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Procesos de Participación" o volviendo a ejecutar el Asistente de Instalación

    +

    <%= t("admin.settings.index.process.title") %>

    +

    <%= t("wizard.general_settings.description") %>

    <% @settings.each do |setting_group| %> <%= render "admin/settings/mixed_settings_table", settings: setting_group %> <% end %> diff --git a/config/locales/es/wizard.yml b/config/locales/es/wizard.yml index aca3fadb71b..f212f8b146e 100644 --- a/config/locales/es/wizard.yml +++ b/config/locales/es/wizard.yml @@ -12,3 +12,5 @@ es: btn_start: Empezar general_settings: description: En este paso podrá actualizar algunas de las Configuraciones Globales de la aplicación más importantes. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Configuración Global" o volviendo a ejecutar el Asistente de Instalación + partecipation_process: + description: En este paso podrán activar/desactivar los procesos de participación que decida utilizar cada Institución. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Procesos de Participación" o volviendo a ejecutar el Asistente de Instalación From ad34271a1b33540b81272e6955ade475f5845967 Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Thu, 12 Sep 2019 16:50:48 +0200 Subject: [PATCH 26/48] Map: Add translations --- app/views/admin/wizards/installer/map.html.erb | 5 ++--- config/locales/es/wizard.yml | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/admin/wizards/installer/map.html.erb b/app/views/admin/wizards/installer/map.html.erb index d2e2da554b7..0216cf94251 100644 --- a/app/views/admin/wizards/installer/map.html.erb +++ b/app/views/admin/wizards/installer/map.html.erb @@ -5,9 +5,8 @@
    -

    Configuración del Mapa

    -

    En este paso podrán activar/desactivar la geolocalización de las propuestas y proyectos de gasto, y personalizar la manera en que se muestra el mapa a los usuarios. - En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Configuración del mapa" o volviendo a ejecutar el Asistente de Instalación

    +

    <%= t("admin.settings.index.map.title") %>

    +

    <%= t("wizard.map.description") %>

    <%#= render "admin/settings/settings_table", settings: @settings %> <% @settings.each do |setting_group| %> <%= render "admin/settings/mixed_settings_table", settings: setting_group %> diff --git a/config/locales/es/wizard.yml b/config/locales/es/wizard.yml index f212f8b146e..4168b10a9ab 100644 --- a/config/locales/es/wizard.yml +++ b/config/locales/es/wizard.yml @@ -14,3 +14,5 @@ es: description: En este paso podrá actualizar algunas de las Configuraciones Globales de la aplicación más importantes. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Configuración Global" o volviendo a ejecutar el Asistente de Instalación partecipation_process: description: En este paso podrán activar/desactivar los procesos de participación que decida utilizar cada Institución. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Procesos de Participación" o volviendo a ejecutar el Asistente de Instalación + map: + description: En este paso podrán activar/desactivar la geolocalización de las propuestas y proyectos de gasto, y personalizar la manera en que se muestra el mapa a los usuarios. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Configuración del mapa" o volviendo a ejecutar el Asistente de Instalación From e6bfadfa09c5ddb802404b4825c9e0742c772e32 Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Thu, 12 Sep 2019 16:51:08 +0200 Subject: [PATCH 27/48] SMTP: Add translations --- app/views/admin/wizards/installer/smtp.html.erb | 5 ++--- config/locales/es/wizard.yml | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/admin/wizards/installer/smtp.html.erb b/app/views/admin/wizards/installer/smtp.html.erb index 63973eb09ef..88f650c13f8 100644 --- a/app/views/admin/wizards/installer/smtp.html.erb +++ b/app/views/admin/wizards/installer/smtp.html.erb @@ -5,9 +5,8 @@
    -

    Conexión SMTP

    -

    En este paso podrán configurar la conexión SMTP para poder enviar correos desde la aplicación - En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Conexión SMTP" o volviendo a ejecutar el Asistente de Instalación

    +

    <%= t("wizard.smtp.title") %>

    +

    <%= t("wizard.smtp.description") %>

    <%= render "admin/settings/mixed_settings_table", settings: @settings %>
    diff --git a/config/locales/es/wizard.yml b/config/locales/es/wizard.yml index 4168b10a9ab..9f09fbad8b5 100644 --- a/config/locales/es/wizard.yml +++ b/config/locales/es/wizard.yml @@ -16,3 +16,6 @@ es: description: En este paso podrán activar/desactivar los procesos de participación que decida utilizar cada Institución. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Procesos de Participación" o volviendo a ejecutar el Asistente de Instalación map: description: En este paso podrán activar/desactivar la geolocalización de las propuestas y proyectos de gasto, y personalizar la manera en que se muestra el mapa a los usuarios. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Configuración del mapa" o volviendo a ejecutar el Asistente de Instalación + smtp: + title: Conexión SMTP + description: En este paso podrán configurar la conexión SMTP para poder enviar correos desde la aplicación En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Conexión SMTP" o volviendo a ejecutar el Asistente de Instalación From 7515a3ab65619726bbd59bc7cb2adff93a20da1b Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Thu, 12 Sep 2019 16:51:35 +0200 Subject: [PATCH 28/48] Regional: Add translations --- app/views/admin/wizards/installer/regional.html.erb | 7 +++---- config/locales/es/wizard.yml | 3 +++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/views/admin/wizards/installer/regional.html.erb b/app/views/admin/wizards/installer/regional.html.erb index 51b0b1db567..6df5f348853 100644 --- a/app/views/admin/wizards/installer/regional.html.erb +++ b/app/views/admin/wizards/installer/regional.html.erb @@ -5,12 +5,11 @@
    -

    Idiomas y Zona horaria

    -

    En este paso podrán configurar el idioma por defecto de la aplicación, los idiomas disponibles y la zona horaria en la que se encuentra. - En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Regional Settings" o volviendo a ejecutar el Asistente de Instalación

    +

    <%= t("wizard.regional.title") %>

    +

    <%= t("wizard.regional.description") %>

    <% @settings.each do |setting_group| %>

    <%= t("admin.settings.index.regional.#{setting_group.first.key.split(".").second}") %>

    <%= render "admin/settings/mixed_settings_table", settings: setting_group %> - <% end %> + <% end %>
    diff --git a/config/locales/es/wizard.yml b/config/locales/es/wizard.yml index 9f09fbad8b5..40f5557d4cd 100644 --- a/config/locales/es/wizard.yml +++ b/config/locales/es/wizard.yml @@ -19,3 +19,6 @@ es: smtp: title: Conexión SMTP description: En este paso podrán configurar la conexión SMTP para poder enviar correos desde la aplicación En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Conexión SMTP" o volviendo a ejecutar el Asistente de Instalación + regional: + title: Idiomas y Zona horaria + description: En este paso podrán configurar el idioma por defecto de la aplicación, los idiomas disponibles y la zona horaria en la que se encuentra. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Regional Settings" o volviendo a ejecutar el Asistente de Instalación From 16530c8b03e863e50eb621ab645093c55eee8468 Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Thu, 12 Sep 2019 16:51:50 +0200 Subject: [PATCH 29/48] Finish: Add translations --- app/views/admin/wizards/installer/finish.html.erb | 6 +++--- config/locales/es/wizard.yml | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/views/admin/wizards/installer/finish.html.erb b/app/views/admin/wizards/installer/finish.html.erb index ddfe0a3331b..f69de6f8d17 100644 --- a/app/views/admin/wizards/installer/finish.html.erb +++ b/app/views/admin/wizards/installer/finish.html.erb @@ -4,8 +4,8 @@
    -

    Asistente finalizado con éxito

    -

    En caso de querer modificar cualquier dato una vez realizado el Asistente podrá modificarlo en la sección "Configuración" o volviendo a ejecutar el Asistente de Instalación

    - <%= link_to "Finalizar Asistente", admin_root_path, class: "button" %> +

    <%= t("wizard.finish.title") %>

    +

    <%= t("wizard.finish.description") %>

    + <%= link_to t("wizard.finish.btn_finish"), admin_root_path, class: "button" %>
    diff --git a/config/locales/es/wizard.yml b/config/locales/es/wizard.yml index 40f5557d4cd..9247b6a5a1b 100644 --- a/config/locales/es/wizard.yml +++ b/config/locales/es/wizard.yml @@ -22,3 +22,7 @@ es: regional: title: Idiomas y Zona horaria description: En este paso podrán configurar el idioma por defecto de la aplicación, los idiomas disponibles y la zona horaria en la que se encuentra. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Regional Settings" o volviendo a ejecutar el Asistente de Instalación + finish: + title: Asistente finalizado con éxito + description: En caso de querer modificar cualquier dato una vez realizado el Asistente podrá modificarlo en la sección "Configuración" o volviendo a ejecutar el Asistente de Instalación + btn_finish: Finalizar Asistente From 26137135ccd877bb8b37b9e7937cc54addae172a Mon Sep 17 00:00:00 2001 From: taitus Date: Tue, 24 Sep 2019 20:01:14 +0200 Subject: [PATCH 30/48] Improve setting helper --- app/helpers/settings_helper.rb | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/app/helpers/settings_helper.rb b/app/helpers/settings_helper.rb index cb2fc1ecdbe..96e2bbf328a 100644 --- a/app/helpers/settings_helper.rb +++ b/app/helpers/settings_helper.rb @@ -8,23 +8,35 @@ def setting @all_settings ||= Hash[Setting.all.map { |s| [s.key, s.value.presence] }] end + def is_feature?(setting) + social_feature?(setting) || + advanced_feature?(setting) || + smtp_feature?(setting) || + regional_feature?(setting) || + process_feature?(setting) || + map_feature?(setting) + end + def social_feature?(setting) key = setting.key.split(".") key.first == "social" && key.last == "login" end def advanced_feature?(setting) - key = setting.key.split(".") - key.first == "advanced" && key.last == "http_basic_auth" + setting.key == "advanced.auth.http_basic_auth" end def smtp_feature?(setting) + setting.key == "smtp.enable_starttls_auto" || setting.key == "feature.smtp_configuration" + end + + def process_feature?(setting) key = setting.key.split(".") - key.first == "smtp" && key.last == "enable_starttls_auto" + key.first == "process" end - def is_feature?(setting) - social_feature?(setting) || advanced_feature?(setting) || smtp_feature?(setting) || regional_feature?(setting) || feature?(setting.key.rpartition(".").last) || setting.key == "feature.map" || setting.key == "feature.smtp_configuration" + def map_feature?(setting) + setting.key == "feature.map" end def regional_feature?(setting) From 44a8f61338a9bc58402b401cad12362ea1f80f70 Mon Sep 17 00:00:00 2001 From: taitus Date: Wed, 25 Sep 2019 10:38:55 +0200 Subject: [PATCH 31/48] Clarify installer controller --- .../admin/wizards/installer_controller.rb | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/app/controllers/admin/wizards/installer_controller.rb b/app/controllers/admin/wizards/installer_controller.rb index 860a2b3073a..ce797fc23cb 100644 --- a/app/controllers/admin/wizards/installer_controller.rb +++ b/app/controllers/admin/wizards/installer_controller.rb @@ -20,13 +20,28 @@ def set_total_steps def set_settings case params[:id] when "general_settings" - @settings = [Setting.find_by(key: "org_name"), Setting.find_by(key: "min_age_to_participate")] + @settings = [Setting.find_by(key: "org_name"), + Setting.find_by(key: "min_age_to_participate")] when "participation_process" - @settings = [[Setting.find_by(key: "process.debates"), Setting.find_by(key: "process.proposals"), Setting.find_by(key: "votes_for_proposal_success"), Setting.find_by(key: "process.polls"), Setting.find_by(key: "process.budgets")]] + @settings = [[Setting.find_by(key: "process.debates"), + Setting.find_by(key: "process.proposals"), + Setting.find_by(key: "votes_for_proposal_success"), + Setting.find_by(key: "process.polls"), + Setting.find_by(key: "process.budgets")]] when "map" - @settings = [[Setting.find_by(key: "feature.map"), Setting.find_by(key: "map.latitude"), Setting.find_by(key: "map.longitude"), Setting.find_by(key: "map.zoom")]] + @settings = [[Setting.find_by(key: "feature.map"), + Setting.find_by(key: "map.latitude"), + Setting.find_by(key: "map.longitude"), + Setting.find_by(key: "map.zoom")]] when "smtp" - @settings = [Setting.find_by(key: "feature.smtp_configuration"), Setting.find_by(key: "smtp.address"), Setting.find_by(key: "smtp.port"), Setting.find_by(key: "smtp.domain"), Setting.find_by(key: "smtp.username"), Setting.find_by(key: "smtp.password"), Setting.find_by(key: "smtp.authentication"), Setting.find_by(key: "smtp.enable_starttls_auto")] + @settings = [Setting.find_by(key: "feature.smtp_configuration"), + Setting.find_by(key: "smtp.address"), + Setting.find_by(key: "smtp.port"), + Setting.find_by(key: "smtp.domain"), + Setting.find_by(key: "smtp.username"), + Setting.find_by(key: "smtp.password"), + Setting.find_by(key: "smtp.authentication"), + Setting.find_by(key: "smtp.enable_starttls_auto")] when "regional" all_settings = Setting.all.group_by { |setting| setting.type } @settings = [all_settings["regional.default_locale"]] + [valid_regional_available_locales(all_settings)] + [all_settings["regional.time_zone"]] From ff27b80b7354e0f2fc8f570cc13e958be4d26cf6 Mon Sep 17 00:00:00 2001 From: taitus Date: Wed, 25 Sep 2019 10:40:06 +0200 Subject: [PATCH 32/48] Avoid disable current_locale as available locale --- app/controllers/admin/settings_controller.rb | 5 +---- app/controllers/admin/wizards/installer_controller.rb | 6 +----- app/helpers/settings_helper.rb | 5 +++++ app/views/admin/settings/_featured_settings_form.html.erb | 3 ++- spec/features/admin/settings_spec.rb | 6 ++++-- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/app/controllers/admin/settings_controller.rb b/app/controllers/admin/settings_controller.rb index 1673a1ef6f7..832d793a198 100644 --- a/app/controllers/admin/settings_controller.rb +++ b/app/controllers/admin/settings_controller.rb @@ -60,13 +60,10 @@ def settings_by_group(group) when "advanced" [all_settings["advanced.auth"]] + [all_settings["advanced.tracking"]] when "regional" - [all_settings["regional.default_locale"]] + [valid_regional_available_locales(all_settings)] + [all_settings["regional.time_zone"]] + [all_settings["regional.default_locale"]] + [all_settings["regional.available_locale"]] + [all_settings["regional.time_zone"]] else all_settings[group] end end - def valid_regional_available_locales(all_settings) - all_settings["regional.available_locale"].select { |s| s.key.rpartition(".").last.to_sym != I18n.default_locale } - end end diff --git a/app/controllers/admin/wizards/installer_controller.rb b/app/controllers/admin/wizards/installer_controller.rb index ce797fc23cb..50286c3eacc 100644 --- a/app/controllers/admin/wizards/installer_controller.rb +++ b/app/controllers/admin/wizards/installer_controller.rb @@ -44,12 +44,8 @@ def set_settings Setting.find_by(key: "smtp.enable_starttls_auto")] when "regional" all_settings = Setting.all.group_by { |setting| setting.type } - @settings = [all_settings["regional.default_locale"]] + [valid_regional_available_locales(all_settings)] + [all_settings["regional.time_zone"]] + @settings = [all_settings["regional.default_locale"]] + [all_settings["regional.available_locale"]] + [all_settings["regional.time_zone"]] end end - def valid_regional_available_locales(all_settings) - all_settings["regional.available_locale"].select { |s| s.key.rpartition(".").last.to_sym != I18n.default_locale } - end - end diff --git a/app/helpers/settings_helper.rb b/app/helpers/settings_helper.rb index 96e2bbf328a..88671f9b8a4 100644 --- a/app/helpers/settings_helper.rb +++ b/app/helpers/settings_helper.rb @@ -54,4 +54,9 @@ def regional_setting?(setting) setting.type.rpartition(".").first == "regional" end + def need_disable_language?(setting) + setting_locale = setting.key.rpartition(".").last.to_sym + setting_locale == I18n.default_locale || setting_locale == I18n.locale + end + end diff --git a/app/views/admin/settings/_featured_settings_form.html.erb b/app/views/admin/settings/_featured_settings_form.html.erb index 32c1c93339d..d973c3a6b17 100644 --- a/app/views/admin/settings/_featured_settings_form.html.erb +++ b/app/views/admin/settings/_featured_settings_form.html.erb @@ -2,5 +2,6 @@ <%= f.hidden_field :value, id: dom_id(feature), value: (feature.enabled? ? "" : "active") %> <%= f.submit(t("admin.settings.index.features.#{feature.enabled? ? "disable" : "enable"}"), class: "button expanded #{feature.enabled? ? "hollow alert" : "success"}", - data: { confirm: t("admin.actions.confirm") }) %> + disabled: need_disable_language?(feature), + data: {confirm: t("admin.actions.confirm") }) %> <% end %> diff --git a/spec/features/admin/settings_spec.rb b/spec/features/admin/settings_spec.rb index 988efaa79c2..5639ba56a41 100644 --- a/spec/features/admin/settings_spec.rb +++ b/spec/features/admin/settings_spec.rb @@ -184,13 +184,15 @@ expect(page).to have_css("#edit_setting_#{setting.id}") end - scenario "Should not display default_locale as available_locales feature" do + scenario "Should display with disabled style default_locale as available_locales feature" do default_locale = Setting.find_by(key: "regional.default_locale.key").value available_locale_setting_from_default_locale = Setting.find_by(key: "regional.available_locale.#{default_locale}") visit admin_setting_path("regional") - expect(page).not_to have_css("#edit_setting_#{available_locale_setting_from_default_locale.id}") + within "#edit_setting_#{available_locale_setting_from_default_locale.id}" do + expect(find("input[name='commit'][type='submit']").disabled?).to be true + end end end From 8cb98423c1b6c4a2364b88aa17647515cc35050f Mon Sep 17 00:00:00 2001 From: taitus Date: Wed, 25 Sep 2019 10:54:42 +0200 Subject: [PATCH 33/48] Fix spec --- spec/helpers/settings_helper_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/helpers/settings_helper_spec.rb b/spec/helpers/settings_helper_spec.rb index 6c454ddc16a..7bfd3e5fd84 100644 --- a/spec/helpers/settings_helper_spec.rb +++ b/spec/helpers/settings_helper_spec.rb @@ -44,7 +44,7 @@ describe "#smtp_feature?" do it "returns true when smtp setting is a feature flag" do - smtp_setting_flag = Setting.create(key: "smtp.sample_smtp.enable_starttls_auto") + smtp_setting_flag = Setting.create(key: "smtp.enable_starttls_auto") smtp_setting_input = Setting.create(key: "smtp.sample_smtp.input") smtp_setting_one_level = Setting.create(key: "smtp.one_level") another_setting = Setting.create(key: "another_setting.sample_key") From 47271212ac79a77190a832ea7c1f658b88fd6528 Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Wed, 25 Sep 2019 12:10:29 +0200 Subject: [PATCH 34/48] Create new en.yml - Add English translate --- config/locales/en/wizard.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 config/locales/en/wizard.yml diff --git a/config/locales/en/wizard.yml b/config/locales/en/wizard.yml new file mode 100644 index 00000000000..b91a782dc19 --- /dev/null +++ b/config/locales/en/wizard.yml @@ -0,0 +1,28 @@ +en: + wizard: + header: + title: Installation Wizard + step: Step + step_of: of + back_step: Back + next_step: Next + new: + title: Welcome to the Consul installation wizard + description: In this wizard we will carry out step by step all the necessary configuration to be able to customize the application to the needs of your Institution. If you do not have any information requested in the wizard, you will be able to ignore it and modify it in the future in the related Settings Section or from this same Wizard. + btn_start: Get Started + general_settings: + description: In this step you can update some of the most important Global Application Settings. If you want to modify any of them once the Wizard has been carried out, you can go to the "Configuration" > "Global Configuration" section or by running the Installation Wizard again. + partecipation_process: + description: In this step you can activate/deactivate the participation processes that each Institution decides to use. If you want to modify any of them once the Wizard has been carried out, you can access the "Configuration" > "Participation Processes" section or by running the Installation Wizard again. + map: + description: In this step you will be able to activate/deactivate the geolocation of proposals and spending projects, and customize the way the map is shown to users. If you want to modify any of them once the Wizard has been carried out, you can access the "Configuration" > "Map Configuration" section or run the Installation Wizard again. + smtp: + title: SMTP Connection + description: In this step you will be able to configure the SMTP connection to be able to send mails from the application. If you want to modify any of them once the Wizard has been carried out, you will be able to access the section "Configuration" > "SMTP Connection" or by running the Installation Wizard again. + regional: + title: Languages and Time Zone + description: In this step you can set the default language of the application, the available languages and the time zone you are in. If you want to modify any of them once the Wizard has been carried out, you can go to the "Configuration" > "Regional Settings" section or by running the Installation Wizard again. + finish: + title: Assistant successfully completed + description: If you want to modify any data once the Wizard has been carried out, you can modify it in the "Configuration" section or by running the Installation Wizard again. + btn_finish: Finish Wizard From 6796b6a43e752e9e323f24e594b7d1965f6a2b9e Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Wed, 25 Sep 2019 12:10:58 +0200 Subject: [PATCH 35/48] Translate word to english to spanish --- config/locales/es/wizard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/es/wizard.yml b/config/locales/es/wizard.yml index 9247b6a5a1b..5ecaed29af1 100644 --- a/config/locales/es/wizard.yml +++ b/config/locales/es/wizard.yml @@ -8,7 +8,7 @@ es: next_step: Siguiente new: title: Bienvenido al asistente de instalación de Consul - description: En este asistente realizaremos paso a paso toda la configuración necesaria para poder personalizar la aplicación a las necesidades de su Institución. Si no dispone de alguna información solicitada en el asistente podrá obviarlos y modificarlo en un futuro en la Sección de Settings relacionada o desde este mismo Asistente. + description: En este asistente realizaremos paso a paso toda la configuración necesaria para poder personalizar la aplicación a las necesidades de su Institución. Si no dispone de alguna información solicitada en el asistente podrá obviarlos y modificarlo en un futuro en la Sección de Configuración relacionada o desde este mismo Asistente. btn_start: Empezar general_settings: description: En este paso podrá actualizar algunas de las Configuraciones Globales de la aplicación más importantes. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Configuración Global" o volviendo a ejecutar el Asistente de Instalación From eef30d425508a67147f8bb2a6942ed4de4fe06e7 Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Wed, 25 Sep 2019 12:11:13 +0200 Subject: [PATCH 36/48] Use appropriate key in the section --- app/views/admin/wizards/installer/general_settings.html.erb | 2 +- .../admin/wizards/installer/participation_process.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/admin/wizards/installer/general_settings.html.erb b/app/views/admin/wizards/installer/general_settings.html.erb index c3669649de5..7e796a3d3bb 100644 --- a/app/views/admin/wizards/installer/general_settings.html.erb +++ b/app/views/admin/wizards/installer/general_settings.html.erb @@ -6,7 +6,7 @@

    <%= t("admin.settings.index.title") %>

    -

    <%= t("wizard.partecipation_process.description") %>

    +

    <%= t("wizard.general_settings.description") %>

    <%= render "admin/settings/settings_table", settings: @settings %>
    diff --git a/app/views/admin/wizards/installer/participation_process.html.erb b/app/views/admin/wizards/installer/participation_process.html.erb index b8bb298ccf9..bf43d156bba 100644 --- a/app/views/admin/wizards/installer/participation_process.html.erb +++ b/app/views/admin/wizards/installer/participation_process.html.erb @@ -6,7 +6,7 @@

    <%= t("admin.settings.index.process.title") %>

    -

    <%= t("wizard.general_settings.description") %>

    +

    <%= t("wizard.partecipation_process.description") %>

    <% @settings.each do |setting_group| %> <%= render "admin/settings/mixed_settings_table", settings: setting_group %> <% end %> From 098c9e4e4cf3588a9b1cf7a2aca79bfb0a01df88 Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Wed, 25 Sep 2019 12:20:04 +0200 Subject: [PATCH 37/48] ES: Add tag strong in the yml in each section --- app/views/admin/wizards/installer/finish.html.erb | 2 +- .../wizards/installer/general_settings.html.erb | 2 +- app/views/admin/wizards/installer/map.html.erb | 2 +- app/views/admin/wizards/installer/new.html.erb | 2 +- .../installer/participation_process.html.erb | 2 +- .../admin/wizards/installer/regional.html.erb | 2 +- app/views/admin/wizards/installer/smtp.html.erb | 2 +- config/locales/es/wizard.yml | 14 +++++++------- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/views/admin/wizards/installer/finish.html.erb b/app/views/admin/wizards/installer/finish.html.erb index f69de6f8d17..403a20ce280 100644 --- a/app/views/admin/wizards/installer/finish.html.erb +++ b/app/views/admin/wizards/installer/finish.html.erb @@ -5,7 +5,7 @@

    <%= t("wizard.finish.title") %>

    -

    <%= t("wizard.finish.description") %>

    +

    <%= t("wizard.finish.description_html") %>

    <%= link_to t("wizard.finish.btn_finish"), admin_root_path, class: "button" %>
    diff --git a/app/views/admin/wizards/installer/general_settings.html.erb b/app/views/admin/wizards/installer/general_settings.html.erb index 7e796a3d3bb..1a55b17efb4 100644 --- a/app/views/admin/wizards/installer/general_settings.html.erb +++ b/app/views/admin/wizards/installer/general_settings.html.erb @@ -6,7 +6,7 @@

    <%= t("admin.settings.index.title") %>

    -

    <%= t("wizard.general_settings.description") %>

    +

    <%= t("wizard.general_settings.description_html") %>

    <%= render "admin/settings/settings_table", settings: @settings %>
    diff --git a/app/views/admin/wizards/installer/map.html.erb b/app/views/admin/wizards/installer/map.html.erb index 0216cf94251..bed6ca657cc 100644 --- a/app/views/admin/wizards/installer/map.html.erb +++ b/app/views/admin/wizards/installer/map.html.erb @@ -6,7 +6,7 @@

    <%= t("admin.settings.index.map.title") %>

    -

    <%= t("wizard.map.description") %>

    +

    <%= t("wizard.map.description_html") %>

    <%#= render "admin/settings/settings_table", settings: @settings %> <% @settings.each do |setting_group| %> <%= render "admin/settings/mixed_settings_table", settings: setting_group %> diff --git a/app/views/admin/wizards/installer/new.html.erb b/app/views/admin/wizards/installer/new.html.erb index 7ad66858ab5..cee3e39bbd8 100644 --- a/app/views/admin/wizards/installer/new.html.erb +++ b/app/views/admin/wizards/installer/new.html.erb @@ -4,7 +4,7 @@

    <%= t("wizard.new.title") %>

    -

    <%= t("wizard.new.description") %>

    +

    <%= t("wizard.new.description_html") %>

    <%= link_to t("wizard.new.btn_start"), admin_wizards_installer_path(:general_settings), class: "button" %>
    diff --git a/app/views/admin/wizards/installer/participation_process.html.erb b/app/views/admin/wizards/installer/participation_process.html.erb index bf43d156bba..e573dc929f8 100644 --- a/app/views/admin/wizards/installer/participation_process.html.erb +++ b/app/views/admin/wizards/installer/participation_process.html.erb @@ -6,7 +6,7 @@

    <%= t("admin.settings.index.process.title") %>

    -

    <%= t("wizard.partecipation_process.description") %>

    +

    <%= t("wizard.partecipation_process.description_html") %>

    <% @settings.each do |setting_group| %> <%= render "admin/settings/mixed_settings_table", settings: setting_group %> <% end %> diff --git a/app/views/admin/wizards/installer/regional.html.erb b/app/views/admin/wizards/installer/regional.html.erb index 6df5f348853..14438624f57 100644 --- a/app/views/admin/wizards/installer/regional.html.erb +++ b/app/views/admin/wizards/installer/regional.html.erb @@ -6,7 +6,7 @@

    <%= t("wizard.regional.title") %>

    -

    <%= t("wizard.regional.description") %>

    +

    <%= t("wizard.regional.description_html") %>

    <% @settings.each do |setting_group| %>

    <%= t("admin.settings.index.regional.#{setting_group.first.key.split(".").second}") %>

    <%= render "admin/settings/mixed_settings_table", settings: setting_group %> diff --git a/app/views/admin/wizards/installer/smtp.html.erb b/app/views/admin/wizards/installer/smtp.html.erb index 88f650c13f8..b09179c6008 100644 --- a/app/views/admin/wizards/installer/smtp.html.erb +++ b/app/views/admin/wizards/installer/smtp.html.erb @@ -6,7 +6,7 @@

    <%= t("wizard.smtp.title") %>

    -

    <%= t("wizard.smtp.description") %>

    +

    <%= t("wizard.smtp.description_html") %>

    <%= render "admin/settings/mixed_settings_table", settings: @settings %>
    diff --git a/config/locales/es/wizard.yml b/config/locales/es/wizard.yml index 5ecaed29af1..3fd3fd34ed3 100644 --- a/config/locales/es/wizard.yml +++ b/config/locales/es/wizard.yml @@ -8,21 +8,21 @@ es: next_step: Siguiente new: title: Bienvenido al asistente de instalación de Consul - description: En este asistente realizaremos paso a paso toda la configuración necesaria para poder personalizar la aplicación a las necesidades de su Institución. Si no dispone de alguna información solicitada en el asistente podrá obviarlos y modificarlo en un futuro en la Sección de Configuración relacionada o desde este mismo Asistente. + description_html: En este asistente realizaremos paso a paso toda la configuración necesaria para poder personalizar la aplicación a las necesidades de su Institución. Si no dispone de alguna información solicitada en el asistente podrá obviarlos y modificarlo en un futuro en la Sección de Configuración relacionada o desde este mismo Asistente. btn_start: Empezar general_settings: - description: En este paso podrá actualizar algunas de las Configuraciones Globales de la aplicación más importantes. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Configuración Global" o volviendo a ejecutar el Asistente de Instalación + description_html: En este paso podrá actualizar algunas de las Configuraciones Globales de la aplicación más importantes. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > Configuración Global o volviendo a ejecutar el Asistente de Instalación partecipation_process: - description: En este paso podrán activar/desactivar los procesos de participación que decida utilizar cada Institución. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Procesos de Participación" o volviendo a ejecutar el Asistente de Instalación + description_html: En este paso podrán activar/desactivar los procesos de participación que decida utilizar cada Institución. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > Procesos de Participación o volviendo a ejecutar el Asistente de Instalación map: - description: En este paso podrán activar/desactivar la geolocalización de las propuestas y proyectos de gasto, y personalizar la manera en que se muestra el mapa a los usuarios. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Configuración del mapa" o volviendo a ejecutar el Asistente de Instalación + description_html: En este paso podrán activar/desactivar la geolocalización de las propuestas y proyectos de gasto, y personalizar la manera en que se muestra el mapa a los usuarios. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > Configuración del mapa o volviendo a ejecutar el Asistente de Instalación smtp: title: Conexión SMTP - description: En este paso podrán configurar la conexión SMTP para poder enviar correos desde la aplicación En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Conexión SMTP" o volviendo a ejecutar el Asistente de Instalación + description_html: En este paso podrán configurar la conexión SMTP para poder enviar correos desde la aplicación En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > Conexión SMTP o volviendo a ejecutar el Asistente de Instalación regional: title: Idiomas y Zona horaria - description: En este paso podrán configurar el idioma por defecto de la aplicación, los idiomas disponibles y la zona horaria en la que se encuentra. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > "Regional Settings" o volviendo a ejecutar el Asistente de Instalación + description_html: En este paso podrán configurar el idioma por defecto de la aplicación, los idiomas disponibles y la zona horaria en la que se encuentra. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > Regional Settings o volviendo a ejecutar el Asistente de Instalación finish: title: Asistente finalizado con éxito - description: En caso de querer modificar cualquier dato una vez realizado el Asistente podrá modificarlo en la sección "Configuración" o volviendo a ejecutar el Asistente de Instalación + description_html: En caso de querer modificar cualquier dato una vez realizado el Asistente podrá modificarlo en la sección Configuración o volviendo a ejecutar el Asistente de Instalación btn_finish: Finalizar Asistente From 3d0754510b6866bdb22a4106483770b5b5d56257 Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Wed, 25 Sep 2019 12:37:52 +0200 Subject: [PATCH 38/48] EN: Change settings to global settings --- app/views/admin/wizards/installer/general_settings.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/wizards/installer/general_settings.html.erb b/app/views/admin/wizards/installer/general_settings.html.erb index 1a55b17efb4..d7c0064ce34 100644 --- a/app/views/admin/wizards/installer/general_settings.html.erb +++ b/app/views/admin/wizards/installer/general_settings.html.erb @@ -5,7 +5,7 @@
    -

    <%= t("admin.settings.index.title") %>

    +

    <%= t("admin.menu.settings") %>

    <%= t("wizard.general_settings.description_html") %>

    <%= render "admin/settings/settings_table", settings: @settings %>
    From 9cd37c9f376c1597b684cefca1636e1a23b2b224 Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Wed, 25 Sep 2019 12:38:21 +0200 Subject: [PATCH 39/48] EN: Add tag strong --- config/locales/en/wizard.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/config/locales/en/wizard.yml b/config/locales/en/wizard.yml index b91a782dc19..9c8499da330 100644 --- a/config/locales/en/wizard.yml +++ b/config/locales/en/wizard.yml @@ -8,21 +8,21 @@ en: next_step: Next new: title: Welcome to the Consul installation wizard - description: In this wizard we will carry out step by step all the necessary configuration to be able to customize the application to the needs of your Institution. If you do not have any information requested in the wizard, you will be able to ignore it and modify it in the future in the related Settings Section or from this same Wizard. + description_html: In this wizard we will carry out step by step all the necessary configuration to be able to customize the application to the needs of your Institution. If you do not have any information requested in the wizard, you will be able to ignore it and modify it in the future in the related Settings Section or from this same Wizard. btn_start: Get Started general_settings: - description: In this step you can update some of the most important Global Application Settings. If you want to modify any of them once the Wizard has been carried out, you can go to the "Configuration" > "Global Configuration" section or by running the Installation Wizard again. + description_html: In this step you can update some of the most important Global Application Settings. If you want to modify any of them once the Wizard has been carried out, you can go to the "Configuration" > Global Configuration section or by running the Installation Wizard again. partecipation_process: - description: In this step you can activate/deactivate the participation processes that each Institution decides to use. If you want to modify any of them once the Wizard has been carried out, you can access the "Configuration" > "Participation Processes" section or by running the Installation Wizard again. + description_html: In this step you can activate/deactivate the participation processes that each Institution decides to use. If you want to modify any of them once the Wizard has been carried out, you can access the "Configuration" > Participation Processes section or by running the Installation Wizard again. map: - description: In this step you will be able to activate/deactivate the geolocation of proposals and spending projects, and customize the way the map is shown to users. If you want to modify any of them once the Wizard has been carried out, you can access the "Configuration" > "Map Configuration" section or run the Installation Wizard again. + description_html: In this step you will be able to activate/deactivate the geolocation of proposals and spending projects, and customize the way the map is shown to users. If you want to modify any of them once the Wizard has been carried out, you can access the "Configuration" > Map Configuration section or run the Installation Wizard again. smtp: title: SMTP Connection - description: In this step you will be able to configure the SMTP connection to be able to send mails from the application. If you want to modify any of them once the Wizard has been carried out, you will be able to access the section "Configuration" > "SMTP Connection" or by running the Installation Wizard again. + description_html: In this step you will be able to configure the SMTP connection to be able to send mails from the application. If you want to modify any of them once the Wizard has been carried out, you will be able to access the section "Configuration" > SMTP Connection or by running the Installation Wizard again. regional: title: Languages and Time Zone - description: In this step you can set the default language of the application, the available languages and the time zone you are in. If you want to modify any of them once the Wizard has been carried out, you can go to the "Configuration" > "Regional Settings" section or by running the Installation Wizard again. + description_html: In this step you can set the default language of the application, the available languages and the time zone you are in. If you want to modify any of them once the Wizard has been carried out, you can go to the "Configuration" > Regional Settings section or by running the Installation Wizard again. finish: title: Assistant successfully completed - description: If you want to modify any data once the Wizard has been carried out, you can modify it in the "Configuration" section or by running the Installation Wizard again. + description_html: If you want to modify any data once the Wizard has been carried out, you can modify it in the Configuration section or by running the Installation Wizard again. btn_finish: Finish Wizard From c1a418aa5b66590f25f852ef4e26ac27fc918721 Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Wed, 25 Sep 2019 13:03:06 +0200 Subject: [PATCH 40/48] Responsive: Fix buttons style --- app/assets/stylesheets/wizard.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/assets/stylesheets/wizard.scss b/app/assets/stylesheets/wizard.scss index 6703e285a14..fa7999c68a1 100644 --- a/app/assets/stylesheets/wizard.scss +++ b/app/assets/stylesheets/wizard.scss @@ -37,4 +37,9 @@ margin-bottom: 0; } + @include breakpoint(small) { + input.button { + padding: 1em 0; + } + } } From eb6d0bddf2a4d9b9a206173ad3cf33ab6b119b93 Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Wed, 25 Sep 2019 13:13:27 +0200 Subject: [PATCH 41/48] Translate: Add configuration word strong --- config/locales/en/wizard.yml | 12 ++++++------ config/locales/es/wizard.yml | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/config/locales/en/wizard.yml b/config/locales/en/wizard.yml index 9c8499da330..eb2ba2566ec 100644 --- a/config/locales/en/wizard.yml +++ b/config/locales/en/wizard.yml @@ -8,20 +8,20 @@ en: next_step: Next new: title: Welcome to the Consul installation wizard - description_html: In this wizard we will carry out step by step all the necessary configuration to be able to customize the application to the needs of your Institution. If you do not have any information requested in the wizard, you will be able to ignore it and modify it in the future in the related Settings Section or from this same Wizard. + description_html: In this wizard we will carry out step by step all the necessary configuration to be able to customize the application to the needs of your Institution. If you do not have any information requested in the wizard, you will be able to ignore it and modify it in the future in the related Settings Section or from this same Wizard. btn_start: Get Started general_settings: - description_html: In this step you can update some of the most important Global Application Settings. If you want to modify any of them once the Wizard has been carried out, you can go to the "Configuration" > Global Configuration section or by running the Installation Wizard again. + description_html: In this step you can update some of the most important Global Application Settings. If you want to modify any of them once the Wizard has been carried out, you can go to the "Configuration > Global Configuration" section or by running the Installation Wizard again. partecipation_process: - description_html: In this step you can activate/deactivate the participation processes that each Institution decides to use. If you want to modify any of them once the Wizard has been carried out, you can access the "Configuration" > Participation Processes section or by running the Installation Wizard again. + description_html: In this step you can activate/deactivate the participation processes that each Institution decides to use. If you want to modify any of them once the Wizard has been carried out, you can access the "Configuration > Participation Processes" section or by running the Installation Wizard again. map: - description_html: In this step you will be able to activate/deactivate the geolocation of proposals and spending projects, and customize the way the map is shown to users. If you want to modify any of them once the Wizard has been carried out, you can access the "Configuration" > Map Configuration section or run the Installation Wizard again. + description_html: In this step you will be able to activate/deactivate the geolocation of proposals and spending projects, and customize the way the map is shown to users. If you want to modify any of them once the Wizard has been carried out, you can access the "Configuration > Map Configuration" section or run the Installation Wizard again. smtp: title: SMTP Connection - description_html: In this step you will be able to configure the SMTP connection to be able to send mails from the application. If you want to modify any of them once the Wizard has been carried out, you will be able to access the section "Configuration" > SMTP Connection or by running the Installation Wizard again. + description_html: In this step you will be able to configure the SMTP connection to be able to send mails from the application. If you want to modify any of them once the Wizard has been carried out, you will be able to access the section "Configuration > SMTP Connection" or by running the Installation Wizard again. regional: title: Languages and Time Zone - description_html: In this step you can set the default language of the application, the available languages and the time zone you are in. If you want to modify any of them once the Wizard has been carried out, you can go to the "Configuration" > Regional Settings section or by running the Installation Wizard again. + description_html: In this step you can set the default language of the application, the available languages and the time zone you are in. If you want to modify any of them once the Wizard has been carried out, you can go to the "Configuration > Regional Settings" section or by running the Installation Wizard again. finish: title: Assistant successfully completed description_html: If you want to modify any data once the Wizard has been carried out, you can modify it in the Configuration section or by running the Installation Wizard again. diff --git a/config/locales/es/wizard.yml b/config/locales/es/wizard.yml index 3fd3fd34ed3..5667f7cb1a4 100644 --- a/config/locales/es/wizard.yml +++ b/config/locales/es/wizard.yml @@ -8,20 +8,20 @@ es: next_step: Siguiente new: title: Bienvenido al asistente de instalación de Consul - description_html: En este asistente realizaremos paso a paso toda la configuración necesaria para poder personalizar la aplicación a las necesidades de su Institución. Si no dispone de alguna información solicitada en el asistente podrá obviarlos y modificarlo en un futuro en la Sección de Configuración relacionada o desde este mismo Asistente. + description_html: En este asistente realizaremos paso a paso toda la configuración necesaria para poder personalizar la aplicación a las necesidades de su Institución. Si no dispone de alguna información solicitada en el asistente podrá obviarlos y modificarlo en un futuro en la Sección de Configuración relacionada o desde este mismo Asistente. btn_start: Empezar general_settings: - description_html: En este paso podrá actualizar algunas de las Configuraciones Globales de la aplicación más importantes. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > Configuración Global o volviendo a ejecutar el Asistente de Instalación + description_html: En este paso podrá actualizar algunas de las Configuraciones Globales de la aplicación más importantes. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración > Configuración Global" o volviendo a ejecutar el Asistente de Instalación partecipation_process: - description_html: En este paso podrán activar/desactivar los procesos de participación que decida utilizar cada Institución. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > Procesos de Participación o volviendo a ejecutar el Asistente de Instalación + description_html: En este paso podrán activar/desactivar los procesos de participación que decida utilizar cada Institución. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración > Procesos de Participación" o volviendo a ejecutar el Asistente de Instalación map: - description_html: En este paso podrán activar/desactivar la geolocalización de las propuestas y proyectos de gasto, y personalizar la manera en que se muestra el mapa a los usuarios. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > Configuración del mapa o volviendo a ejecutar el Asistente de Instalación + description_html: En este paso podrán activar/desactivar la geolocalización de las propuestas y proyectos de gasto, y personalizar la manera en que se muestra el mapa a los usuarios. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración > Configuración del mapa" o volviendo a ejecutar el Asistente de Instalación smtp: title: Conexión SMTP - description_html: En este paso podrán configurar la conexión SMTP para poder enviar correos desde la aplicación En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > Conexión SMTP o volviendo a ejecutar el Asistente de Instalación + description_html: En este paso podrán configurar la conexión SMTP para poder enviar correos desde la aplicación En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración > Conexión SMTP" o volviendo a ejecutar el Asistente de Instalación regional: title: Idiomas y Zona horaria - description_html: En este paso podrán configurar el idioma por defecto de la aplicación, los idiomas disponibles y la zona horaria en la que se encuentra. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración" > Regional Settings o volviendo a ejecutar el Asistente de Instalación + description_html: En este paso podrán configurar el idioma por defecto de la aplicación, los idiomas disponibles y la zona horaria en la que se encuentra. En caso de querer modificar alguna una vez realizado el Asistente podrá acceder a la sección "Configuración > Regional Settings" o volviendo a ejecutar el Asistente de Instalación finish: title: Asistente finalizado con éxito description_html: En caso de querer modificar cualquier dato una vez realizado el Asistente podrá modificarlo en la sección Configuración o volviendo a ejecutar el Asistente de Instalación From 7fcf51a5d7068b18edd036fa0a11150c67bb4eba Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Wed, 25 Sep 2019 16:31:25 +0200 Subject: [PATCH 42/48] Add Translate in admin/wizards - I've taken away the wizard because I don't think it's any use --- app/views/admin/wizards/_wizard.html.erb | 4 ++-- app/views/admin/wizards/index.html.erb | 2 +- config/locales/en/wizard.yml | 4 ++++ config/locales/es/wizard.yml | 4 ++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/views/admin/wizards/_wizard.html.erb b/app/views/admin/wizards/_wizard.html.erb index 722904a508e..3885b9763b9 100644 --- a/app/views/admin/wizards/_wizard.html.erb +++ b/app/views/admin/wizards/_wizard.html.erb @@ -1,9 +1,9 @@ - <%= t("admin.settings.index.#{wizard}.title") %> + <%= t("wizard.admin.module_title") %>
    - <%= t("admin.settings.index.#{wizard}.description") %> + <%= t("wizard.admin.description") %> diff --git a/app/views/admin/wizards/index.html.erb b/app/views/admin/wizards/index.html.erb index e912a25b844..6f8901d135b 100644 --- a/app/views/admin/wizards/index.html.erb +++ b/app/views/admin/wizards/index.html.erb @@ -1,4 +1,4 @@ -

    <%= t("admin.settings.wizards.index.title") %>

    +

    <%= t("wizard.admin.title") %>

    diff --git a/config/locales/en/wizard.yml b/config/locales/en/wizard.yml index eb2ba2566ec..a22258d6a74 100644 --- a/config/locales/en/wizard.yml +++ b/config/locales/en/wizard.yml @@ -1,5 +1,9 @@ en: wizard: + admin: + title: Wizard + module_title: Installation Wizard + description: Through this tool we present you the installation of the system. header: title: Installation Wizard step: Step diff --git a/config/locales/es/wizard.yml b/config/locales/es/wizard.yml index 5667f7cb1a4..500f2b29f5e 100644 --- a/config/locales/es/wizard.yml +++ b/config/locales/es/wizard.yml @@ -1,5 +1,9 @@ es: wizard: + admin: + title: Asistente + module_title: Asistente de instalación + description: A través de esta herramienta le presentamos la instalación del sistema. header: title: Asistente de instalación step: Paso From c3c57f36d48ce40537398031de833cdf9f0e29d7 Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Wed, 25 Sep 2019 16:57:29 +0200 Subject: [PATCH 43/48] Add translate in sidemenu --- config/locales/en/admin.yml | 1 + config/locales/es/admin.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index da05c47d2f5..d039acb221b 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -744,6 +744,7 @@ en: debates: "Debates" comments: "Comments" local_census_records: Manage local census + wizards: Wizard administrators: index: title: Administrators diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index 95f9e1b2e15..75ccf40c1e5 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -745,6 +745,7 @@ es: debates: "Debates" comments: "Comentarios" local_census_records: Gestionar censo local + wizards: Asistente administrators: index: title: Administradores From 39752d8be1193258685454d46f78129243ba1961 Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Wed, 25 Sep 2019 16:57:45 +0200 Subject: [PATCH 44/48] Show active_menu wizards --- app/helpers/admin_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb index 9f3a21c7e62..5dda01e5b54 100644 --- a/app/helpers/admin_helper.rb +++ b/app/helpers/admin_helper.rb @@ -48,7 +48,7 @@ def menu_profiles? def menu_settings? controllers_names = ["settings", "tags", "geozones", "images", "content_blocks", - "local_census_records", "imports"] + "local_census_records", "imports", "wizards"] controllers_names.include?(controller_name) && controller.class.parent != Admin::Poll::Questions::Answers end From ba6daecef539706fa65f051948a368cf67aac74c Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Thu, 26 Sep 2019 11:27:19 +0200 Subject: [PATCH 45/48] Fix step 1 no buttons Fix jump effect "no button in the header" from step 1 to step 2 --- app/assets/stylesheets/wizard.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/stylesheets/wizard.scss b/app/assets/stylesheets/wizard.scss index fa7999c68a1..8b356dd7d97 100644 --- a/app/assets/stylesheets/wizard.scss +++ b/app/assets/stylesheets/wizard.scss @@ -6,6 +6,7 @@ h3, .current-step { display: inline-block; + padding: .7em 0; } .current-step { From cd445d0a535c33b785d4a12215dce2d96550a6ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Fri, 27 Sep 2019 15:10:22 +0200 Subject: [PATCH 46/48] Add new translation file to i18n-tasks configuration --- config/i18n-tasks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/i18n-tasks.yml b/config/i18n-tasks.yml index f88912b6eb4..18c5b76e3b8 100644 --- a/config/i18n-tasks.yml +++ b/config/i18n-tasks.yml @@ -48,6 +48,7 @@ data: - config/locales/%{locale}/stats.yml - config/locales/%{locale}/download.yml - config/locales/%{locale}/tracking.yml + - config/locales/%{locale}/wizard.yml # Locale files to write new keys to, based on a list of key pattern => file rules. Matched from top to bottom: # `i18n-tasks normalize -p` will force move the keys according to these rules From 3bf2edfd7d0ead7600e059163f8bb55015062d4b Mon Sep 17 00:00:00 2001 From: taitus Date: Fri, 27 Sep 2019 19:26:46 +0200 Subject: [PATCH 47/48] Add wizard specs --- .../installer/general_settings.html.erb | 2 +- .../admin/wizards/installer/map.html.erb | 2 +- .../installer/participation_process.html.erb | 2 +- .../admin/wizards/installer/regional.html.erb | 2 +- .../admin/wizards/installer/smtp.html.erb | 2 +- spec/features/admin/wizards/installer_spec.rb | 124 ++++++++++++++++++ spec/features/admin/wizards_spec.rb | 28 ++++ 7 files changed, 157 insertions(+), 5 deletions(-) create mode 100644 spec/features/admin/wizards/installer_spec.rb create mode 100644 spec/features/admin/wizards_spec.rb diff --git a/app/views/admin/wizards/installer/general_settings.html.erb b/app/views/admin/wizards/installer/general_settings.html.erb index d7c0064ce34..de2d9797fbd 100644 --- a/app/views/admin/wizards/installer/general_settings.html.erb +++ b/app/views/admin/wizards/installer/general_settings.html.erb @@ -4,7 +4,7 @@ next_step: admin_wizards_installer_path(:participation_process) %>
    -
    +

    <%= t("admin.menu.settings") %>

    <%= t("wizard.general_settings.description_html") %>

    <%= render "admin/settings/settings_table", settings: @settings %> diff --git a/app/views/admin/wizards/installer/map.html.erb b/app/views/admin/wizards/installer/map.html.erb index bed6ca657cc..e530837bd14 100644 --- a/app/views/admin/wizards/installer/map.html.erb +++ b/app/views/admin/wizards/installer/map.html.erb @@ -4,7 +4,7 @@ next_step: admin_wizards_installer_path(:smtp) %>
    -
    +

    <%= t("admin.settings.index.map.title") %>

    <%= t("wizard.map.description_html") %>

    <%#= render "admin/settings/settings_table", settings: @settings %> diff --git a/app/views/admin/wizards/installer/participation_process.html.erb b/app/views/admin/wizards/installer/participation_process.html.erb index e573dc929f8..9db21cd980d 100644 --- a/app/views/admin/wizards/installer/participation_process.html.erb +++ b/app/views/admin/wizards/installer/participation_process.html.erb @@ -4,7 +4,7 @@ next_step: admin_wizards_installer_path(:map) %>
    -
    +

    <%= t("admin.settings.index.process.title") %>

    <%= t("wizard.partecipation_process.description_html") %>

    <% @settings.each do |setting_group| %> diff --git a/app/views/admin/wizards/installer/regional.html.erb b/app/views/admin/wizards/installer/regional.html.erb index 14438624f57..2e18f29c805 100644 --- a/app/views/admin/wizards/installer/regional.html.erb +++ b/app/views/admin/wizards/installer/regional.html.erb @@ -4,7 +4,7 @@ next_step: admin_wizards_installer_path(:finish) %>
    -
    +

    <%= t("wizard.regional.title") %>

    <%= t("wizard.regional.description_html") %>

    <% @settings.each do |setting_group| %> diff --git a/app/views/admin/wizards/installer/smtp.html.erb b/app/views/admin/wizards/installer/smtp.html.erb index b09179c6008..0228508df4c 100644 --- a/app/views/admin/wizards/installer/smtp.html.erb +++ b/app/views/admin/wizards/installer/smtp.html.erb @@ -4,7 +4,7 @@ next_step: admin_wizards_installer_path(:regional) %>
    -
    +

    <%= t("wizard.smtp.title") %>

    <%= t("wizard.smtp.description_html") %>

    <%= render "admin/settings/mixed_settings_table", settings: @settings %> diff --git a/spec/features/admin/wizards/installer_spec.rb b/spec/features/admin/wizards/installer_spec.rb new file mode 100644 index 00000000000..45a6b86419e --- /dev/null +++ b/spec/features/admin/wizards/installer_spec.rb @@ -0,0 +1,124 @@ +require "rails_helper" + +describe "Wizard Installer" do + + before do + @admin = create(:administrator) + login_as(@admin.user) + end + + context "Steps" do + scenario "Initial step" do + visit new_admin_wizards_installer_path + + expect(page).to have_content "Installation Wizard" + expect(page).to have_content "Step 1 of 7" + expect(page).to have_content "Welcome to the Consul installation wizard" + expect(page).to have_content "In this wizard we will carry out step by step all the necessary configuration to be able to customize the application to the needs of your Institution. If you do not have any information requested in the wizard, you will be able to ignore it and modify it in the future in the related Settings Section or from this same Wizard." + expect(page).to have_link("Get Started", href: admin_wizards_installer_path(:general_settings)) + end + + scenario "General Settings Step" do + visit admin_wizards_installer_path(:general_settings) + + expect(page).to have_content "Installation Wizard" + expect(page).to have_content "Step 2 of 7" + expect(page).to have_content "Global settings" + expect(page).to have_content 'In this step you can update some of the most important Global Application Settings. If you want to modify any of them once the Wizard has been carried out, you can go to the "Configuration > Global Configuration" section or by running the Installation Wizard again.' + expect(page).to have_link("Back", href: new_admin_wizards_installer_path) + expect(page).to have_link("Next", href: admin_wizards_installer_path(:participation_process)) + within "#installer-general-settings" do + expect(page).to have_css("table tbody tr", count: 2) + expect(page).to have_content "Site name" + expect(page).to have_content "Minimum age needed to participate" + end + end + + scenario "Participation processes Step" do + visit admin_wizards_installer_path(:participation_process) + + expect(page).to have_content "Installation Wizard" + expect(page).to have_content "Step 3 of 7" + expect(page).to have_content "Participation processes" + expect(page).to have_content 'In this step you can activate/deactivate the participation processes that each Institution decides to use. If you want to modify any of them once the Wizard has been carried out, you can access the "Configuration > Participation Processes" section or by running the Installation Wizard again.' + expect(page).to have_link("Back", href: admin_wizards_installer_path(:general_settings)) + expect(page).to have_link("Next", href: admin_wizards_installer_path(:map)) + within "#installer-participation-process" do + expect(page).to have_css("table tbody tr", count: 5) + expect(page).to have_content "Debates" + expect(page).to have_content "Proposals" + expect(page).to have_content "Number of supports necessary for approval of a Proposal" + expect(page).to have_content "Polls" + expect(page).to have_content "Participatory budgeting" + end + end + + scenario "Map Step" do + visit admin_wizards_installer_path(:map) + + expect(page).to have_content "Installation Wizard" + expect(page).to have_content "Step 4 of 7" + expect(page).to have_content "Map configuration" + expect(page).to have_content 'In this step you will be able to activate/deactivate the geolocation of proposals and spending projects, and customize the way the map is shown to users. If you want to modify any of them once the Wizard has been carried out, you can access the "Configuration > Map Configuration" section or run the Installation Wizard again.' + expect(page).to have_link("Back", href: admin_wizards_installer_path(:participation_process)) + expect(page).to have_link("Next", href: admin_wizards_installer_path(:smtp)) + within "#installer-map" do + expect(page).to have_css("table tbody tr", count: 4) + expect(page).to have_content "Proposals and budget investments geolocation" + expect(page).to have_content "Latitude" + expect(page).to have_content "Longitude" + expect(page).to have_content "Zoom" + end + end + + scenario "Smtp Step" do + visit admin_wizards_installer_path(:smtp) + + expect(page).to have_content "Installation Wizard" + expect(page).to have_content "Step 5 of 7" + expect(page).to have_content "SMTP Connection" + expect(page).to have_content 'In this step you will be able to configure the SMTP connection to be able to send mails from the application. If you want to modify any of them once the Wizard has been carried out, you will be able to access the section "Configuration > SMTP Connection" or by running the Installation Wizard again.' + expect(page).to have_link("Back", href: admin_wizards_installer_path(:map)) + expect(page).to have_link("Next", href: admin_wizards_installer_path(:regional)) + within "#installer-smtp" do + expect(page).to have_css("table tbody tr", count: 8) + expect(page).to have_content "SMTP Configuration" + expect(page).to have_content "SMTP Host" + expect(page).to have_content "SMTP Port" + expect(page).to have_content "Domain" + expect(page).to have_content "SMTP User" + expect(page).to have_content "SMTP Password" + expect(page).to have_content "SMTP Authentication" + expect(page).to have_content "Enable SMTP TLS" + end + end + + scenario "Regional Step" do + visit admin_wizards_installer_path(:regional) + + expect(page).to have_content "Installation Wizard" + expect(page).to have_content "Step 6 of 7" + expect(page).to have_content "Languages and Time Zone" + expect(page).to have_content 'In this step you can set the default language of the application, the available languages and the time zone you are in. If you want to modify any of them once the Wizard has been carried out, you can go to the "Configuration > Regional Settings" section or by running the Installation Wizard again.' + expect(page).to have_link("Back", href: admin_wizards_installer_path(:smtp)) + expect(page).to have_link("Next", href: admin_wizards_installer_path(:finish)) + within "#installer-regional" do + expect(page).to have_css("table tbody tr", count: 29) + expect(page).to have_content "Application default locale" + expect(page).to have_content "Application available locales" + expect(page).to have_content "Time Zone" + end + end + + scenario "Finish Step" do + visit admin_wizards_installer_path(:finish) + + expect(page).to have_content "Installation Wizard" + expect(page).to have_content "Step 7 of 7" + expect(page).to have_content "Assistant successfully completed" + expect(page).to have_content 'If you want to modify any data once the Wizard has been carried out, you can modify it in the Configuration section or by running the Installation Wizard again.' + expect(page).to have_link("Back", href: admin_wizards_installer_path(:regional)) + end + end + +end diff --git a/spec/features/admin/wizards_spec.rb b/spec/features/admin/wizards_spec.rb new file mode 100644 index 00000000000..bce4a0f9235 --- /dev/null +++ b/spec/features/admin/wizards_spec.rb @@ -0,0 +1,28 @@ +require "rails_helper" + +describe "Admin Wizards" do + + before do + @admin = create(:administrator) + login_as(@admin.user) + end + + context "Admin sidebar" do + scenario "Display wizard section on admin menu" do + visit admin_root_path + + expect(page).to have_link("Wizard", href: admin_wizards_path) + end + end + + scenario "Index" do + visit admin_wizards_path + + expect(page).to have_content("Wizard") + + expect(page).to have_content("Installation Wizard") + expect(page).to have_content("Through this tool we present you the installation of the system.") + expect(page).to have_link("Configure", href: new_admin_wizards_installer_path) + end + +end From 559456ac5bce69971662eb6ba8a80118c662e135 Mon Sep 17 00:00:00 2001 From: taitus Date: Fri, 27 Sep 2019 19:59:54 +0200 Subject: [PATCH 48/48] Clarify specs --- .../admin/settings/_featured_settings_table.html.erb | 2 +- .../admin/settings/_mixed_settings_table.html.erb | 2 +- app/views/admin/settings/_settings_table.html.erb | 2 +- spec/features/admin/wizards/installer_spec.rb | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/views/admin/settings/_featured_settings_table.html.erb b/app/views/admin/settings/_featured_settings_table.html.erb index f4ba7582300..cc9284b4a1d 100644 --- a/app/views/admin/settings/_featured_settings_table.html.erb +++ b/app/views/admin/settings/_featured_settings_table.html.erb @@ -8,7 +8,7 @@
    <% features.each do |feature| %> - + <% settings.each do |setting| %> - + <% settings.each do |setting| %> - +
    <%= t("settings.#{feature.key}") %>
    diff --git a/app/views/admin/settings/_mixed_settings_table.html.erb b/app/views/admin/settings/_mixed_settings_table.html.erb index 0ba37d465d4..fa02a09883e 100644 --- a/app/views/admin/settings/_mixed_settings_table.html.erb +++ b/app/views/admin/settings/_mixed_settings_table.html.erb @@ -8,7 +8,7 @@
    <%= t("settings.#{setting.key}") %>
    diff --git a/app/views/admin/settings/_settings_table.html.erb b/app/views/admin/settings/_settings_table.html.erb index ce99ffe4e17..81af920426f 100644 --- a/app/views/admin/settings/_settings_table.html.erb +++ b/app/views/admin/settings/_settings_table.html.erb @@ -7,7 +7,7 @@
    <%= t("settings.#{setting.key}") %>
    diff --git a/spec/features/admin/wizards/installer_spec.rb b/spec/features/admin/wizards/installer_spec.rb index 45a6b86419e..78bade3b88f 100644 --- a/spec/features/admin/wizards/installer_spec.rb +++ b/spec/features/admin/wizards/installer_spec.rb @@ -28,7 +28,7 @@ expect(page).to have_link("Back", href: new_admin_wizards_installer_path) expect(page).to have_link("Next", href: admin_wizards_installer_path(:participation_process)) within "#installer-general-settings" do - expect(page).to have_css("table tbody tr", count: 2) + expect(page).to have_css(".setting", count: 2) expect(page).to have_content "Site name" expect(page).to have_content "Minimum age needed to participate" end @@ -44,7 +44,7 @@ expect(page).to have_link("Back", href: admin_wizards_installer_path(:general_settings)) expect(page).to have_link("Next", href: admin_wizards_installer_path(:map)) within "#installer-participation-process" do - expect(page).to have_css("table tbody tr", count: 5) + expect(page).to have_css(".setting", count: 5) expect(page).to have_content "Debates" expect(page).to have_content "Proposals" expect(page).to have_content "Number of supports necessary for approval of a Proposal" @@ -63,7 +63,7 @@ expect(page).to have_link("Back", href: admin_wizards_installer_path(:participation_process)) expect(page).to have_link("Next", href: admin_wizards_installer_path(:smtp)) within "#installer-map" do - expect(page).to have_css("table tbody tr", count: 4) + expect(page).to have_css(".setting", count: 4) expect(page).to have_content "Proposals and budget investments geolocation" expect(page).to have_content "Latitude" expect(page).to have_content "Longitude" @@ -81,7 +81,7 @@ expect(page).to have_link("Back", href: admin_wizards_installer_path(:map)) expect(page).to have_link("Next", href: admin_wizards_installer_path(:regional)) within "#installer-smtp" do - expect(page).to have_css("table tbody tr", count: 8) + expect(page).to have_css(".setting", count: 8) expect(page).to have_content "SMTP Configuration" expect(page).to have_content "SMTP Host" expect(page).to have_content "SMTP Port" @@ -103,7 +103,7 @@ expect(page).to have_link("Back", href: admin_wizards_installer_path(:smtp)) expect(page).to have_link("Next", href: admin_wizards_installer_path(:finish)) within "#installer-regional" do - expect(page).to have_css("table tbody tr", count: 29) + expect(page).to have_css(".setting", count: 29) expect(page).to have_content "Application default locale" expect(page).to have_content "Application available locales" expect(page).to have_content "Time Zone"