From 82322ee23316727fe0e77bd71fc2859a0c00e4e6 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Fri, 13 Jan 2017 17:38:04 +0100 Subject: [PATCH 1/9] sends budget investment created email --- .../budgets/investments_controller.rb | 1 + app/mailers/mailer.rb | 8 ++++++++ .../mailer/budget_investment_created.html.erb | 16 ++++++++++++++++ config/locales/mailers.en.yml | 4 +++- config/locales/mailers.es.yml | 4 +++- 5 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 app/views/mailer/budget_investment_created.html.erb diff --git a/app/controllers/budgets/investments_controller.rb b/app/controllers/budgets/investments_controller.rb index 235163f2e..704ff8d83 100644 --- a/app/controllers/budgets/investments_controller.rb +++ b/app/controllers/budgets/investments_controller.rb @@ -46,6 +46,7 @@ module Budgets @investment.author = current_user if @investment.save + Mailer.budget_investment_created(@investment).deliver_later redirect_to budget_investment_path(@budget, @investment), notice: t('flash.actions.create.budget_investment') else diff --git a/app/mailers/mailer.rb b/app/mailers/mailer.rb index 25c019857..c5c4ae603 100644 --- a/app/mailers/mailer.rb +++ b/app/mailers/mailer.rb @@ -74,6 +74,14 @@ class Mailer < ApplicationMailer end end + def budget_investment_created(investment) + @investment = investment + + with_user(@investment.author) do + mail(to: @investment.author.email, subject: t('mailers.budget_investment_created.subject')) + end + end + private def with_user(user, &block) diff --git a/app/views/mailer/budget_investment_created.html.erb b/app/views/mailer/budget_investment_created.html.erb new file mode 100644 index 000000000..ba3674d0d --- /dev/null +++ b/app/views/mailer/budget_investment_created.html.erb @@ -0,0 +1,16 @@ +Hola <%= @investment.author.name %> + +Muchas gracias por crear tu proyecto <%= @investment.title %> para los Presupuestos Participativos de <%= @investment.budget.name %> de Madrid. + +Te informaremos de cómo avanza el proceso, que también puedes seguir en +<%= link_to budgets_url, budgets_url %> + +Atentamente, + +Área de Participación Ciudadana, Transparencia +y Gobierno Abierto del Ayuntamiento de Madrid + +
+ <%= social_share_button_tag("#{@investment.title} #{setting['twitter_hashtag']}", + url: budget_investment_url(@investment.budget, @investment)) %> +
\ No newline at end of file diff --git a/config/locales/mailers.en.yml b/config/locales/mailers.en.yml index 3fa63f9ec..0b103b5ea 100755 --- a/config/locales/mailers.en.yml +++ b/config/locales/mailers.en.yml @@ -52,4 +52,6 @@ en: thanks: "Thank you very much." title: "Welcome to %{org}" button: Complete registration - subject: "Invitation to %{org_name}" \ No newline at end of file + subject: "Invitation to %{org_name}" + budget_investment_created: + subject: "Thank you for creating a proposal!" \ No newline at end of file diff --git a/config/locales/mailers.es.yml b/config/locales/mailers.es.yml index 49e3e0796..f35085de0 100644 --- a/config/locales/mailers.es.yml +++ b/config/locales/mailers.es.yml @@ -52,4 +52,6 @@ es: thanks: "Muchas gracias." title: "Bienvenido a %{org}" button: Completar registro - subject: "Invitación a %{org_name}" \ No newline at end of file + subject: "Invitación a %{org_name}" + budget_investment_created: + subject: "¡Gracias por crear una propuesta!" \ No newline at end of file From 11a8086599e449a8055136dd9b4234a14df9aca6 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Sat, 14 Jan 2017 16:12:45 +0100 Subject: [PATCH 2/9] adds specs --- spec/features/emails_spec.rb | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/spec/features/emails_spec.rb b/spec/features/emails_spec.rb index fe6c18774..9dba7aa0d 100644 --- a/spec/features/emails_spec.rb +++ b/spec/features/emails_spec.rb @@ -261,4 +261,39 @@ feature 'Emails' do end + context "Budgets" do + + let(:author) { create(:user, :level_two) } + let(:budget) { create(:budget) } + let(:group) { create(:budget_group, name: "Health", budget: budget) } + let!(:heading) { create(:budget_heading, name: "More hospitals", group: group) } + + scenario "Investment created" do + Setting["feature.budgets"] = true + + login_as(author) + visit new_budget_investment_path(budget_id: budget.id) + + select 'Health: More hospitals', from: 'budget_investment_heading_id' + fill_in 'budget_investment_title', with: 'Build a hospital' + fill_in 'budget_investment_description', with: 'We have lots of people that require medical attention' + fill_in 'budget_investment_external_url', with: 'http://http://hospitalsforallthepeople.com/' + check 'budget_investment_terms_of_service' + + click_button 'Create Investment' + expect(page).to have_content 'Investment created successfully' + + email = open_last_email + investment = Budget::Investment.last + + expect(email).to have_subject("Thank you for creating a proposal!") + expect(email).to deliver_to(investment.author.email) + expect(email).to have_body_text(author.name) + expect(email).to have_body_text(investment.title) + expect(email).to have_body_text(investment.budget.name) + expect(email).to have_body_text(budget_path(budget)) + end + + end + end From 68bf119c18471cc6f11114dfa93adfd2e5ddd082 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Sat, 14 Jan 2017 17:02:33 +0100 Subject: [PATCH 3/9] sends unfeasible budget investment --- .../budget_investments_controller.rb | 5 +++ app/mailers/mailer.rb | 9 +++++ app/models/budget/investment.rb | 11 +++++- .../budget_investment_unfeasible.html.erb | 35 +++++++++++++++++++ ...ble_email_sent_at_to_budget_investments.rb | 5 +++ db/schema.rb | 3 +- 6 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 app/views/mailer/budget_investment_unfeasible.html.erb create mode 100644 db/migrate/20170114154421_add_unfeasible_email_sent_at_to_budget_investments.rb diff --git a/app/controllers/valuation/budget_investments_controller.rb b/app/controllers/valuation/budget_investments_controller.rb index 03facadb3..666fac74a 100644 --- a/app/controllers/valuation/budget_investments_controller.rb +++ b/app/controllers/valuation/budget_investments_controller.rb @@ -21,6 +21,11 @@ class Valuation::BudgetInvestmentsController < Valuation::BaseController def valuate if valid_price_params? && @investment.update(valuation_params) + + if @investment.unfeasible_email_pending? + @investment.send_unfeasible_email + end + redirect_to valuation_budget_budget_investment_path(@budget, @investment), notice: t('valuation.budget_investments.notice.valuate') else render action: :edit diff --git a/app/mailers/mailer.rb b/app/mailers/mailer.rb index c5c4ae603..188de029b 100644 --- a/app/mailers/mailer.rb +++ b/app/mailers/mailer.rb @@ -82,6 +82,15 @@ class Mailer < ApplicationMailer end end + def budget_investment_unfeasible(investment) + @investment = investment + @author = investment.author + + with_user(@author) do + mail(to: @author.email, subject: t('mailers.budget_investment_unfeasible.subject', code: @investment.code)) + end + end + private def with_user(user, &block) diff --git a/app/models/budget/investment.rb b/app/models/budget/investment.rb index dd98e472e..4c8816abc 100644 --- a/app/models/budget/investment.rb +++ b/app/models/budget/investment.rb @@ -136,12 +136,21 @@ class Budget unfeasible? && valuation_finished? end + def unfeasible_email_pending? + unfeasible_email_sent_at.blank? && unfeasible? && valuation_finished? + end + def total_votes cached_votes_up + physical_votes end def code - "B#{budget.id}I#{id}" + "#{created_at.strftime('%Y')}-#{id}" + (administrator.present? ? "-A#{administrator.id}" : "") + end + + def send_unfeasible_email + Mailer.budget_investment_unfeasible(self).deliver_later + update(unfeasible_email_sent_at: Time.current) end def reason_for_not_being_selectable_by(user) diff --git a/app/views/mailer/budget_investment_unfeasible.html.erb b/app/views/mailer/budget_investment_unfeasible.html.erb new file mode 100644 index 000000000..3bed46cec --- /dev/null +++ b/app/views/mailer/budget_investment_unfeasible.html.erb @@ -0,0 +1,35 @@ + + +

