diff --git a/app/views/admin/budget_investments/show.html.erb b/app/views/admin/budget_investments/show.html.erb index d7f905080..f9e7dc88e 100644 --- a/app/views/admin/budget_investments/show.html.erb +++ b/app/views/admin/budget_investments/show.html.erb @@ -1,5 +1,6 @@ -<%= link_to admin_budget_budget_investments_path(Budget::Investment.filter_params(params)), data: {no_turbolink: true} do %> - <%= t("shared.back") %> +<%= link_to admin_budget_budget_investments_path(Budget::Investment.filter_params(params)), + class: "back", data: {no_turbolink: true} do %> + <%= t("shared.back") %> <% end %> <%= render 'written_by_author' %> diff --git a/app/views/admin/valuators/index.html.erb b/app/views/admin/valuators/index.html.erb index 902067588..03d3fb885 100644 --- a/app/views/admin/valuators/index.html.erb +++ b/app/views/admin/valuators/index.html.erb @@ -14,7 +14,7 @@ <%= t("admin.valuators.index.email") %> <%= t("admin.valuators.index.description") %> <%= t("admin.valuators.index.group") %> - <%= t("admin.actions.actions") %> + <%= t("admin.actions.actions") %> <% @valuators.each do |valuator| %> diff --git a/app/views/budgets/investments/_form.html.erb b/app/views/budgets/investments/_form.html.erb index c4c49a4aa..9969261b8 100644 --- a/app/views/budgets/investments/_form.html.erb +++ b/app/views/budgets/investments/_form.html.erb @@ -38,7 +38,8 @@ label: t("budgets.investments.form.map_location"), help: t("budgets.investments.form.map_location_instructions"), remove_marker_label: t("budgets.investments.form.map_remove_marker"), - parent_class: "budget_investment" %> + parent_class: "budget_investment", + i18n_namespace: "budgets.investments" %> <% end %> diff --git a/app/views/budgets/investments/_investment.html.erb b/app/views/budgets/investments/_investment.html.erb index 87b3dcc6b..964c8ed56 100644 --- a/app/views/budgets/investments/_investment.html.erb +++ b/app/views/budgets/investments/_investment.html.erb @@ -6,7 +6,8 @@
- <%= image_tag investment.image_url(:thumb), alt: investment.image.title %> + <%= image_tag investment.image_url(:thumb), + alt: investment.image.title.unicode_normalize %>
diff --git a/app/views/budgets/investments/_milestones.html.erb b/app/views/budgets/investments/_milestones.html.erb index eb151a9ab..5fc984808 100644 --- a/app/views/budgets/investments/_milestones.html.erb +++ b/app/views/budgets/investments/_milestones.html.erb @@ -13,11 +13,16 @@
<% if milestone.publication_date.present? %> - <%= t("budgets.investments.show.milestone_publication_date", - publication_date: l(milestone.publication_date.to_date)) %> + + <%= t("budgets.investments.show.milestone_publication_date", + publication_date: l(milestone.publication_date.to_date)) %> + <% end %> - <%= image_tag(milestone.image_url(:large), { alt: milestone.image.title, class: "margin", id: "image_#{milestone.id}" }) if milestone.image.present? %> + <%= image_tag(milestone.image_url(:large), + { alt: milestone.image.title.unicode_normalize, + class: "margin", + id: "image_#{milestone.id}" }) if milestone.image.present? %>

<%= text_with_links milestone.description %>

<% if milestone.documents.present? %>
diff --git a/app/views/map_locations/_form_fields.html.erb b/app/views/map_locations/_form_fields.html.erb index 41423b50d..f09662649 100644 --- a/app/views/map_locations/_form_fields.html.erb +++ b/app/views/map_locations/_form_fields.html.erb @@ -19,12 +19,12 @@
<%= form.label :skip_map do %> - <%= form.check_box :skip_map, - title: t("proposals.form.map_skip_checkbox"), + <%= form.check_box :skip_map, + title: t("#{i18n_namespace}.form.map_skip_checkbox"), label: false, class: 'js-toggle-map' %> - <%= t("proposals.form.map_skip_checkbox") %> + <%= t("#{i18n_namespace}.form.map_skip_checkbox") %> <% end %>
diff --git a/app/views/polls/_gallery.html.erb b/app/views/polls/_gallery.html.erb index 4e234f7fc..839d2ef4e 100644 --- a/app/views/polls/_gallery.html.erb +++ b/app/views/polls/_gallery.html.erb @@ -21,9 +21,9 @@ <%= link_to image.attachment.url(:original), target: "_blank" do %> <%= image_tag image.attachment.url(:original), class: "orbit-image", - alt: image.title %> + alt: image.title.unicode_normalize %> <% end %> - <%= image.title %> + <%= image.title.unicode_normalize %> <% end %> @@ -32,7 +32,7 @@ diff --git a/app/views/polls/_poll_group.html.erb b/app/views/polls/_poll_group.html.erb index 3e14b3bf9..7b5148263 100644 --- a/app/views/polls/_poll_group.html.erb +++ b/app/views/polls/_poll_group.html.erb @@ -9,7 +9,7 @@
<% if poll.image.present? %> - <%= image_tag poll.image_url(:large), alt: poll.image.title %> + <%= image_tag poll.image_url(:large), alt: poll.image.title.unicode_normalize %> <% end %>
diff --git a/app/views/polls/index.html.erb b/app/views/polls/index.html.erb index 6877cd31d..7f905491f 100644 --- a/app/views/polls/index.html.erb +++ b/app/views/polls/index.html.erb @@ -9,24 +9,30 @@
<%= render 'shared/filter_subnav', i18n_namespace: "polls.index" %> - <% polls_by_geozone_restriction = @polls.group_by(&:geozone_restricted) %> + <% if @polls.any? %> + <% polls_by_geozone_restriction = @polls.group_by(&:geozone_restricted) %> - <% if polls_by_geozone_restriction[false].present? %> -

- <%= t("polls.index.no_geozone_restricted") %> -

- <%= render partial: 'poll_group', locals: {poll_group: polls_by_geozone_restriction[false]} %> + <% if polls_by_geozone_restriction[false].present? %> +

+ <%= t("polls.index.no_geozone_restricted") %> +

+ <%= render partial: 'poll_group', locals: {poll_group: polls_by_geozone_restriction[false]} %> + <% end %> + + <% if polls_by_geozone_restriction[true].present? %> +

+ <%= t("polls.index.geozone_restricted") %> +

+ <%= render partial: 'poll_group', locals: {poll_group: polls_by_geozone_restriction[true]} %> + <% end %> + + <%= paginate @polls %> + <% else %> +
+ <%= t("polls.index.no_polls") %> +
<% end %> - <% if polls_by_geozone_restriction[true].present? %> -

- <%= t("polls.index.geozone_restricted") %> -

- <%= render partial: 'poll_group', locals: {poll_group: polls_by_geozone_restriction[true]} %> - <% end %> - - <%= paginate @polls %> -

<%= t("polls.index.section_footer.title") %> diff --git a/app/views/polls/results.html.erb b/app/views/polls/results.html.erb index 4373da22d..cafb1c9a9 100644 --- a/app/views/polls/results.html.erb +++ b/app/views/polls/results.html.erb @@ -17,8 +17,8 @@

<%- @poll.questions.each do |question| %> +

<%= question.title %>

-

<%= question.title %>

