From 663fba53db343044fb91285bb9628bc6728601f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 16 Dec 2020 17:14:07 +0100 Subject: [PATCH] Group admin search label translations together Since there are two different labels/placeholders for poll officers and also two different ones for users, we're only grouping one of each. --- app/views/admin/debates/index.html.erb | 2 +- .../admin/local_census_records/index.html.erb | 2 +- app/views/admin/organizations/index.html.erb | 2 +- app/views/admin/organizations/search.html.erb | 2 +- .../booth_assignments/_search_booths.html.erb | 2 +- app/views/admin/poll/booths/index.html.erb | 2 +- .../_search_officers.html.erb | 2 +- .../admin/poll/questions/_search.html.erb | 2 +- app/views/admin/proposals/index.html.erb | 2 +- app/views/admin/shared/_user_search.html.erb | 2 +- app/views/management/proposals/index.html.erb | 2 +- config/locales/en/admin.yml | 24 +++++++------------ config/locales/es/admin.yml | 24 +++++++------------ 13 files changed, 29 insertions(+), 41 deletions(-) diff --git a/app/views/admin/debates/index.html.erb b/app/views/admin/debates/index.html.erb index 7a743aea1..0d3afd507 100644 --- a/app/views/admin/debates/index.html.erb +++ b/app/views/admin/debates/index.html.erb @@ -5,7 +5,7 @@

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

<% if @debates.any? %> - <%= render Admin::SearchComponent.new(label: t("admin.shared.debate_search.placeholder")) %> + <%= render Admin::SearchComponent.new(label: t("admin.shared.search.label.debates")) %>

<%= page_entries_info @debates %>

diff --git a/app/views/admin/local_census_records/index.html.erb b/app/views/admin/local_census_records/index.html.erb index 5de47ed85..98e698001 100644 --- a/app/views/admin/local_census_records/index.html.erb +++ b/app/views/admin/local_census_records/index.html.erb @@ -9,7 +9,7 @@ class: "button float-right hollow" %> <%= render Admin::SearchComponent.new( - label: t("admin.local_census_records.index.search.placeholder"), + label: t("admin.shared.search.label.local_census_records"), remote: true ) %> diff --git a/app/views/admin/organizations/index.html.erb b/app/views/admin/organizations/index.html.erb index d28ffc42f..fb1dd0a58 100644 --- a/app/views/admin/organizations/index.html.erb +++ b/app/views/admin/organizations/index.html.erb @@ -2,7 +2,7 @@ <%= render Admin::SearchComponent.new( url: search_admin_organizations_path, - label: t("admin.organizations.index.search_placeholder") + label: t("admin.shared.search.label.organizations") ) %> <%= render "shared/filter_subnav", i18n_namespace: "admin.organizations.index" %> diff --git a/app/views/admin/organizations/search.html.erb b/app/views/admin/organizations/search.html.erb index 40a08a7c9..7da60dc2c 100644 --- a/app/views/admin/organizations/search.html.erb +++ b/app/views/admin/organizations/search.html.erb @@ -1,6 +1,6 @@

<%= t("admin.organizations.search.title") %>

-<%= render Admin::SearchComponent.new(label: t("admin.organizations.index.search_placeholder")) %> +<%= render Admin::SearchComponent.new(label: t("admin.shared.search.label.organizations")) %>
<% if @organizations.any? %> diff --git a/app/views/admin/poll/booth_assignments/_search_booths.html.erb b/app/views/admin/poll/booth_assignments/_search_booths.html.erb index adf7ed00d..bbed99f43 100644 --- a/app/views/admin/poll/booth_assignments/_search_booths.html.erb +++ b/app/views/admin/poll/booth_assignments/_search_booths.html.erb @@ -3,7 +3,7 @@
<%= text_field_tag :search, @search, - placeholder: t("admin.shared.booths_search.placeholder"), id: "search-booths" %> + placeholder: t("admin.shared.search.label.booths"), id: "search-booths" %>
<%= submit_tag t("admin.shared.search.search"), class: "button" %>
diff --git a/app/views/admin/poll/booths/index.html.erb b/app/views/admin/poll/booths/index.html.erb index 4954801a2..37937d89e 100644 --- a/app/views/admin/poll/booths/index.html.erb +++ b/app/views/admin/poll/booths/index.html.erb @@ -4,7 +4,7 @@ <%= link_to t("admin.booths.index.add_booth"), new_admin_booth_path, class: "button float-right" %> <% end %> -<%= render Admin::SearchComponent.new(label: t("admin.shared.booths_search.placeholder")) %> +<%= render Admin::SearchComponent.new(label: t("admin.shared.search.label.booths")) %> <% if @booths.empty? %>
diff --git a/app/views/admin/poll/officer_assignments/_search_officers.html.erb b/app/views/admin/poll/officer_assignments/_search_officers.html.erb index b1602dc7e..69f7e2b10 100644 --- a/app/views/admin/poll/officer_assignments/_search_officers.html.erb +++ b/app/views/admin/poll/officer_assignments/_search_officers.html.erb @@ -3,7 +3,7 @@
<%= text_field_tag :search, @search, - placeholder: t("admin.shared.poll_officers_search.placeholder"), id: "search-officers" %> + placeholder: t("admin.shared.search.label.poll_officers"), id: "search-officers" %>
<%= submit_tag t("admin.shared.search.search"), class: "button" %>
diff --git a/app/views/admin/poll/questions/_search.html.erb b/app/views/admin/poll/questions/_search.html.erb index 73730dcd6..6274fbea1 100644 --- a/app/views/admin/poll/questions/_search.html.erb +++ b/app/views/admin/poll/questions/_search.html.erb @@ -1 +1 @@ -<%= render Admin::SearchComponent.new(label: t("admin.shared.poll_questions_search.placeholder")) %> +<%= render Admin::SearchComponent.new(label: t("admin.shared.search.label.poll_questions")) %> diff --git a/app/views/admin/proposals/index.html.erb b/app/views/admin/proposals/index.html.erb index 075e70278..2c62d0c25 100644 --- a/app/views/admin/proposals/index.html.erb +++ b/app/views/admin/proposals/index.html.erb @@ -5,7 +5,7 @@

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