+ <%= t("mailers.budget_investment_unfeasible.hi") %> +

+ +

+ <%= t("mailers.budget_investment_unfeasible.unfeasible_html", + title: @investment.title) %> +

+ +

+ <%= @investment.unfeasibility_explanation %> +

+ +

+ <%= t("mailers.budget_investment_unfeasible.new_html", + url: link_to(t("mailers.budget_investment_unfeasible.new_href"), + new_budget_investment_url(@investment.budget), style: "color: #2895F1; text-decoration: underline;")) %> +

+ +

+ <%= t("mailers.budget_investment_unfeasible.reconsider_html", code: @investment.code) %> +

+ +

+ <%= t("mailers.budget_investment_unfeasible.sorry") %> +

+ +

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

+ \ No newline at end of file diff --git a/db/migrate/20170114154421_add_unfeasible_email_sent_at_to_budget_investments.rb b/db/migrate/20170114154421_add_unfeasible_email_sent_at_to_budget_investments.rb new file mode 100644 index 000000000..dbd1a203b --- /dev/null +++ b/db/migrate/20170114154421_add_unfeasible_email_sent_at_to_budget_investments.rb @@ -0,0 +1,5 @@ +class AddUnfeasibleEmailSentAtToBudgetInvestments < ActiveRecord::Migration + def change + add_column :budget_investments, :unfeasible_email_sent_at, :datetime + end +end diff --git a/db/schema.rb b/db/schema.rb index 6a9498399..fb563c8db 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20170106130838) do +ActiveRecord::Schema.define(version: 20170114154421) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -143,6 +143,7 @@ ActiveRecord::Schema.define(version: 20170106130838) do t.boolean "selected", default: false t.string "location" t.string "organization_name" + t.datetime "unfeasible_email_sent_at" end add_index "budget_investments", ["administrator_id"], name: "index_budget_investments_on_administrator_id", using: :btree From 79767b5f1de770dff0d6943c501f40432ff81685 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Sat, 14 Jan 2017 17:02:41 +0100 Subject: [PATCH 4/9] adds translations --- config/locales/mailers.en.yml | 22 +++++++++++++++++++++- config/locales/mailers.es.yml | 12 +++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/config/locales/mailers.en.yml b/config/locales/mailers.en.yml index 0b103b5ea..4f8228f46 100755 --- a/config/locales/mailers.en.yml +++ b/config/locales/mailers.en.yml @@ -31,6 +31,16 @@ en: 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:" + 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_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." + 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:" proposal_notification_digest: info: "Here are the new notifications that have been published by authors of the proposals that you have supported in %{org_name}." title: "Proposal notifications in %{org_name}" @@ -54,4 +64,14 @@ en: button: Complete registration subject: "Invitation to %{org_name}" budget_investment_created: - subject: "Thank you for creating a proposal!" \ No newline at end of file + subject: "Thank you for creating a proposal!" + bundget_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_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." + 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 diff --git a/config/locales/mailers.es.yml b/config/locales/mailers.es.yml index f35085de0..f17240c85 100644 --- a/config/locales/mailers.es.yml +++ b/config/locales/mailers.es.yml @@ -54,4 +54,14 @@ es: button: Completar registro subject: "Invitación a %{org_name}" budget_investment_created: - subject: "¡Gracias por crear una propuesta!" \ No newline at end of file + subject: "¡Gracias por crear una propuesta!" + 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_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." + 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 From 7aba8ef299a0967bde246e307eff15e1f2adfaac Mon Sep 17 00:00:00 2001 From: rgarcia Date: Sat, 14 Jan 2017 17:02:45 +0100 Subject: [PATCH 5/9] adds specs --- spec/features/emails_spec.rb | 40 ++++++++++++++++++++++----- spec/models/budget/investment_spec.rb | 27 +++++++++++++++--- 2 files changed, 56 insertions(+), 11 deletions(-) diff --git a/spec/features/emails_spec.rb b/spec/features/emails_spec.rb index 9dba7aa0d..4a8933648 100644 --- a/spec/features/emails_spec.rb +++ b/spec/features/emails_spec.rb @@ -263,14 +263,16 @@ feature 'Emails' do context "Budgets" do - let(:author) { create(:user, :level_two) } - let(:budget) { create(:budget) } - let(:group) { create(:budget_group, name: "Health", budget: budget) } - let!(:heading) { create(:budget_heading, name: "More hospitals", group: group) } + background do + Setting["feature.budgets"] = true + end + + let(:author) { create(:user, :level_two) } + let(:budget) { create(:budget) } + let(:group) { create(:budget_group, name: "Health", budget: budget) } + let!(:heading) { create(:budget_heading, name: "More hospitals", group: group) } scenario "Investment created" do - Setting["feature.budgets"] = true - login_as(author) visit new_budget_investment_path(budget_id: budget.id) @@ -294,6 +296,30 @@ feature 'Emails' do expect(email).to have_body_text(budget_path(budget)) end - end + scenario "Unfeasible investment" do + investment = create(:budget_investment, author: author, budget: budget) + valuator = create(:valuator) + investment.valuators << valuator + + login_as(valuator.user) + visit edit_valuation_budget_budget_investment_path(budget, investment) + + choose 'budget_investment_feasibility_unfeasible' + fill_in 'budget_investment_unfeasibility_explanation', with: 'This is not legal as stated in Article 34.9' + check 'budget_investment_valuation_finished' + click_button 'Save changes' + + expect(page).to have_content "Dossier updated" + investment.reload + + email = open_last_email + expect(email).to have_subject("Your investment project '#{investment.code}' has been marked as unfeasible") + expect(email).to deliver_to(investment.author.email) + expect(email).to have_body_text(investment.title) + expect(email).to have_body_text(investment.code) + expect(email).to have_body_text(investment.unfeasibility_explanation) + end + + end end diff --git a/spec/models/budget/investment_spec.rb b/spec/models/budget/investment_spec.rb index 35839e560..e1814843e 100644 --- a/spec/models/budget/investment_spec.rb +++ b/spec/models/budget/investment_spec.rb @@ -58,10 +58,29 @@ describe Budget::Investment do end describe "#code" do - it "returns the investment and budget id" do - investment = create(:budget_investment) - expect(investment.code).to include("#{investment.id}") - expect(investment.code).to include("#{investment.budget.id}") + let(:investment) { create(:budget_investment) } + + it "returns the proposal id" do + expect(investment.code).to include("#{investment.id}") + end + + it "returns the administrator id when assigned" do + investment.administrator = create(:administrator) + expect(investment.code).to include("#{investment.id}-A#{investment.administrator.id}") + end + end + + describe "#send_unfeasible_email" do + let(:investment) { create(:budget_investment) } + + it "sets the time when the unfeasible email was sent" do + expect(investment.unfeasible_email_sent_at).to_not be + investment.send_unfeasible_email + expect(investment.unfeasible_email_sent_at).to be + end + + it "send an email" do + expect {investment.send_unfeasible_email}.to change { ActionMailer::Base.deliveries.count }.by(1) end end From abd8cd2faf1a51940594c1fc9b1eb36cc57e12f3 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Sat, 14 Jan 2017 17:13:59 +0100 Subject: [PATCH 6/9] fixes translations --- config/locales/mailers.en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/mailers.en.yml b/config/locales/mailers.en.yml index 4f8228f46..34578d739 100755 --- a/config/locales/mailers.en.yml +++ b/config/locales/mailers.en.yml @@ -65,7 +65,7 @@ en: subject: "Invitation to %{org_name}" budget_investment_created: subject: "Thank you for creating a proposal!" - bundget_investment_unfeasible: + 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_href: "new investment project" From 61450cb48f4ba3850920cab306d4171851163450 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Sun, 15 Jan 2017 13:51:45 +0100 Subject: [PATCH 7/9] 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 8/9] 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 9/9] 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)