From 61450cb48f4ba3850920cab306d4171851163450 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Sun, 15 Jan 2017 13:51:45 +0100 Subject: [PATCH 1/3] adds social share buttons on investments show --- .../investments/_investment_show.html.erb | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/app/views/budgets/investments/_investment_show.html.erb b/app/views/budgets/investments/_investment_show.html.erb index 12f23fe87..707bfbd90 100644 --- a/app/views/budgets/investments/_investment_show.html.erb +++ b/app/views/budgets/investments/_investment_show.html.erb @@ -53,8 +53,8 @@ <% end %> - <% if investment.should_show_aside? %> - From 1de39edf92f807b39d619987cf75feb3fa60df15 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Sun, 15 Jan 2017 13:52:09 +0100 Subject: [PATCH 2/3] adds styles and i18n for mailer budget investment created --- .../mailer/budget_investment_created.html.erb | 48 ++++++++++++++----- config/locales/mailers.en.yml | 10 +++- config/locales/mailers.es.yml | 10 +++- 3 files changed, 55 insertions(+), 13 deletions(-) diff --git a/app/views/mailer/budget_investment_created.html.erb b/app/views/mailer/budget_investment_created.html.erb index ba3674d0d..59af63dd1 100644 --- a/app/views/mailer/budget_investment_created.html.erb +++ b/app/views/mailer/budget_investment_created.html.erb @@ -1,16 +1,42 @@ -Hola <%= @investment.author.name %> + -Muchas gracias por crear tu proyecto <%= @investment.title %> para los Presupuestos Participativos de <%= @investment.budget.name %> de Madrid. +

+ <%= t("mailers.budget_investment_created.title") %> +

-Te informaremos de cómo avanza el proceso, que también puedes seguir en -<%= link_to budgets_url, budgets_url %> +

+ <%= t("mailers.budget_investment_created.intro_html", + author: @investment.author.name).html_safe %> +

-Atentamente, +

+ <%= t("mailers.budget_investment_created.text_html", + investment: @investment.title, + budget: @investment.budget.name).html_safe %> +

-Área de Participación Ciudadana, Transparencia -y Gobierno Abierto del Ayuntamiento de Madrid +

+ <%= t("mailers.budget_investment_created.follow_html", + link: link_to(t("mailers.budget_investment_created.follow_link"), budgets_url)).html_safe %> +

- \ No newline at end of file + + + + + + +
+ <%= link_to budget_investment_url(@investment.budget, @investment, anchor: "social-share"), style: "font-family: 'Open Sans','Helvetica Neue',arial,sans-serif; background: #f7f5f2; border-radius: 6px; color: #3d3d66!important; font-weight: bold; margin: 0px; padding: 10px 15px; text-align: center; text-decoration: none; min-width: 160px; display: inline-block;" do %> + <%= image_tag('icon_mailer_share.png', style: "border: 0; display: inline-block; width: 100%; max-width: 16px", alt: "") %> + <%= t('mailers.budget_investment_created.share') %> + <% end %> +
+ +

+ <%= t("mailers.budget_investment_created.sincerely") %> +
+ + <%= t("mailers.budget_investment_created.signatory") %> + +

