Merge pull request #3801 from consul/refactor_shared_partial
Use the shared partial to render errors
This commit is contained in:
@@ -1,15 +0,0 @@
|
|||||||
|
|
||||||
<% if @banner.errors.any? %>
|
|
||||||
|
|
||||||
<div id="error_explanation" data-alert class="callout alert" data-closable>
|
|
||||||
<button class="close-button" aria-label="<%= t("application.close") %>" type="button" data-close>
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<strong>
|
|
||||||
<%= @banner.errors.count %>
|
|
||||||
<%= t("admin.banners.errors.form.error", count: @banner.errors.count) %>
|
|
||||||
</strong>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% end %>
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<%= translatable_form_for [:admin, @banner] do |f| %>
|
<%= translatable_form_for [:admin, @banner] do |f| %>
|
||||||
|
|
||||||
<%= render "errors" %>
|
<%= render "shared/errors", resource: @banner %>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<% date_started_at = @banner.post_started_at.present? ? I18n.localize(@banner.post_started_at) : "" %>
|
<% date_started_at = @banner.post_started_at.present? ? I18n.localize(@banner.post_started_at) : "" %>
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
<% if @geozone.errors.any? %>
|
|
||||||
|
|
||||||
<div id="error_explanation" data-alert class="callout alert" data-closable>
|
|
||||||
<button class="close-button" aria-label="<%= t("application.close") %>" type="button" data-close>
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<strong>
|
|
||||||
<%= @geozone.errors.count %>
|
|
||||||
<%= t("admin.geozones.errors.form.error", count: @geozone.errors.count) %>
|
|
||||||
</strong>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% end %>
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<%= form_for [:admin, @geozone] do |f| %>
|
<%= form_for [:admin, @geozone] do |f| %>
|
||||||
|
|
||||||
<%= render "errors" %>
|
<%= render "shared/errors", resource: @geozone %>
|
||||||
|
|
||||||
<div class="small-12 large-8 column">
|
<div class="small-12 large-8 column">
|
||||||
<%= f.text_field :name %>
|
<%= f.text_field :name %>
|
||||||
|
|||||||
@@ -2,18 +2,7 @@
|
|||||||
|
|
||||||
<%= translatable_form_for [:admin, @process, @draft_version], url: url, html: { data: { watch_changes: true }} do |f| %>
|
<%= translatable_form_for [:admin, @process, @draft_version], url: url, html: { data: { watch_changes: true }} do |f| %>
|
||||||
|
|
||||||
<% if @draft_version.errors.any? %>
|
<%= render "shared/errors", resource: @draft_version %>
|
||||||
<div id="error_explanation" data-alert class="callout alert" data-closable>
|
|
||||||
<button class="close-button" aria-label="<%= t("application.close") %>" type="button" data-close>
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<strong>
|
|
||||||
<%= @draft_version.errors.count %>
|
|
||||||
<%= t("admin.legislation.draft_versions.errors.form.error", count: @draft_version.errors.count) %>
|
|
||||||
</strong>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<%= f.translatable_fields do |translations_form| %>
|
<%= f.translatable_fields do |translations_form| %>
|
||||||
|
|||||||
@@ -2,20 +2,8 @@
|
|||||||
|
|
||||||
<%= translatable_form_for [:admin, @process], html: { data: { watch_changes: true } } do |f| %>
|
<%= translatable_form_for [:admin, @process], html: { data: { watch_changes: true } } do |f| %>
|
||||||
|
|
||||||
<% if @process.errors.any? %>
|
<%= render "shared/errors", resource: @process %>
|
||||||
|
|
||||||
<div id="error_explanation" data-alert class="callout alert" data-closable>
|
|
||||||
<button class="close-button" aria-label="<%= t("application.close") %>" type="button" data-close>
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<strong>
|
|
||||||
<%= @process.errors.count %>
|
|
||||||
<%= t("admin.legislation.processes.errors.form.error", count: @process.errors.count) %>
|
|
||||||
</strong>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% end %>
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="small-12 medium-4 column">
|
<div class="small-12 medium-4 column">
|
||||||
<label><%= t("admin.legislation.processes.form.draft_phase") %></label>
|
<label><%= t("admin.legislation.processes.form.draft_phase") %></label>
|
||||||
|
|||||||
@@ -1,19 +1,6 @@
|
|||||||
<%= form_for [:admin, @process], html: { data: { watch_changes: true } } do |f| %>
|
<%= form_for [:admin, @process], html: { data: { watch_changes: true } } do |f| %>
|
||||||
|
|
||||||
<% if @process.errors.any? %>
|
<%= render "shared/errors", resource: @process %>
|
||||||
|
|
||||||
<div id="error_explanation" data-alert class="callout alert" data-closable>
|
|
||||||
<button class="close-button" aria-label="<%= t("application.close") %>" type="button" data-close>
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<strong>
|
|
||||||
<%= @process.errors.count %>
|
|
||||||
<%= t("admin.legislation.processes.errors.form.error", count: @process.errors.count) %>
|
|
||||||
</strong>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<div class="small-12 medium-8 column">
|
<div class="small-12 medium-8 column">
|
||||||
<%= f.text_field :custom_list, value: @process.tag_list_on(:customs).to_s,
|
<%= f.text_field :custom_list, value: @process.tag_list_on(:customs).to_s,
|
||||||
|
|||||||
@@ -2,20 +2,7 @@
|
|||||||
|
|
||||||
<%= translatable_form_for [:admin, @process, @question], url: url, html: { data: { watch_changes: true } } do |f| %>
|
<%= translatable_form_for [:admin, @process, @question], url: url, html: { data: { watch_changes: true } } do |f| %>
|
||||||
|
|
||||||
<% if @question.errors.any? %>
|
<%= render "shared/errors", resource: @question %>
|
||||||
<div class="small-12 medium-9 column">
|
|
||||||
<div id="error_explanation" data-alert class="callout alert" data-closable>
|
|
||||||
<button class="close-button" aria-label="<%= t("application.close") %>" type="button" data-close>
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<strong>
|
|
||||||
<%= @question.errors.count %>
|
|
||||||
<%= t("admin.legislation.questions.errors.form.error", count: @question.errors.count) %>
|
|
||||||
</strong>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<%= f.translatable_fields do |translations_form| %>
|
<%= f.translatable_fields do |translations_form| %>
|
||||||
|
|||||||
@@ -1,19 +1,6 @@
|
|||||||
<%= form_for [:admin, @content_block], html: { class: "edit_page", data: { watch_changes: true } } do |f| %>
|
<%= form_for [:admin, @content_block], html: { class: "edit_page", data: { watch_changes: true } } do |f| %>
|
||||||
|
|
||||||
<% if @content_block.errors.any? %>
|
<%= render "shared/errors", resource: @content_block %>
|
||||||
|
|
||||||
<div id="error_explanation" data-alert class="callout alert" data-closable>
|
|
||||||
<button class="close-button" aria-label="<%= t("application.close") %>" type="button" data-close>
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<strong>
|
|
||||||
<%= @content_block.errors.count %>
|
|
||||||
<%= t("admin.site_customization.content_blocks.errors.form.error", count: @content_block.errors.count) %>
|
|
||||||
</strong>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<div class="small-12 medium-6 column">
|
<div class="small-12 medium-6 column">
|
||||||
<%= f.select :name, options_for_select(valid_blocks, @selected_content_block) %>
|
<%= f.select :name, options_for_select(valid_blocks, @selected_content_block) %>
|
||||||
|
|||||||
@@ -1,15 +1,5 @@
|
|||||||
<%= form_tag(admin_site_customization_update_heading_content_block_path(@content_block.id), method: "put") do %>
|
<%= form_tag(admin_site_customization_update_heading_content_block_path(@content_block.id), method: "put") do %>
|
||||||
<% if @content_block.errors.any? %>
|
<%= render "shared/errors", resource: @content_block %>
|
||||||
<div id="error_explanation" data-alert class="callout alert" data-closable>
|
|
||||||
<button class="close-button" aria-label="<%= t("application.close") %>" type="button" data-close>
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
<strong>
|
|
||||||
<%= @content_block.errors.count %>
|
|
||||||
<%= t("admin.site_customization.content_blocks.errors.form.error", count: @content_block.errors.count) %>
|
|
||||||
</strong>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<div class="small-12 medium-6 column">
|
<div class="small-12 medium-6 column">
|
||||||
<%= label_tag :name %>
|
<%= label_tag :name %>
|
||||||
|
|||||||
@@ -1,18 +1,8 @@
|
|||||||
<%= render "shared/globalize_locales", resource: @page %>
|
<%= render "shared/globalize_locales", resource: @page %>
|
||||||
|
|
||||||
<%= translatable_form_for [:admin, @page], html: { class: "edit_page", data: { watch_changes: true } } do |f| %>
|
<%= translatable_form_for [:admin, @page], html: { class: "edit_page", data: { watch_changes: true } } do |f| %>
|
||||||
<% if @page.errors.any? %>
|
<%= render "shared/errors", resource: @page %>
|
||||||
<div id="error_explanation" data-alert class="callout alert" data-closable>
|
|
||||||
<button class="close-button" aria-label="<%= t("application.close") %>" type="button" data-close>
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<strong>
|
|
||||||
<%= @page.errors.count %>
|
|
||||||
<%= t("admin.site_customization.pages.errors.form.error", count: @page.errors.count) %>
|
|
||||||
</strong>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<hr>
|
<hr>
|
||||||
|
|||||||
@@ -39,11 +39,6 @@ en:
|
|||||||
editing: Edit banner
|
editing: Edit banner
|
||||||
form:
|
form:
|
||||||
submit_button: Save changes
|
submit_button: Save changes
|
||||||
errors:
|
|
||||||
form:
|
|
||||||
error:
|
|
||||||
one: "error prevented this banner from being saved"
|
|
||||||
other: "errors prevented this banner from being saved"
|
|
||||||
new:
|
new:
|
||||||
creating: Create banner
|
creating: Create banner
|
||||||
activity:
|
activity:
|
||||||
@@ -472,9 +467,6 @@ en:
|
|||||||
edit:
|
edit:
|
||||||
back: Back
|
back: Back
|
||||||
submit_button: Save changes
|
submit_button: Save changes
|
||||||
errors:
|
|
||||||
form:
|
|
||||||
error: Error
|
|
||||||
form:
|
form:
|
||||||
enabled: Enabled
|
enabled: Enabled
|
||||||
process: Process
|
process: Process
|
||||||
@@ -551,9 +543,6 @@ en:
|
|||||||
back: Back
|
back: Back
|
||||||
submit_button: Save changes
|
submit_button: Save changes
|
||||||
warning: You've edited the text, don't forget to click on Save to permanently save the changes.
|
warning: You've edited the text, don't forget to click on Save to permanently save the changes.
|
||||||
errors:
|
|
||||||
form:
|
|
||||||
error: Error
|
|
||||||
form:
|
form:
|
||||||
title: 'Editing <span class="strong">%{draft_version_title}</span> from the process <span class="strong">%{process_title}</span>'
|
title: 'Editing <span class="strong">%{draft_version_title}</span> from the process <span class="strong">%{process_title}</span>'
|
||||||
launch_text_editor: Launch text editor
|
launch_text_editor: Launch text editor
|
||||||
@@ -595,9 +584,6 @@ en:
|
|||||||
back: Back
|
back: Back
|
||||||
title: "Edit “%{question_title}”"
|
title: "Edit “%{question_title}”"
|
||||||
submit_button: Save changes
|
submit_button: Save changes
|
||||||
errors:
|
|
||||||
form:
|
|
||||||
error: Error
|
|
||||||
form:
|
form:
|
||||||
add_option: Add option
|
add_option: Add option
|
||||||
title_placeholder: Add question
|
title_placeholder: Add question
|
||||||
@@ -1329,11 +1315,6 @@ en:
|
|||||||
code_help: Response code for this geozone on the census API
|
code_help: Response code for this geozone on the census API
|
||||||
coordinates: Coordinates
|
coordinates: Coordinates
|
||||||
coordinates_help: Coordinates that will generate a clickable area on an HTML image map
|
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:
|
edit:
|
||||||
form:
|
form:
|
||||||
submit_button: Save changes
|
submit_button: Save changes
|
||||||
@@ -1490,9 +1471,6 @@ en:
|
|||||||
notice: Content block deleted successfully
|
notice: Content block deleted successfully
|
||||||
edit:
|
edit:
|
||||||
title: Editing content block
|
title: Editing content block
|
||||||
errors:
|
|
||||||
form:
|
|
||||||
error: Error
|
|
||||||
index:
|
index:
|
||||||
create: Create new content block
|
create: Create new content block
|
||||||
delete: Delete block
|
delete: Delete block
|
||||||
@@ -1530,9 +1508,6 @@ en:
|
|||||||
notice: Page deleted successfully
|
notice: Page deleted successfully
|
||||||
edit:
|
edit:
|
||||||
title: Editing %{page_title}
|
title: Editing %{page_title}
|
||||||
errors:
|
|
||||||
form:
|
|
||||||
error: Error
|
|
||||||
form:
|
form:
|
||||||
options: Options
|
options: Options
|
||||||
index:
|
index:
|
||||||
|
|||||||
@@ -171,11 +171,16 @@ en:
|
|||||||
errors: errors
|
errors: errors
|
||||||
not_saved: "prevented this %{resource} from being saved. <br>Please check the marked fields to know how to correct them:"
|
not_saved: "prevented this %{resource} from being saved. <br>Please check the marked fields to know how to correct them:"
|
||||||
policy: Privacy Policy
|
policy: Privacy Policy
|
||||||
|
banner: banner
|
||||||
proposal: Proposal
|
proposal: Proposal
|
||||||
proposal_notification: "Notification"
|
proposal_notification: "Notification"
|
||||||
budget/investment: Investment
|
budget/investment: Investment
|
||||||
budget/group: Budget Group
|
budget/group: Budget Group
|
||||||
budget/heading: Budget Heading
|
budget/heading: Budget Heading
|
||||||
|
geozone: geozone
|
||||||
|
legislation/draft_version: draft
|
||||||
|
legislation/process: process
|
||||||
|
legislation/question: question
|
||||||
poll/shift: Shift
|
poll/shift: Shift
|
||||||
poll/question/answer: Answer
|
poll/question/answer: Answer
|
||||||
user: Account
|
user: Account
|
||||||
@@ -186,6 +191,8 @@ en:
|
|||||||
image: Image
|
image: Image
|
||||||
local_census_record: Local Census Record
|
local_census_record: Local Census Record
|
||||||
local_census_records/import: Local Census Records Import
|
local_census_records/import: Local Census Records Import
|
||||||
|
site_customization/content_block: content block
|
||||||
|
site_customization/page: page
|
||||||
geozones:
|
geozones:
|
||||||
none: All city
|
none: All city
|
||||||
layouts:
|
layouts:
|
||||||
|
|||||||
@@ -39,11 +39,6 @@ es:
|
|||||||
editing: Editar el banner
|
editing: Editar el banner
|
||||||
form:
|
form:
|
||||||
submit_button: Guardar cambios
|
submit_button: Guardar cambios
|
||||||
errors:
|
|
||||||
form:
|
|
||||||
error:
|
|
||||||
one: "error impidió guardar el banner"
|
|
||||||
other: "errores impidieron guardar el banner."
|
|
||||||
new:
|
new:
|
||||||
creating: Crear banner
|
creating: Crear banner
|
||||||
activity:
|
activity:
|
||||||
@@ -472,9 +467,6 @@ es:
|
|||||||
edit:
|
edit:
|
||||||
back: Volver
|
back: Volver
|
||||||
submit_button: Guardar cambios
|
submit_button: Guardar cambios
|
||||||
errors:
|
|
||||||
form:
|
|
||||||
error: Error
|
|
||||||
form:
|
form:
|
||||||
enabled: Habilitado
|
enabled: Habilitado
|
||||||
process: Proceso
|
process: Proceso
|
||||||
@@ -550,9 +542,6 @@ es:
|
|||||||
back: Volver
|
back: Volver
|
||||||
submit_button: Guardar cambios
|
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.
|
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:
|
form:
|
||||||
title: 'Editando <span class="strong">%{draft_version_title}</span> del proceso <span class="strong">%{process_title}</span>'
|
title: 'Editando <span class="strong">%{draft_version_title}</span> del proceso <span class="strong">%{process_title}</span>'
|
||||||
launch_text_editor: Lanzar editor de texto
|
launch_text_editor: Lanzar editor de texto
|
||||||
@@ -594,9 +583,6 @@ es:
|
|||||||
back: Volver
|
back: Volver
|
||||||
title: "Editar “%{question_title}”"
|
title: "Editar “%{question_title}”"
|
||||||
submit_button: Guardar cambios
|
submit_button: Guardar cambios
|
||||||
errors:
|
|
||||||
form:
|
|
||||||
error: Error
|
|
||||||
form:
|
form:
|
||||||
add_option: Añadir respuesta cerrada
|
add_option: Añadir respuesta cerrada
|
||||||
title_placeholder: Escribe un título a la pregunta
|
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
|
code_help: Código de respuesta para esta zona en la API del censo
|
||||||
coordinates: Coordenadas
|
coordinates: Coordenadas
|
||||||
coordinates_help: Coordenadas que generarán una zona clicable en un mapa de imagen HTML
|
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:
|
edit:
|
||||||
form:
|
form:
|
||||||
submit_button: Guardar cambios
|
submit_button: Guardar cambios
|
||||||
@@ -1489,9 +1470,6 @@ es:
|
|||||||
notice: Bloque borrado correctamente
|
notice: Bloque borrado correctamente
|
||||||
edit:
|
edit:
|
||||||
title: Editar bloque
|
title: Editar bloque
|
||||||
errors:
|
|
||||||
form:
|
|
||||||
error: Error
|
|
||||||
index:
|
index:
|
||||||
create: Crear nuevo bloque
|
create: Crear nuevo bloque
|
||||||
delete: Borrar bloque
|
delete: Borrar bloque
|
||||||
@@ -1529,9 +1507,6 @@ es:
|
|||||||
notice: Página eliminada correctamente
|
notice: Página eliminada correctamente
|
||||||
edit:
|
edit:
|
||||||
title: Editar %{page_title}
|
title: Editar %{page_title}
|
||||||
errors:
|
|
||||||
form:
|
|
||||||
error: Error
|
|
||||||
form:
|
form:
|
||||||
options: Opciones
|
options: Opciones
|
||||||
index:
|
index:
|
||||||
|
|||||||
@@ -171,11 +171,16 @@ es:
|
|||||||
errors: errores
|
errors: errores
|
||||||
not_saved: "impidieron guardar %{resource}. <br>Por favor revisa los campos marcados para saber cómo corregirlos:"
|
not_saved: "impidieron guardar %{resource}. <br>Por favor revisa los campos marcados para saber cómo corregirlos:"
|
||||||
policy: Política de privacidad
|
policy: Política de privacidad
|
||||||
|
banner: el banner
|
||||||
proposal: la propuesta
|
proposal: la propuesta
|
||||||
proposal_notification: "la notificación"
|
proposal_notification: "la notificación"
|
||||||
budget/investment: el proyecto de gasto
|
budget/investment: el proyecto de gasto
|
||||||
budget/group: el grupo de partidas presupuestarias
|
budget/group: el grupo de partidas presupuestarias
|
||||||
budget/heading: la partida presupuestaria
|
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/shift: el turno
|
||||||
poll/question/answer: la respuesta
|
poll/question/answer: la respuesta
|
||||||
user: la cuenta
|
user: la cuenta
|
||||||
@@ -186,6 +191,8 @@ es:
|
|||||||
image: Imagen
|
image: Imagen
|
||||||
local_census_record: el registro del censo local
|
local_census_record: el registro del censo local
|
||||||
local_census_records/import: la importación de registros 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:
|
geozones:
|
||||||
none: Toda la ciudad
|
none: Toda la ciudad
|
||||||
layouts:
|
layouts:
|
||||||
|
|||||||
Reference in New Issue
Block a user