diff --git a/app/views/admin/banners/_errors.html.erb b/app/views/admin/banners/_errors.html.erb deleted file mode 100644 index 0f3eaa3f4..000000000 --- a/app/views/admin/banners/_errors.html.erb +++ /dev/null @@ -1,15 +0,0 @@ - -<% if @banner.errors.any? %> - -
- - - - <%= @banner.errors.count %> - <%= t("admin.banners.errors.form.error", count: @banner.errors.count) %> - -
- -<% end %> diff --git a/app/views/admin/banners/_form.html.erb b/app/views/admin/banners/_form.html.erb index 0cff16cc0..a3589c90e 100644 --- a/app/views/admin/banners/_form.html.erb +++ b/app/views/admin/banners/_form.html.erb @@ -2,7 +2,7 @@ <%= translatable_form_for [:admin, @banner] do |f| %> - <%= render "errors" %> + <%= render "shared/errors", resource: @banner %>
<% date_started_at = @banner.post_started_at.present? ? I18n.localize(@banner.post_started_at) : "" %> diff --git a/app/views/admin/geozones/_errors.html.erb b/app/views/admin/geozones/_errors.html.erb deleted file mode 100644 index f7f57756c..000000000 --- a/app/views/admin/geozones/_errors.html.erb +++ /dev/null @@ -1,14 +0,0 @@ -<% if @geozone.errors.any? %> - -
- - - - <%= @geozone.errors.count %> - <%= t("admin.geozones.errors.form.error", count: @geozone.errors.count) %> - -
- -<% end %> diff --git a/app/views/admin/geozones/_form.html.erb b/app/views/admin/geozones/_form.html.erb index 516ce7ef1..97eaed50e 100644 --- a/app/views/admin/geozones/_form.html.erb +++ b/app/views/admin/geozones/_form.html.erb @@ -1,6 +1,6 @@ <%= form_for [:admin, @geozone] do |f| %> - <%= render "errors" %> + <%= render "shared/errors", resource: @geozone %>
<%= f.text_field :name %> diff --git a/app/views/admin/legislation/draft_versions/_form.html.erb b/app/views/admin/legislation/draft_versions/_form.html.erb index a3997775e..3d500214c 100644 --- a/app/views/admin/legislation/draft_versions/_form.html.erb +++ b/app/views/admin/legislation/draft_versions/_form.html.erb @@ -2,18 +2,7 @@ <%= translatable_form_for [:admin, @process, @draft_version], url: url, html: { data: { watch_changes: true }} do |f| %> - <% if @draft_version.errors.any? %> -
- - - - <%= @draft_version.errors.count %> - <%= t("admin.legislation.draft_versions.errors.form.error", count: @draft_version.errors.count) %> - -
- <% end %> + <%= render "shared/errors", resource: @draft_version %>
<%= f.translatable_fields do |translations_form| %> diff --git a/app/views/admin/legislation/processes/_form.html.erb b/app/views/admin/legislation/processes/_form.html.erb index a100c2dc9..bbcfc2f8a 100644 --- a/app/views/admin/legislation/processes/_form.html.erb +++ b/app/views/admin/legislation/processes/_form.html.erb @@ -2,20 +2,8 @@ <%= translatable_form_for [:admin, @process], html: { data: { watch_changes: true } } do |f| %> - <% if @process.errors.any? %> + <%= render "shared/errors", resource: @process %> -
- - - - <%= @process.errors.count %> - <%= t("admin.legislation.processes.errors.form.error", count: @process.errors.count) %> - -
- - <% end %>
diff --git a/app/views/admin/legislation/proposals/_form.html.erb b/app/views/admin/legislation/proposals/_form.html.erb index 536521187..3e6ab0f8f 100644 --- a/app/views/admin/legislation/proposals/_form.html.erb +++ b/app/views/admin/legislation/proposals/_form.html.erb @@ -1,19 +1,6 @@ <%= form_for [:admin, @process], html: { data: { watch_changes: true } } do |f| %> - <% if @process.errors.any? %> - -
- - - - <%= @process.errors.count %> - <%= t("admin.legislation.processes.errors.form.error", count: @process.errors.count) %> - -
- - <% end %> + <%= render "shared/errors", resource: @process %>
<%= f.text_field :custom_list, value: @process.tag_list_on(:customs).to_s, diff --git a/app/views/admin/legislation/questions/_form.html.erb b/app/views/admin/legislation/questions/_form.html.erb index 02b2581de..1b43c79ac 100644 --- a/app/views/admin/legislation/questions/_form.html.erb +++ b/app/views/admin/legislation/questions/_form.html.erb @@ -2,20 +2,7 @@ <%= translatable_form_for [:admin, @process, @question], url: url, html: { data: { watch_changes: true } } do |f| %> - <% if @question.errors.any? %> -
-
- - - - <%= @question.errors.count %> - <%= t("admin.legislation.questions.errors.form.error", count: @question.errors.count) %> - -
-
- <% end %> + <%= render "shared/errors", resource: @question %>
<%= f.translatable_fields do |translations_form| %> diff --git a/app/views/admin/site_customization/content_blocks/_form_content_block.html.erb b/app/views/admin/site_customization/content_blocks/_form_content_block.html.erb index 0753b075e..a2bb04c3c 100644 --- a/app/views/admin/site_customization/content_blocks/_form_content_block.html.erb +++ b/app/views/admin/site_customization/content_blocks/_form_content_block.html.erb @@ -1,19 +1,6 @@ <%= form_for [:admin, @content_block], html: { class: "edit_page", data: { watch_changes: true } } do |f| %> - <% if @content_block.errors.any? %> - -
- - - - <%= @content_block.errors.count %> - <%= t("admin.site_customization.content_blocks.errors.form.error", count: @content_block.errors.count) %> - -
- - <% end %> + <%= render "shared/errors", resource: @content_block %>
<%= f.select :name, options_for_select(valid_blocks, @selected_content_block) %> diff --git a/app/views/admin/site_customization/content_blocks/_form_heading_content_block.html.erb b/app/views/admin/site_customization/content_blocks/_form_heading_content_block.html.erb index f05f0c1e9..d3415c053 100644 --- a/app/views/admin/site_customization/content_blocks/_form_heading_content_block.html.erb +++ b/app/views/admin/site_customization/content_blocks/_form_heading_content_block.html.erb @@ -1,15 +1,5 @@ <%= form_tag(admin_site_customization_update_heading_content_block_path(@content_block.id), method: "put") do %> - <% if @content_block.errors.any? %> -
- - - <%= @content_block.errors.count %> - <%= t("admin.site_customization.content_blocks.errors.form.error", count: @content_block.errors.count) %> - -
- <% end %> + <%= render "shared/errors", resource: @content_block %>
<%= label_tag :name %> diff --git a/app/views/admin/site_customization/pages/_form.html.erb b/app/views/admin/site_customization/pages/_form.html.erb index 72be1eacf..6d280087a 100644 --- a/app/views/admin/site_customization/pages/_form.html.erb +++ b/app/views/admin/site_customization/pages/_form.html.erb @@ -1,18 +1,8 @@ <%= render "shared/globalize_locales", resource: @page %> <%= translatable_form_for [:admin, @page], html: { class: "edit_page", data: { watch_changes: true } } do |f| %> - <% if @page.errors.any? %> -
- + <%= render "shared/errors", resource: @page %> - - <%= @page.errors.count %> - <%= t("admin.site_customization.pages.errors.form.error", count: @page.errors.count) %> - -
- <% end %>

diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index 3685fcb64..3f6c1d9c9 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -39,11 +39,6 @@ en: editing: Edit banner form: submit_button: Save changes - errors: - form: - error: - one: "error prevented this banner from being saved" - other: "errors prevented this banner from being saved" new: creating: Create banner activity: @@ -472,9 +467,6 @@ en: edit: back: Back submit_button: Save changes - errors: - form: - error: Error form: enabled: Enabled process: Process @@ -551,9 +543,6 @@ en: back: Back submit_button: Save changes warning: You've edited the text, don't forget to click on Save to permanently save the changes. - errors: - form: - error: Error form: title: 'Editing %{draft_version_title} from the process %{process_title}' launch_text_editor: Launch text editor @@ -595,9 +584,6 @@ en: back: Back title: "Edit “%{question_title}”" submit_button: Save changes - errors: - form: - error: Error form: add_option: Add option title_placeholder: Add question @@ -1329,11 +1315,6 @@ en: code_help: Response code for this geozone on the census API coordinates: Coordinates coordinates_help: Coordinates that will generate a clickable area on an HTML image map - errors: - form: - error: - one: "error prevented this geozone from being saved" - other: "errors prevented this geozone from being saved" edit: form: submit_button: Save changes @@ -1490,9 +1471,6 @@ en: notice: Content block deleted successfully edit: title: Editing content block - errors: - form: - error: Error index: create: Create new content block delete: Delete block @@ -1530,9 +1508,6 @@ en: notice: Page deleted successfully edit: title: Editing %{page_title} - errors: - form: - error: Error form: options: Options index: diff --git a/config/locales/en/general.yml b/config/locales/en/general.yml index 44b7c9358..9a82851a2 100644 --- a/config/locales/en/general.yml +++ b/config/locales/en/general.yml @@ -171,11 +171,16 @@ en: errors: errors not_saved: "prevented this %{resource} from being saved.
Please check the marked fields to know how to correct them:" policy: Privacy Policy + banner: banner proposal: Proposal proposal_notification: "Notification" budget/investment: Investment budget/group: Budget Group budget/heading: Budget Heading + geozone: geozone + legislation/draft_version: draft + legislation/process: process + legislation/question: question poll/shift: Shift poll/question/answer: Answer user: Account @@ -186,6 +191,8 @@ en: image: Image local_census_record: Local Census Record local_census_records/import: Local Census Records Import + site_customization/content_block: content block + site_customization/page: page geozones: none: All city layouts: diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index 48ce63edf..f121f2169 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -39,11 +39,6 @@ es: editing: Editar el banner form: submit_button: Guardar cambios - errors: - form: - error: - one: "error impidió guardar el banner" - other: "errores impidieron guardar el banner." new: creating: Crear banner activity: @@ -472,9 +467,6 @@ es: edit: back: Volver submit_button: Guardar cambios - errors: - form: - error: Error form: enabled: Habilitado process: Proceso @@ -550,9 +542,6 @@ es: back: Volver submit_button: Guardar cambios warning: Ojo, has editado el texto. Para conservar de forma permanente los cambios, no te olvides de hacer click en Guardar. - errors: - form: - error: Error form: title: 'Editando %{draft_version_title} del proceso %{process_title}' launch_text_editor: Lanzar editor de texto @@ -594,9 +583,6 @@ es: back: Volver title: "Editar “%{question_title}”" submit_button: Guardar cambios - errors: - form: - error: Error form: add_option: Añadir respuesta cerrada title_placeholder: Escribe un título a la pregunta @@ -1328,11 +1314,6 @@ es: code_help: Código de respuesta para esta zona en la API del censo coordinates: Coordenadas coordinates_help: Coordenadas que generarán una zona clicable en un mapa de imagen HTML - errors: - form: - error: - one: "error impidió guardar la zona." - other: "errores impidieron guardar la zona." edit: form: submit_button: Guardar cambios @@ -1489,9 +1470,6 @@ es: notice: Bloque borrado correctamente edit: title: Editar bloque - errors: - form: - error: Error index: create: Crear nuevo bloque delete: Borrar bloque @@ -1529,9 +1507,6 @@ es: notice: Página eliminada correctamente edit: title: Editar %{page_title} - errors: - form: - error: Error form: options: Opciones index: diff --git a/config/locales/es/general.yml b/config/locales/es/general.yml index 791d98cb1..e91ce5a6d 100644 --- a/config/locales/es/general.yml +++ b/config/locales/es/general.yml @@ -171,11 +171,16 @@ es: errors: errores not_saved: "impidieron guardar %{resource}.
Por favor revisa los campos marcados para saber cómo corregirlos:" policy: Política de privacidad + banner: el banner proposal: la propuesta proposal_notification: "la notificación" budget/investment: el proyecto de gasto budget/group: el grupo de partidas presupuestarias budget/heading: la partida presupuestaria + geozone: la zona + legislation/draft_version: el borrador + legislation/process: el proceso + legislation/question: la pregunta poll/shift: el turno poll/question/answer: la respuesta user: la cuenta @@ -186,6 +191,8 @@ es: image: Imagen local_census_record: el registro del censo local local_census_records/import: la importación de registros del censo local + site_customization/content_block: el bloque + site_customization/page: la página geozones: none: Toda la ciudad layouts: