From 57a0aaba9777a3179a155ac2388f128c33bbe39c Mon Sep 17 00:00:00 2001 From: decabeza Date: Wed, 30 May 2018 18:01:40 +0200 Subject: [PATCH 1/5] Reorganizes manager menu and creates helper --- app/helpers/management_helper.rb | 46 ++++++++++ app/views/management/_menu.html.erb | 132 +++++++++++++--------------- 2 files changed, 106 insertions(+), 72 deletions(-) create mode 100644 app/helpers/management_helper.rb diff --git a/app/helpers/management_helper.rb b/app/helpers/management_helper.rb new file mode 100644 index 000000000..05c6552f8 --- /dev/null +++ b/app/helpers/management_helper.rb @@ -0,0 +1,46 @@ +module ManagementHelper + + def menu_users? + ["users", "email_verifications", "document_verifications"].include?(controller_name) + end + + def menu_edit_password_email? + controller_name == "account" && action_name == "edit_password_email" + end + + def menu_edit_password_manually? + controller_name == "account" && action_name == "edit_password_manually" + end + + def menu_create_proposal? + controller_name == "proposals" && action_name == "new" + end + + def menu_support_proposal? + controller_name == "proposals" && action_name == "index" + end + + def menu_print_proposals? + controller_name == "proposals" && action_name == "print" + end + + def menu_create_investments? + (controller_name == "budget_investments" && action_name == "new") || + (controller_name == "budgets" && action_name == "create_investments") + end + + def menu_support_investments? + (controller_name == "budget_investments" && action_name == "index") || + (controller_name == "budgets" && action_name == "support_investments") + end + + def menu_print_investments? + (controller_name == "budget_investments" && action_name == "print") || + (controller_name == "budgets" && action_name == "print_investments") + end + + def menu_user_invites? + controller_name == "user_invites" + end + +end diff --git a/app/views/management/_menu.html.erb b/app/views/management/_menu.html.erb index 9aac8d9a0..452df6e34 100644 --- a/app/views/management/_menu.html.erb +++ b/app/views/management/_menu.html.erb @@ -1,104 +1,92 @@
-
From 3b9b9c5c8f6201ee9a7a35f0200fc07d463fb6df Mon Sep 17 00:00:00 2001 From: decabeza Date: Wed, 30 May 2018 18:02:00 +0200 Subject: [PATCH 2/5] Updates styles for management section --- app/assets/stylesheets/admin.scss | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index 5403551bd..aad328501 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -562,7 +562,7 @@ $sidebar-active: #f4fcd0; .account-info, .login-as { - background-color: #e7e7e7; + background-color: $highlight; border-radius: rem-calc(3); font-size: rem-calc(16); font-weight: normal; @@ -669,6 +669,10 @@ $sidebar-active: #f4fcd0; } } +.management-list { + max-width: rem-calc(1200); +} + // 06. Polls // ----------------- From d936a8348e0f2f8f559757c75f011b4ef8764ede Mon Sep 17 00:00:00 2001 From: decabeza Date: Wed, 30 May 2018 18:02:19 +0200 Subject: [PATCH 3/5] Updates management i18n --- config/locales/en/management.yml | 26 ++++++++++++++++---------- config/locales/es/management.yml | 22 ++++++++++++++-------- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/config/locales/en/management.yml b/config/locales/en/management.yml index 359254e3c..9d1b1046e 100644 --- a/config/locales/en/management.yml +++ b/config/locales/en/management.yml @@ -17,7 +17,7 @@ en: reset_email_send: Email correctly sent. reseted: Password reseted successfully random: Generate random password - save: Save + save: Save password print: Print password print_help: You will be able to print the password when it is saved. account_info: @@ -27,7 +27,7 @@ en: email_label: 'Email:' identified_label: 'Identified as:' username_label: 'Username:' - check: Check + check: Check document dashboard: index: title: Management @@ -66,11 +66,11 @@ en: print_spending_proposals: Print spending proposals support_spending_proposals: Support spending proposals create_budget_investment: Create budget investment - print_budget_investments: Print Budget Investments - support_budget_investments: Support Budget Investments - users: Users - edit_user_accounts: Edit user account + print_budget_investments: Print budget investments + support_budget_investments: Support budget investments + users: Users management user_invites: Send invitations + select_user: Select user permissions: create_proposals: Create proposals debates: Engage in debates @@ -91,10 +91,16 @@ en: create_proposal: Create proposal print: print_button: Print + index: + title: Support proposals budgets: - create_new_investment: Create New Investment - print_investments: Print Budget Investments - support_investments: Support Budget Investments + create_new_investment: Create budget investment + print_investments: Print budget investments + support_investments: Support budget investments + table_name: Name + table_phase: Phase + table_actions: Actions + no_budgets: There are no active participatory budgets. budget_investments: alert: unverified_user: User is not verified @@ -125,7 +131,7 @@ en: username_label: Username users: create_user: Create a new account - create_user_info: 'We will create an account with the following data:' + create_user_info: We will create an account with the following data create_user_submit: Create user create_user_success_html: We have sent an email to the email address %{email} in order to verify that it belongs to this user. It contains a link they have to click. Then they will have to set their access password before being able to log in to the website autogenerated_password_html: "Autogenerated password is %{password}, you can change it in the 'My account' section of the web" diff --git a/config/locales/es/management.yml b/config/locales/es/management.yml index 1fb5f4a37..dbea2a38b 100644 --- a/config/locales/es/management.yml +++ b/config/locales/es/management.yml @@ -17,7 +17,7 @@ es: reset_email_send: Email enviado correctamente. reseted: Contraseña restablecida correctamente random: Generar contraseña aleatoria - save: Guardar + save: Guardar contraseña print: Imprimir contraseña print_help: Podrás imprimir la contraseña cuando se haya guardado. account_info: @@ -27,7 +27,7 @@ es: email_label: 'Email:' identified_label: 'Identificado como:' username_label: 'Usuario:' - check: Comprobar + check: Comprobar documento dashboard: index: title: Gestión @@ -68,9 +68,9 @@ es: create_budget_investment: Crear proyectos de gasto print_budget_investments: Imprimir proyectos de gasto support_budget_investments: Apoyar proyectos de gasto - users: Usuarios - edit_user_accounts: Editar cuenta de usuario + users: Gestión de usuarios user_invites: Enviar invitaciones + select_user: Seleccionar usuario permissions: create_proposals: Crear nuevas propuestas debates: Participar en debates @@ -91,10 +91,16 @@ es: create_proposal: Crear propuesta print: print_button: Imprimir + index: + title: Apoyar propuestas budgets: - create_new_investment: Crear nuevo proyecto - print_investments: Imprimir proyectos - support_investments: Apoyar proyectos + create_new_investment: Crear proyectos de gasto + print_investments: Imprimir proyectos de gasto + support_investments: Apoyar proyectos de gasto + table_name: Nombre + table_phase: Fase + table_actions: Acciones + no_budgets: No hay presupuestos participativos activos. budget_investments: alert: unverified_user: Usuario no verificado @@ -125,7 +131,7 @@ es: username_label: Nombre de usuario users: create_user: Crear nueva cuenta de usuario - create_user_info: 'Procedemos a crear un usuario con la siguiente información:' + create_user_info: Procedemos a crear un usuario con la siguiente información create_user_submit: Crear usuario create_user_success_html: Hemos enviado un correo electrónico a %{email} para verificar que es suya. El correo enviado contiene un link que el usuario deberá pulsar. Entonces podrá seleccionar una clave de acceso, y entrar en la web de participación. autogenerated_password_html: "Se ha asignado la contraseña %{password} a este usuario. Puede modificarla desde el apartado 'Mi cuenta' de la web." From 2e8fe65b3d09a842ffc868807a26754541a291ee Mon Sep 17 00:00:00 2001 From: decabeza Date: Thu, 31 May 2018 18:47:38 +0200 Subject: [PATCH 4/5] Cleans and improves management views layout --- .../admin/shared/_proposal_search.html.erb | 12 +++--- app/views/management/_account_info.html.erb | 9 ++++- .../account/edit_password_manually.html.erb | 23 +++++------ .../budgets/create_investments.html.erb | 40 ++++++++++++++----- .../budgets/investments/new.html.erb | 2 +- .../budgets/print_investments.html.erb | 27 +++++++++---- .../budgets/support_investments.html.erb | 40 ++++++++++++++----- .../document_verifications/index.html.erb | 40 +++++++++---------- .../management/proposals/_proposal.html.erb | 2 +- app/views/management/proposals/index.html.erb | 22 +++++----- app/views/management/proposals/new.html.erb | 2 +- app/views/management/proposals/print.html.erb | 2 +- .../management/user_invites/create.html.erb | 4 +- .../management/user_invites/new.html.erb | 24 +++++------ app/views/management/users/new.html.erb | 16 +++++--- 15 files changed, 158 insertions(+), 107 deletions(-) diff --git a/app/views/admin/shared/_proposal_search.html.erb b/app/views/admin/shared/_proposal_search.html.erb index 895b6ea55..5a6207d4c 100644 --- a/app/views/admin/shared/_proposal_search.html.erb +++ b/app/views/admin/shared/_proposal_search.html.erb @@ -1,10 +1,10 @@ <%= form_for(Proposal.new, url: url, as: :proposal, method: :get) do |f| %> -
-
+
+
<%= text_field_tag :search, "", placeholder: t("admin.shared.proposal_search.placeholder") %> -
-
- <%= f.submit t("admin.shared.proposal_search.button"), class: "button" %> +
+ <%= f.submit t("admin.shared.proposal_search.button"), class: "button" %> +
-<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/management/_account_info.html.erb b/app/views/management/_account_info.html.erb index 20a6bc24d..28f141ba9 100644 --- a/app/views/management/_account_info.html.erb +++ b/app/views/management/_account_info.html.erb @@ -2,11 +2,16 @@