<%- question.question_answers.each do |answer| %> diff --git a/app/views/proposals/_form.html.erb b/app/views/proposals/_form.html.erb index f60397b17..ae6e329bc 100644 --- a/app/views/proposals/_form.html.erb +++ b/app/views/proposals/_form.html.erb @@ -72,7 +72,8 @@ label: t("proposals.form.map_location"), help: t("proposals.form.map_location_instructions"), remove_marker_label: t("proposals.form.map_remove_marker"), - parent_class: "proposal" %> + parent_class: "proposal", + i18n_namespace: "proposals" %> <% end %> diff --git a/app/views/proposals/_proposal.html.erb b/app/views/proposals/_proposal.html.erb index 9473984bb..27cd38499 100644 --- a/app/views/proposals/_proposal.html.erb +++ b/app/views/proposals/_proposal.html.erb @@ -9,7 +9,8 @@
- <%= image_tag proposal.image_url(:thumb), alt: proposal.image.title %> + <%= image_tag proposal.image_url(:thumb), + alt: proposal.image.title.unicode_normalize %>
diff --git a/config/i18n-tasks.yml b/config/i18n-tasks.yml index 41bf3e604..04adffb48 100644 --- a/config/i18n-tasks.yml +++ b/config/i18n-tasks.yml @@ -176,6 +176,7 @@ ignore_unused: - 'admin.legislation.processes.process.*' - 'legislation.processes.index.*' - 'votes.budget_investments.different_heading_assigned*' + - '*.form.map_skip_checkbox' # - '{devise,kaminari,will_paginate}.*' # - 'simple_form.{yes,no}' # - 'simple_form.{placeholders,hints,labels}.*' diff --git a/config/locales/en/budgets.yml b/config/locales/en/budgets.yml index b50e122a8..f55bafeed 100644 --- a/config/locales/en/budgets.yml +++ b/config/locales/en/budgets.yml @@ -71,6 +71,7 @@ en: map_location_instructions: "Navigate the map to the location and place the marker." map_remove_marker: "Remove map marker" location: "Location additional info" + map_skip_checkbox: "This investment doesn't have a concrete location or I'm not aware of it." index: title: Participatory budgeting unfeasible: Unfeasible investment projects diff --git a/config/locales/en/general.yml b/config/locales/en/general.yml index 1a22db1b1..aa2c0de16 100644 --- a/config/locales/en/general.yml +++ b/config/locales/en/general.yml @@ -487,6 +487,7 @@ en: description: Sign up to vote on citizen proposals and questions the City Council ask to the neighbors. Make municipal decisions directly. help_text_1: "Voting takes place when a citizen proposal supports reaches 1% of the census with voting rights. Voting can also include questions that the City Council ask to the citizens decision." help_text_2: "To participate in the next vote you have to sign up on %{org} and verify your account. All registered voters in the city over 16 years old can vote. The results of all votes are binding on the government." + no_polls: "There are no open votings." show: already_voted_in_booth: "You have already participated in a physical booth. You can not participate again." already_voted_in_web: "You have already participated in this poll. If you vote again it will be overwritten." diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index 6718f6891..37b103923 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -80,11 +80,11 @@ es: edit_groups: Editar grupos de partidas edit_budget: Editar presupuesto create: - notice: '¡Nueva campaña de presupuestos participativos creada con éxito!' + notice: "¡Presupuestos participativos creados con éxito!" update: - notice: Campaña de presupuestos participativos actualizada + notice: Presupuestos participativos actualizados edit: - title: Editar campaña de presupuestos participativos + title: Editar presupuestos participativos delete: Eliminar presupuesto phase: Fase dates: Fechas diff --git a/config/locales/es/budgets.yml b/config/locales/es/budgets.yml index 2bf7cf85a..d02f2380e 100644 --- a/config/locales/es/budgets.yml +++ b/config/locales/es/budgets.yml @@ -71,6 +71,7 @@ es: map_location_instructions: "Navega por el mapa hasta la ubicación y coloca el marcador." map_remove_marker: "Eliminar el marcador" location: "Información adicional de la ubicación" + map_skip_checkbox: "Este proyecto no tiene una ubicación concreta o no la conozco." index: title: Presupuestos participativos unfeasible: Proyectos de gasto no viables diff --git a/config/locales/es/general.yml b/config/locales/es/general.yml index 70a18a2ac..458156352 100644 --- a/config/locales/es/general.yml +++ b/config/locales/es/general.yml @@ -487,6 +487,7 @@ es: description: Regístrate para poder votar propuestas ciudadanas y las cuestiones que pregunta a sus vecinos el Ayuntamiento. Toma decisiones municipales de forma directa. help_text_1: "Las votaciones se convocan cuando una propuesta ciudadana alcanza el 1% de apoyos del censo con derecho a voto. En las votaciones también se pueden incluir cuestiones que el Ayuntamiento somete a decisión directa de la ciudadanía." help_text_2: "Para participar en la próxima votación tienes que registrarte en %{org} y verificar tu cuenta. Pueden votar todas las personas empadronadas en la ciudad mayores de 16 años. Los resultados de todas las votaciones serán vinculantes para el gobierno." + no_polls: "No hay votaciones abiertas." show: already_voted_in_booth: "Ya has participado en esta votación en urnas presenciales, no puedes volver a participar." already_voted_in_web: "Ya has participado en esta votación. Si vuelves a votar se sobreescribirá tu resultado anterior." diff --git a/spec/features/legislation/processes_spec.rb b/spec/features/legislation/processes_spec.rb index 73d1f46d9..0f233a577 100644 --- a/spec/features/legislation/processes_spec.rb +++ b/spec/features/legislation/processes_spec.rb @@ -149,15 +149,30 @@ feature 'Legislation' do visit legislation_process_path(process) - expect(page).to have_content("This phase is not open yet") + expect(page).to have_content("This phase is not open yet") + expect(page).to_not have_content("Participate in the debate") end - scenario 'open' do + scenario 'open without questions' do process = create(:legislation_process, debate_start_date: Date.current - 1.day, debate_end_date: Date.current + 2.days) visit legislation_process_path(process) - expect(page).to have_content("Participate in the debate") + expect(page).to_not have_content("Participate in the debate") + expect(page).to_not have_content("This phase is not open yet") + end + + scenario 'open with questions' do + process = create(:legislation_process, debate_start_date: Date.current - 1.day, debate_end_date: Date.current + 2.days) + create(:legislation_question, process: process, title: "Question 1") + create(:legislation_question, process: process, title: "Question 2") + + visit legislation_process_path(process) + + expect(page).to have_content("Question 1") + expect(page).to have_content("Question 2") + expect(page).to have_content("Participate in the debate") + expect(page).to_not have_content("This phase is not open yet") end include_examples "not published permissions", :debate_legislation_process_path diff --git a/spec/features/polls/polls_spec.rb b/spec/features/polls/polls_spec.rb index c2e8413cf..be6e6ff4e 100644 --- a/spec/features/polls/polls_spec.rb +++ b/spec/features/polls/polls_spec.rb @@ -9,6 +9,9 @@ feature 'Polls' do context '#index' do scenario 'Polls can be listed' do + visit polls_path + expect(page).to have_content('There are no open votings') + polls = create_list(:poll, 3) create(:image, imageable: polls[0]) create(:image, imageable: polls[1])