<% if @proposals.any? %> - <%= render Admin::SearchComponent.new(label: t("admin.shared.proposal_search.placeholder")) %> + <%= render Admin::SearchComponent.new(label: t("admin.shared.search.label.proposals")) %>

<%= page_entries_info @proposals %>

diff --git a/app/views/admin/shared/_user_search.html.erb b/app/views/admin/shared/_user_search.html.erb index 2023fd0ed..5a074eb1e 100644 --- a/app/views/admin/shared/_user_search.html.erb +++ b/app/views/admin/shared/_user_search.html.erb @@ -1 +1 @@ -<%= render Admin::SearchComponent.new(url: url, label: t("admin.shared.user_search.placeholder")) %> +<%= render Admin::SearchComponent.new(url: url, label: t("admin.shared.search.label.users")) %> diff --git a/app/views/management/proposals/index.html.erb b/app/views/management/proposals/index.html.erb index a5862961e..549fc8f48 100644 --- a/app/views/management/proposals/index.html.erb +++ b/app/views/management/proposals/index.html.erb @@ -1,7 +1,7 @@

<%= t("management.proposals.index.title") %>

- <%= render Admin::SearchComponent.new(label: t("admin.shared.proposal_search.placeholder")) %> + <%= render Admin::SearchComponent.new(label: t("admin.shared.search.label.proposals")) %>
diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index df6d74990..56b0fc670 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -1169,7 +1169,6 @@ en: no_organizations: There are no organizations. reject: Reject rejected: Rejected - search_placeholder: Name, email or phone number title: Organisations verified: Verified verify: Verify @@ -1254,19 +1253,16 @@ en: true_value: "Yes" false_value: "No" search: + label: + booths: "Search booth by name or location" + debates: "Search debates by title or description" + local_census_records: "Search by document number" + organizations: "Name, email or phone number" + poll_officers: "Search poll officers" + poll_questions: "Search poll questions" + proposals: "Search proposals by title, code, description or question" + users: "Search user by name or email" search: "Search" - booths_search: - placeholder: Search booth by name or location - poll_officers_search: - placeholder: Search poll officers - poll_questions_search: - placeholder: Search poll questions - proposal_search: - placeholder: Search proposals by title, code, description or question - debate_search: - placeholder: Search debates by title or description - user_search: - placeholder: Search user by name or email search_results: "Search results" no_search_results: "No results found." actions: Actions @@ -1572,8 +1568,6 @@ en: document_number: Document number date_of_birth: Date of birth postal_code: Postal code - search: - placeholder: Search by document number import: Import CSV new: creating: Creating new local census record diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index 81ecc1259..8b7fb7788 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -1168,7 +1168,6 @@ es: no_organizations: No hay organizaciones. reject: Rechazar rejected: Rechazada - search_placeholder: Nombre, email o teléfono title: Organizaciones verified: Verificada verify: Verificar @@ -1253,19 +1252,16 @@ es: true_value: "Sí" false_value: "No" search: + label: + booths: "Buscar urna por nombre" + debates: "Buscar debates por título o descripción" + local_census_records: "Búsqueda por número de documento" + organizations: "Nombre, email o teléfono" + poll_officers: "Buscar presidentes de mesa" + poll_questions: "Buscar preguntas" + proposals: "Buscar propuestas por título, código, descripción o pregunta" + users: "Buscar usuario por nombre o email" search: "Buscar" - booths_search: - placeholder: Buscar urna por nombre - poll_officers_search: - placeholder: Buscar presidentes de mesa - poll_questions_search: - placeholder: Buscar preguntas - proposal_search: - placeholder: Buscar propuestas por título, código, descripción o pregunta - debate_search: - placeholder: Buscar debates por título o descripción - user_search: - placeholder: Buscar usuario por nombre o email search_results: "Resultados de la búsqueda" no_search_results: "No se han encontrado resultados." actions: Acciones @@ -1571,8 +1567,6 @@ es: document_number: Número de documento date_of_birth: Fecha de nacimiento postal_code: Código postal - search: - placeholder: Búsqueda por número de documento import: Importar CSV new: creating: Creando nuevo registro de censo local