diff --git a/config/locales/mailers.en.yml b/config/locales/mailers.en.yml index 34578d739..579dff5d1 100755 --- a/config/locales/mailers.en.yml +++ b/config/locales/mailers.en.yml @@ -64,7 +64,15 @@ en: button: Complete registration subject: "Invitation to %{org_name}" budget_investment_created: - subject: "Thank you for creating a proposal!" + subject: "Thank you for creating an investment!" + title: "Thank you for creating an investment!" + intro_html: "Hi %{author}," + text_html: "Thank you for creating your investment %{investment} for Participatory Budgets %{budget}." + follow_html: "We will inform you about how the process progresses, which you can also follow on %{link}." + follow_link: "Participatory Budgets" + sincerely: "Sincerely," + signatory: "DEPARTMENT OF PUBLIC PARTICIPATION" + share: "Comparte tu proyecto" budget_investment_unfeasible: hi: "Dear user," new_html: "For all these, we invite you to elaborate a new proposal that ajusts to the conditions of this process. You can do it following this link: %{url}." diff --git a/config/locales/mailers.es.yml b/config/locales/mailers.es.yml index f17240c85..108e50917 100644 --- a/config/locales/mailers.es.yml +++ b/config/locales/mailers.es.yml @@ -54,7 +54,15 @@ es: button: Completar registro subject: "Invitación a %{org_name}" budget_investment_created: - subject: "¡Gracias por crear una propuesta!" + subject: "¡Gracias por crear un proyecto!" + title: "¡Gracias por crear un proyecto!" + intro_html: "Hola %{author}," + text_html: "Muchas gracias por crear tu proyecto %{investment} para los Presupuestos Participativos %{budget}." + follow_html: "Te informaremos de cómo avanza el proceso, que también puedes seguir en la página de %{link}." + follow_link: "Presupuestos participativos" + sincerely: "Atentamente," + signatory: "DIRECCIÓN GENERAL DE PARTICIPACIÓN CIUDADANA" + share: "Comparte tu proyecto" budget_investment_unfeasible: hi: "Estimado usuario," new_html: "Por todo ello, te invitamos a que elabores una nueva propuesta que se ajuste a las condiciones de este proceso. Esto lo puedes hacer en este enlace: %{url}." From 9741ee859a99e8ce41242df217053c1f85580a38 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Sun, 15 Jan 2017 14:02:08 +0100 Subject: [PATCH 3/3] updates i18n and specs --- config/locales/mailers.en.yml | 6 +++--- config/locales/mailers.es.yml | 6 +++--- spec/features/emails_spec.rb | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config/locales/mailers.en.yml b/config/locales/mailers.en.yml index 579dff5d1..49143f354 100755 --- a/config/locales/mailers.en.yml +++ b/config/locales/mailers.en.yml @@ -75,11 +75,11 @@ en: share: "Comparte tu proyecto" budget_investment_unfeasible: hi: "Dear user," - new_html: "For all these, we invite you to elaborate a new proposal that ajusts to the conditions of this process. You can do it following this link: %{url}." + new_html: "For all these, we invite you to elaborate a new investment that ajusts to the conditions of this process. You can do it following this link: %{url}." new_href: "new investment project" - reconsider_html: "If you believe that the rejected proposal meets the requirements to be an investment proposal, you can communicate this, within 48 hours, responding to the email address examples@consul.es. Including the code %{code} in the subject of the email." + reconsider_html: "If you believe that the rejected investment meets the requirements to be an investment project, you can communicate this, within 48 hours, responding to the email address examples@consul.es. Including the code %{code} in the subject of the email." sincerely: "Sincerely" signatory: "DEPARTMENT OF PUBLIC PARTICIPATION" sorry: "Sorry for the inconvenience and we again thank you for your invaluable participation." subject: "Your investment project '%{code}' has been marked as unfeasible" - unfeasible_html: "From the City Council we want to thank you for your participation in the participatory budgets. We regret to inform you that your proposal '%{title}' will be excluded from this participatory process for the following reason:" \ No newline at end of file + unfeasible_html: "From the City Council we want to thank you for your participation in the participatory budgets. We regret to inform you that your investment '%{title}' will be excluded from this participatory process for the following reason:" \ No newline at end of file diff --git a/config/locales/mailers.es.yml b/config/locales/mailers.es.yml index 108e50917..82a03d8de 100644 --- a/config/locales/mailers.es.yml +++ b/config/locales/mailers.es.yml @@ -65,11 +65,11 @@ es: share: "Comparte tu proyecto" budget_investment_unfeasible: hi: "Estimado usuario," - new_html: "Por todo ello, te invitamos a que elabores una nueva propuesta que se ajuste a las condiciones de este proceso. Esto lo puedes hacer en este enlace: %{url}." + new_html: "Por todo ello, te invitamos a que elabores un nuevo proyecto de gasto que se ajuste a las condiciones de este proceso. Esto lo puedes hacer en este enlace: %{url}." new_href: "nueva propuesta de inversión" - reconsider_html: "Si consideras que la propuesta rechazada cumple los requisitos para mantenerla como propuesta de inversión, podrás comunicarlo, en el plazo de 48 horas, al correo example@consul.es, indicando necesariamente para su tramitación el código %{code} como asunto del correo, correspondiente a tu propuesta." + reconsider_html: "Si consideras que el proyecto rechazado cumple los requisitos para mantenerlo como proyecto de gasto, podrás comunicarlo, en el plazo de 48 horas, al correo example@consul.es, indicando necesariamente para su tramitación el código %{code} como asunto del correo, correspondiente a tu proyecto." sincerely: "Atentamente" signatory: "DIRECCIÓN GENERAL DE PARTICIPACIÓN CIUDADANA" sorry: "Sentimos las molestias ocasionadas y volvemos a darte las gracias por tu inestimable participación." subject: "Tu propuesta de inversión '%{code}' ha sido marcada como inviable" - unfeasible_html: "Desde el Ayuntamiento queremos agradecer tu participación en los Presupuestos Participativos. Lamentamos informarte de que tu propuesta '%{title}' quedará excluida de este proceso participativo por el siguiente motivo:" \ No newline at end of file + unfeasible_html: "Desde el Ayuntamiento queremos agradecer tu participación en los Presupuestos Participativos. Lamentamos informarte de que tu proyecto '%{title}' quedará excluido de este proceso participativo por el siguiente motivo:" \ No newline at end of file diff --git a/spec/features/emails_spec.rb b/spec/features/emails_spec.rb index 4a8933648..b3e52370d 100644 --- a/spec/features/emails_spec.rb +++ b/spec/features/emails_spec.rb @@ -288,7 +288,7 @@ feature 'Emails' do email = open_last_email investment = Budget::Investment.last - expect(email).to have_subject("Thank you for creating a proposal!") + expect(email).to have_subject("Thank you for creating an investment!") expect(email).to deliver_to(investment.author.email) expect(email).to have_body_text(author.name) expect(email).to have_body_text(investment.title)