Use activerecord translations on admin legislation processes

This commit is contained in:
decabeza
2019-03-05 17:43:39 +01:00
parent c9d0411d47
commit 4a532bf807
6 changed files with 23 additions and 45 deletions

View File

@@ -24,7 +24,6 @@
<div class="small-12 medium-3 column">
<%= f.text_field :draft_start_date,
label: t("admin.legislation.processes.form.start"),
value: format_date_for_calendar_form(@process.draft_start_date),
class: "js-calendar-full",
id: "draft_start_date" %>
@@ -32,7 +31,6 @@
<div class="small-12 medium-3 column">
<%= f.text_field :draft_end_date,
label: t("admin.legislation.processes.form.end"),
value: format_date_for_calendar_form(@process.draft_end_date),
class: "js-calendar-full",
id: "draft_end_date" %>
@@ -50,18 +48,14 @@
</div>
<div class="small-12 medium-3 column">
<%= f.label :start_date, t("admin.legislation.processes.form.start") %>
<%= f.text_field :start_date,
label: false,
value: format_date_for_calendar_form(@process.start_date),
class: "js-calendar-full",
id: "start_date" %>
</div>
<div class="small-12 medium-3 column">
<%= f.label :end_date, t("admin.legislation.processes.form.end") %>
<%= f.text_field :end_date,
label: false,
value: format_date_for_calendar_form(@process.end_date),
class: "js-calendar-full",
id: "end_date" %>
@@ -79,18 +73,14 @@
</div>
<div class="small-12 medium-3 column">
<%= f.label :debate_start_date, t("admin.legislation.processes.form.start") %>
<%= f.text_field :debate_start_date,
label: false,
value: format_date_for_calendar_form(@process.debate_start_date),
class: "js-calendar-full",
id: "debate_start_date" %>
</div>
<div class="small-12 medium-3 column">
<%= f.label :debate_end_date, t("admin.legislation.processes.form.end") %>
<%= f.text_field :debate_end_date,
label: false,
value: format_date_for_calendar_form(@process.debate_end_date),
class: "js-calendar-full",
id: "debate_end_date" %>
@@ -108,18 +98,14 @@
</div>
<div class="small-12 medium-3 column">
<%= f.label :proposals_phase_start_date, t("admin.legislation.processes.form.start") %>
<%= f.text_field :proposals_phase_start_date,
label: false,
value: format_date_for_calendar_form(@process.proposals_phase_start_date),
class: "js-calendar-full",
id: "proposals_phase_start_date" %>
</div>
<div class="small-12 medium-3 column">
<%= f.label :proposals_phase_end_date, t("admin.legislation.processes.form.end") %>
<%= f.text_field :proposals_phase_end_date,
label: false,
value: format_date_for_calendar_form(@process.proposals_phase_end_date),
class: "js-calendar-full",
id: "proposals_phase_end_date" %>
@@ -137,18 +123,14 @@
</div>
<div class="small-12 medium-3 column">
<%= f.label :allegations_start_date, t("admin.legislation.processes.form.start") %>
<%= f.text_field :allegations_start_date,
label: false,
value: format_date_for_calendar_form(@process.allegations_start_date),
class: "js-calendar-full",
id: "allegations_start_date" %>
</div>
<div class="small-12 medium-3 column">
<%= f.label :allegations_end_date, t("admin.legislation.processes.form.end") %>
<%= f.text_field :allegations_end_date,
label: false,
value: format_date_for_calendar_form(@process.allegations_end_date),
class: "js-calendar-full",
id: "allegations_end_date" %>
@@ -162,9 +144,7 @@
</div>
<div class="small-12 medium-3 column end">
<%= f.label :draft_publication_date %>
<%= f.text_field :draft_publication_date,
label: false,
value: format_date_for_calendar_form(@process.draft_publication_date),
class: "js-calendar-full",
id: "draft_publication_date" %>
@@ -178,9 +158,7 @@
</div>
<div class="small-12 medium-3 column end">
<%= f.label :result_publication_date %>
<%= f.text_field :result_publication_date,
label: false,
value: format_date_for_calendar_form(@process.result_publication_date),
class: "js-calendar-full",
id: "result_publication_date" %>

