From b8b3ce87f33eb4a838570dc04c7b44f9a8d034fe Mon Sep 17 00:00:00 2001 From: decabeza Date: Fri, 22 Dec 2017 18:59:30 +0100 Subject: [PATCH 01/16] fixes label name of group on admin budgets groups --- app/views/admin/budgets/_groups.html.erb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/views/admin/budgets/_groups.html.erb b/app/views/admin/budgets/_groups.html.erb index 537659fec..e98c98334 100644 --- a/app/views/admin/budgets/_groups.html.erb +++ b/app/views/admin/budgets/_groups.html.erb @@ -11,14 +11,15 @@ <% end %> <%= form_for [:admin, @budget, Budget::Group.new], html: {id: "new-group-form", style: "display:none"}, remote: true do |f| %> + + <%= f.label :name, t("admin.budgets.form.group") %> +
- - - <%= f.text_field :name, label: false, maxlength: 50, - placeholder: t("admin.budgets.form.group") %> + placeholder: t("admin.budgets.form.group"), + class: "input-group-field" %>
<%= f.submit t("admin.budgets.form.create_group"), class: "button success" %>
From 6f922621a915c95cfebe1b49c2c3ec03075f42fd Mon Sep 17 00:00:00 2001 From: decabeza Date: Fri, 22 Dec 2017 19:05:24 +0100 Subject: [PATCH 02/16] adds help text for population field on admin budgets groups --- app/views/admin/budgets/_group.html.erb | 6 +++++- config/locales/en/admin.yml | 3 ++- config/locales/es/admin.yml | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/views/admin/budgets/_group.html.erb b/app/views/admin/budgets/_group.html.erb index 3d65730cc..fab722083 100644 --- a/app/views/admin/budgets/_group.html.erb +++ b/app/views/admin/budgets/_group.html.erb @@ -49,12 +49,16 @@
+

+ <%= t("admin.budgets.form.population_help_text") %> +

<%= f.number_field :population, label: false, maxlength: 8, min: 1, placeholder: t("admin.budgets.form.population"), - data: {toggle_focus: "population-info"} %> + data: {toggle_focus: "population-info"}, + aria: {describedby: "budgets-population-help-text"} %>
- - - - - - - - - - - - - <% if params[:filter] == 'selected' %> - - <% end %> - - +<% if @investments.any? %> +

<%= page_entries_info @investments %>

