From cbc89dae8c4956d8c4875b2dccdab4847aa75dba Mon Sep 17 00:00:00 2001 From: decabeza Date: Tue, 19 Mar 2019 17:35:39 +0100 Subject: [PATCH] Replace html_safe to i18n _html --- app/views/dashboard/mailer/forward.html.erb | 2 +- app/views/dashboard/mailing/index.html.erb | 2 +- app/views/dashboard/poster/index.html.erb | 4 +++- app/views/dashboard/poster/index.pdf.erb | 2 +- config/locales/en/general.yml | 10 +++++----- config/locales/es/general.yml | 10 +++++----- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/app/views/dashboard/mailer/forward.html.erb b/app/views/dashboard/mailer/forward.html.erb index 3f6be1250..2d3ef8607 100644 --- a/app/views/dashboard/mailer/forward.html.erb +++ b/app/views/dashboard/mailer/forward.html.erb @@ -8,7 +8,7 @@ <%= image_tag "quote_before_white.png", style: "max-width: 40px; vertical-align: top;" %>

<%= @proposal.title %>

<%= image_tag "quote_after_white.png", style: "max-width: 40px; vertical-align: top;" %> -

<%= t("dashboard.mailer.forward.subtitle").html_safe %>

+

<%= t("dashboard.mailer.forward.subtitle_html") %>

diff --git a/app/views/dashboard/mailing/index.html.erb b/app/views/dashboard/mailing/index.html.erb index 2c5bec1ec..401b8b0a6 100644 --- a/app/views/dashboard/mailing/index.html.erb +++ b/app/views/dashboard/mailing/index.html.erb @@ -5,7 +5,7 @@ <%= image_tag "quote_before_white.png" %>

<%= proposal.title %>

<%= image_tag "quote_after_white.png" %> -

<%= t("dashboard.mailer.forward.subtitle").html_safe %>

+

<%= t("dashboard.mailer.forward.subtitle_html") %>

diff --git a/app/views/dashboard/poster/index.html.erb b/app/views/dashboard/poster/index.html.erb index b0de13868..233238577 100644 --- a/app/views/dashboard/poster/index.html.erb +++ b/app/views/dashboard/poster/index.html.erb @@ -9,7 +9,9 @@ <%= image_tag("finger.png") %> <%= t("dashboard.poster.index.poster_subtitle") %> -

<%= t("dashboard.poster.index.intro_text", org: Setting["org_name"]).html_safe %>

+

+ <%= t("dashboard.poster.index.intro_text_html", org: Setting["org_name"]) %> +

<%= t("dashboard.poster.index.proposal_code", code: proposal.code) %> diff --git a/app/views/dashboard/poster/index.pdf.erb b/app/views/dashboard/poster/index.pdf.erb index 707c3ba31..0176fbd36 100644 --- a/app/views/dashboard/poster/index.pdf.erb +++ b/app/views/dashboard/poster/index.pdf.erb @@ -16,7 +16,7 @@

- <%= t("dashboard.poster.index.intro_text", org: Setting["org_name"]).html_safe %> + <%= t("dashboard.poster.index.intro_text_html", org: Setting["org_name"]) %>

<%= t("dashboard.poster.index.proposal_code", code: proposal.code) %> diff --git a/config/locales/en/general.yml b/config/locales/en/general.yml index 80c8c0120..c5960257f 100644 --- a/config/locales/en/general.yml +++ b/config/locales/en/general.yml @@ -575,12 +575,12 @@ en: title: Poster preview poster_title: "Do not keep looking," poster_subtitle: "back me up! ;)" - intro_text: - I am participating in %{org} with my own citizen proposal and only if you also add you can I achieve the - necessary support to make Madrid the city we all want. + intro_text_html: + "I am participating in %{org} with my own citizen proposal and only if you also add you can I achieve the + necessary support to make the city we all want." proposal_code: "Code of the proposal: %{code}" support: Support my proposal - footer: Visit %{link} and support this proposal. We need to be many. Decide your too. Thank you! + footer_html: "Visit %{link} and support this proposal. We need to be many. Decide your too. Thank you!" new: title: Poster feature options: @@ -598,7 +598,7 @@ en: sent: The email has been sent mailer: forward: - subtitle: If you support me,
we will achieve it. + subtitle_html: "If you support me,
we will achieve it." support_button: Support this proposal share_in: Share in hi: "Hello!" diff --git a/config/locales/es/general.yml b/config/locales/es/general.yml index 0fb3b0b48..9fed1c299 100644 --- a/config/locales/es/general.yml +++ b/config/locales/es/general.yml @@ -575,12 +575,12 @@ es: title: Previsualización del poster poster_title: "No te quedes mirando," poster_subtitle: "¡apóyame! ;)" - intro_text: - Estoy participando en %{org} con mi propia propuesta ciudadana y sólo si tú también te sumas podré lograr el - apoyo necesario para hacer de madrid la ciudad que todos queremos. + intro_text_html: + "Estoy participando en %{org} con mi propia propuesta ciudadana y sólo si tú también te sumas podré lograr el + apoyo necesario para hacer la ciudad que todos queremos." proposal_code: "Código de la propuesta: %{code}" support: Apoya mi propuesta - footer: Entra en %{link} y apoya esta propuesta. Necesitamos ser muchos. Decide tu también. ¡Gracias! + footer_html: "Entra en %{link} y apoya esta propuesta. Necesitamos ser muchos. Decide tu también. ¡Gracias!" new: title: Funcionalidad de póster options: @@ -598,7 +598,7 @@ es: sent: El e-mail ha sido enviado mailer: forward: - subtitle: Si me apoyas,
lo conseguiremos. + subtitle_html: "Si me apoyas,
lo conseguiremos." support_button: Apoyar esta propuesta share_in: Compartir en hi: "¡Hola!"