View File

@@ -234,15 +234,17 @@ en:
summary: Summary
description: Description
additional_info: Additional info
start_date: Start date
end_date: End date
debate_start_date: Debate start date
debate_end_date: Debate end date
draft_start_date: Draft start date
draft_end_date: Draft end date
start_date: Start
end_date: End
debate_start_date: Start
debate_end_date: End
draft_start_date: Start
draft_end_date: End
draft_publication_date: Draft publication date
allegations_start_date: Allegations start date
allegations_end_date: Allegations end date
allegations_start_date: Start
allegations_end_date: End
proposals_phase_start_date: Start
proposals_phase_end_date: End
result_publication_date: Final result publication date
background_color: Background color
font_color: Font color
@@ -356,7 +358,7 @@ en:
draft_end_date:
invalid_date_range: must be on or after the draft start date
allegations_end_date:
invalid_date_range: must be on or after the allegations start date
invalid_date_range: must be on or after the comments start date
proposal:
attributes:
tag_list:

View File

@@ -423,8 +423,6 @@ en:
draft_phase_description: If this phase is active, the process won't be listed on processes index. Allow to preview the process and create content before the start.
allegations_phase: Comments phase
proposals_phase: Proposals phase
start: Start
end: End
use_markdown: Use Markdown to format the text
title_placeholder: The title of the process
summary_placeholder: Short summary of the description

View File

@@ -234,15 +234,17 @@ es:
summary: Resumen
description: En qué consiste
additional_info: Información adicional
start_date: Fecha de inicio del proceso
end_date: Fecha de fin del proceso
debate_start_date: Fecha de inicio del debate
debate_end_date: Fecha de fin del debate
draft_start_date: Fecha de inicio del borrador
draft_end_date: Fecha de fin del borrador
start_date: Inicio
end_date: Fin
debate_start_date: Inicio
debate_end_date: Fin
draft_start_date: Inicio
draft_end_date: Fin
draft_publication_date: Fecha de publicación del borrador
allegations_start_date: Fecha de inicio de alegaciones
allegations_end_date: Fecha de fin de alegaciones
allegations_start_date: Inicio
allegations_end_date: Fin
proposals_phase_start_date: Inicio
proposals_phase_end_date: Fin
result_publication_date: Fecha de publicación del resultado final
background_color: Color del fondo
font_color: Color del texto
@@ -356,7 +358,7 @@ es:
draft_end_date:
invalid_date_range: tiene que ser igual o posterior a la fecha de inicio del borrador
allegations_end_date:
invalid_date_range: tiene que ser igual o posterior a la fecha de inicio de las alegaciones
invalid_date_range: tiene que ser igual o posterior a la fecha de inicio de los comentarios
proposal:
attributes:
tag_list:

View File

@@ -423,8 +423,6 @@ es:
draft_phase_description: Si esta fase está activa, el proceso no aparecerá en la página de procesos. Permite previsualizar el proceso y crear contenido antes del inicio.
allegations_phase: Fase de comentarios
proposals_phase: Fase de propuestas
start: Inicio
end: Fin
use_markdown: Usa Markdown para formatear el texto
title_placeholder: Escribe el título del proceso
summary_placeholder: Resumen corto de la descripción

View File

@@ -82,7 +82,7 @@ describe Legislation::Process do
allegations_end_date: Date.current - 1.day)
expect(process).to be_invalid
expect(process.errors.messages[:allegations_end_date])
.to include("must be on or after the allegations start date")
.to include("must be on or after the comments start date")
end
it "is valid if allegations_end_date is the same as allegations_start_date" do