+
<%= t("admin.budget_investments.index.table_id") %><%= t("admin.budget_investments.index.table_title") %><%= t("admin.budget_investments.index.table_supports") %><%= t("admin.budget_investments.index.table_admin") %><%= t("admin.budget_investments.index.table_valuator") %><%= t("admin.budget_investments.index.table_geozone") %><%= t("admin.budget_investments.index.table_feasibility") %><%= t("admin.budget_investments.index.table_valuation_finished") %><%= t("admin.budget_investments.index.table_selection") %><%= t("admin.budget_investments.index.table_incompatible") %>
+ + + + + + + + + + + + <% if params[:filter] == 'selected' %> + + <% end %> + + - <% @investments.each do |investment| %> - - - - - - - - - - - <% if params[:filter] == 'selected' %> - + - <% end %> - - <% end %> -
<%= t("admin.budget_investments.index.table_id") %><%= t("admin.budget_investments.index.table_title") %><%= t("admin.budget_investments.index.table_supports") %><%= t("admin.budget_investments.index.table_admin") %><%= t("admin.budget_investments.index.table_valuator") %><%= t("admin.budget_investments.index.table_geozone") %><%= t("admin.budget_investments.index.table_feasibility") %><%= t("admin.budget_investments.index.table_valuation_finished") %><%= t("admin.budget_investments.index.table_selection") %><%= t("admin.budget_investments.index.table_incompatible") %>
- <%= investment.id %> - - <%= link_to investment.title, - admin_budget_budget_investment_path(budget_id: @budget.id, - id: investment.id, - params: Budget::Investment.filter_params(params)), - target: "_blank" %> - - <%= investment.total_votes %> - - <% if investment.administrator.present? %> - - <%= investment.administrator.name %> - - <% else %> - <%= t("admin.budget_investments.index.no_admin_assigned") %> - <% end %> - - <% if investment.valuators.size == 0 %> - <%= t("admin.budget_investments.index.no_valuators_assigned") %> - <% else %> - <%= investment.valuators.collect(&:description_or_name).join(', ') %> - <% end %> - - <%= investment.heading.name %> - - <%= t("admin.budget_investments.index.feasibility.#{investment.feasibility}", - price: investment.formatted_price) - %> - - <%= investment.valuation_finished? ? t('shared.yes'): t('shared.no') %> - - <% if investment.selected? %> - <%= link_to_unless investment.budget.finished?, - t("admin.budget_investments.index.selected"), - toggle_selection_admin_budget_budget_investment_path(@budget, - investment, - filter: params[:filter], - page: params[:page]), - method: :patch, - remote: true, - class: "button small expanded" %> - <% elsif investment.feasible? && investment.valuation_finished? %> - <%= link_to_unless investment.budget.finished?, - t("admin.budget_investments.index.select"), - toggle_selection_admin_budget_budget_investment_path(@budget, - investment, - filter: params[:filter], - page: params[:page]), - method: :patch, - remote: true, - class: "button small hollow expanded" %> - <% end %> - - <%= investment.incompatible? ? t('shared.yes'): t('shared.no') %> + <% @investments.each do |investment| %> +
+ <%= investment.id %>
+ + <%= link_to investment.title, + admin_budget_budget_investment_path(budget_id: @budget.id, + id: investment.id, + params: Budget::Investment.filter_params(params)) %> + + + <%= investment.total_votes %> + + + <% if investment.administrator.present? %> + + <%= investment.administrator.name %> + + <% else %> + <%= t("admin.budget_investments.index.no_admin_assigned") %> + <% end %> + + + <% if investment.valuators.size == 0 %> + <%= t("admin.budget_investments.index.no_valuators_assigned") %> + <% else %> + <%= investment.valuators.collect(&:description_or_name).join(', ') %> + <% end %> + + + <%= investment.heading.name %> + + + <%= t("admin.budget_investments.index.feasibility.#{investment.feasibility}", + price: investment.formatted_price) + %> + + + <%= investment.valuation_finished? ? t('shared.yes'): t('shared.no') %> + + + <% if investment.selected? %> + <%= link_to_unless investment.budget.finished?, + t("admin.budget_investments.index.selected"), + toggle_selection_admin_budget_budget_investment_path(@budget, + investment, + filter: params[:filter], + page: params[:page]), + method: :patch, + remote: true, + class: "button small expanded" %> + <% elsif investment.feasible? && investment.valuation_finished? %> + <%= link_to_unless investment.budget.finished?, + t("admin.budget_investments.index.select"), + toggle_selection_admin_budget_budget_investment_path(@budget, + investment, + filter: params[:filter], + page: params[:page]), + method: :patch, + remote: true, + class: "button small hollow expanded" %> + <% end %> + + <% if params[:filter] == 'selected' %> + + <%= investment.incompatible? ? t('shared.yes'): t('shared.no') %> + + <% end %> + + <% end %> + -<%= paginate @investments %> + <%= paginate @investments %> +<% else %> +
+ <%= t("admin.budget_investments.index.no_budget_investments") %> +
+<% end %> diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index da02108ff..624c6335a 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -129,6 +129,7 @@ en: selected: Selected winners: Winners all: All + no_budget_investments: "There are no investment projects." title: Investment projects assigned_admin: Assigned administrator no_admin_assigned: No admin assigned diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index 5240b9e5c..2e3ece939 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -130,6 +130,7 @@ es: selected: Seleccionadas winners: Ganadoras all: Todas + no_budget_investments: "No hay proyectos de inversión." title: Proyectos de inversión assigned_admin: Administrador asignado no_admin_assigned: Sin admin asignado From baeef5e1e85379f77ed531091eb95914746267ff Mon Sep 17 00:00:00 2001 From: decabeza Date: Tue, 9 Jan 2018 19:17:25 +0100 Subject: [PATCH 12/16] fixes typo --- app/views/admin/officials/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/officials/index.html.erb b/app/views/admin/officials/index.html.erb index f4cbdd06c..a05ebfecc 100644 --- a/app/views/admin/officials/index.html.erb +++ b/app/views/admin/officials/index.html.erb @@ -37,7 +37,7 @@ <%= paginate @officials %> <% else %> -
+
<%= t("admin.officials.index.no_officials") %>
<% end %> From f4de83da2d49a6cdfd7360b9f8afd0dfeecd93bc Mon Sep 17 00:00:00 2001 From: decabeza Date: Tue, 9 Jan 2018 19:28:04 +0100 Subject: [PATCH 13/16] fixes vertical align on support/price on index list --- app/assets/stylesheets/participation.scss | 8 ++++---- app/views/budgets/investments/_investment.html.erb | 8 +++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss index 0adc7c81f..bc8633ec9 100644 --- a/app/assets/stylesheets/participation.scss +++ b/app/assets/stylesheets/participation.scss @@ -938,10 +938,10 @@ } } -.investment-project .supports .total-supports.no-button, -.investment-project-show .supports .total-supports.no-button, -.budget-investment .supports .total-supports.no-button, -.budget-investment-show .supports .total-supports.no-button { +.investment-project .no-button, +.investment-project-show .no-button, +.budget-investment .no-button, +.budget-investment-show .no-button { display: block; margin-top: $line-height * 1.5; } diff --git a/app/views/budgets/investments/_investment.html.erb b/app/views/budgets/investments/_investment.html.erb index 7b37a9ceb..e999c7f34 100644 --- a/app/views/budgets/investments/_investment.html.erb +++ b/app/views/budgets/investments/_investment.html.erb @@ -90,9 +90,11 @@
> -

- <%= investment.formatted_price %> -

+
+ + <%= investment.formatted_price %> + +
<% else %>
>
From 46666c4b01b84928bb683d7a29caf421b8623665 Mon Sep 17 00:00:00 2001 From: decabeza Date: Tue, 9 Jan 2018 19:39:51 +0100 Subject: [PATCH 14/16] add i18n and fix layout for download current selection --- .../admin/budget_investments/_investments.html.erb | 10 ++++------ config/locales/en/admin.yml | 1 + config/locales/es/admin.yml | 1 + 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/admin/budget_investments/_investments.html.erb b/app/views/admin/budget_investments/_investments.html.erb index 62494a362..a3cc1be10 100644 --- a/app/views/admin/budget_investments/_investments.html.erb +++ b/app/views/admin/budget_investments/_investments.html.erb @@ -1,11 +1,9 @@ -
- <%= link_to t("admin.budget_investments.index.download_current_selection"), - admin_budget_budget_investments_path(csv_params), - class: 'advanced-search small' %> -
+<%= link_to t("admin.budget_investments.index.download_current_selection"), + admin_budget_budget_investments_path(csv_params), + class: "float-right small" %> <% if @investments.any? %> -

<%= page_entries_info @investments %>

+

<%= page_entries_info @investments %>

diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index 624c6335a..67dd4a88a 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -129,6 +129,7 @@ en: selected: Selected winners: Winners all: All + download_current_selection: "Download current selection" no_budget_investments: "There are no investment projects." title: Investment projects assigned_admin: Assigned administrator diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index 2e3ece939..d1a6868e3 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -130,6 +130,7 @@ es: selected: Seleccionadas winners: Ganadoras all: Todas + download_current_selection: "Descargar selección actual" no_budget_investments: "No hay proyectos de inversión." title: Proyectos de inversión assigned_admin: Administrador asignado From 4c272a0e3a4c0a604e97a39346af4108d995b9f9 Mon Sep 17 00:00:00 2001 From: decabeza Date: Wed, 10 Jan 2018 11:36:33 +0100 Subject: [PATCH 15/16] fixes specs --- spec/features/budgets/votes_spec.rb | 10 +++++----- spec/features/management/budget_investments_spec.rb | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/features/budgets/votes_spec.rb b/spec/features/budgets/votes_spec.rb index b8ae564e8..6da622b44 100644 --- a/spec/features/budgets/votes_spec.rb +++ b/spec/features/budgets/votes_spec.rb @@ -26,15 +26,15 @@ feature 'Votes' do within("#budget-investments") do within("#budget_investment_#{investment1.id}_votes") do - expect(page).to have_content "You have already supported this. Share it!" + expect(page).to have_content "You have already supported this investment project. Share it!" end within("#budget_investment_#{investment2.id}_votes") do - expect(page).not_to have_content "You have already supported this. Share it!" + expect(page).not_to have_content "You have already supported this investment project. Share it!" end within("#budget_investment_#{investment3.id}_votes") do - expect(page).not_to have_content "You have already supported this. Share it!" + expect(page).not_to have_content "You have already supported this investment project. Share it!" end end end @@ -48,7 +48,7 @@ feature 'Votes' do find('.in-favor a').click expect(page).to have_content "1 support" - expect(page).to have_content "You have already supported this. Share it!" + expect(page).to have_content "You have already supported this investment project. Share it!" end end end @@ -81,7 +81,7 @@ feature 'Votes' do find('.in-favor a').click expect(page).to have_content "1 support" - expect(page).to have_content "You have already supported this. Share it!" + expect(page).to have_content "You have already supported this investment project. Share it!" end end end diff --git a/spec/features/management/budget_investments_spec.rb b/spec/features/management/budget_investments_spec.rb index 5a9fa2813..f1ced7334 100644 --- a/spec/features/management/budget_investments_spec.rb +++ b/spec/features/management/budget_investments_spec.rb @@ -218,7 +218,7 @@ feature 'Budget Investments' do find('.js-in-favor a').click expect(page).to have_content "1 support" - expect(page).to have_content "You have already supported this. Share it!" + expect(page).to have_content "You have already supported this investment project. Share it!" end end From e819da555631878b9841bfa3067226b70d2f6a22 Mon Sep 17 00:00:00 2001 From: decabeza Date: Wed, 10 Jan 2018 11:37:05 +0100 Subject: [PATCH 16/16] improve i18n for budgets notices --- app/views/admin/budgets/edit.html.erb | 2 +- config/locales/es/admin.yml | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/app/views/admin/budgets/edit.html.erb b/app/views/admin/budgets/edit.html.erb index a0484c865..16a39d3dc 100644 --- a/app/views/admin/budgets/edit.html.erb +++ b/app/views/admin/budgets/edit.html.erb @@ -2,6 +2,6 @@ <%= button_to t("admin.budgets.edit.delete"), admin_budget_path(@budget), method: :delete, class: "button hollow alert float-right small" %> -

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

+

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

<%= render '/admin/budgets/form' %> diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index d1a6868e3..a6fe235cc 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -79,18 +79,17 @@ es: edit_groups: Editar grupos de partidas edit_budget: Editar presupuesto create: - notice: '¡Nueva campaña de presupuestos participativos creada con éxito!' + notice: "¡Nuevo presupuesto creado con éxito!" update: - notice: Campaña de presupuestos participativos actualizada + notice: Presupuesto actualizado edit: - title: Editar campaña de presupuestos participativos - delete: Borrar campaña + title: Editar presupuesto + delete: Eliminar presupuesto destroy: - success_notice: Campaña eliminada correctamente - unable_notice: No se pueden eliminar campañas con presupuestos asociados - + success_notice: Presupuesto eliminado correctamente + unable_notice: No se puede eliminar un presupuesto con proyectos asociados new: - title: Nuevo presupuesto ciudadano + title: Nuevo presupuesto show: groups: one: 1 Grupo de partidas presupuestarias