From 60c1fdcb271fe00a581b2fcebeb11bbc9654bd50 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 15 Jun 2016 16:54:13 +0200 Subject: [PATCH 01/12] Changes text to 'share proposal' --- config/locales/mailers.en.yml | 2 +- config/locales/mailers.es.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/mailers.en.yml b/config/locales/mailers.en.yml index 7270f81ae..6d91c52a1 100755 --- a/config/locales/mailers.en.yml +++ b/config/locales/mailers.en.yml @@ -32,7 +32,7 @@ en: unfeasible_html: "From the Madrid City Council we want to thank you for your participation in the participatory budgets of the city of Madrid. We regret to inform you that your proposal '%{title}' will be excluded from this participatory process for the following reason:" proposal_notification_digest: title: You received the following notifications - share: Share + share: Share proposal comment: Comment proposal direct_message_for_receiver: subject: "You have received a new private message" diff --git a/config/locales/mailers.es.yml b/config/locales/mailers.es.yml index 288fa189e..7593aac43 100644 --- a/config/locales/mailers.es.yml +++ b/config/locales/mailers.es.yml @@ -32,7 +32,7 @@ es: unfeasible_html: "Desde el Ayuntamiento de Madrid queremos agradecer tu participación en los Presupuestos Participativos de la ciudad de Madrid. Lamentamos informarte de que tu propuesta '%{title}' quedará excluida de este proceso participativo por el siguiente motivo:" proposal_notification_digest: title: Has recibido las siguientes notificaciones - share: Compartir + share: Compartir propuesta comment: Comentar propuesta direct_message_for_receiver: subject: "Has recibido un nuevo mensaje privado" From 06596ac4d80a0e56a1e9cbbbb7245ef2b29dd9ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?= Date: Wed, 15 Jun 2016 17:01:50 +0200 Subject: [PATCH 02/12] adds author_of? helper method --- app/helpers/application_helper.rb | 5 +++++ spec/helpers/application_helper_spec.rb | 27 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 spec/helpers/application_helper_spec.rb diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c5f2e6aca..1f52f0eea 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -35,4 +35,9 @@ module ApplicationHelper } Redcarpet::Markdown.new(renderer, extensions).render(text).html_safe end + + def author_of?(authorable, user) + return false if authorable.blank? || user.blank? + authorable.author_id == user.id + end end diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb new file mode 100644 index 000000000..61137912d --- /dev/null +++ b/spec/helpers/application_helper_spec.rb @@ -0,0 +1,27 @@ +require 'rails_helper' + +describe ApplicationHelper do + + describe "#author_of?" do + it "should be true if user is the author" do + user = create(:user) + proposal = create(:proposal, author: user) + expect(author_of?(proposal, user)).to eq true + end + + it "should be false if user is not the author" do + user = create(:user) + proposal = create(:proposal) + expect(author_of?(proposal, user)).to eq false + end + + it "should be false if user or authorable is nil" do + user = create(:user) + proposal = create(:proposal) + + expect(author_of?(nil, user)).to eq false + expect(author_of?(proposal, nil)).to eq false + end + end + +end \ No newline at end of file From e87fda2c8d030c8c8612d8b81a6cda24946fba5f Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 15 Jun 2016 17:03:33 +0200 Subject: [PATCH 03/12] Adds comments anchor on form link --- app/views/proposal_notifications/new.html.erb | 7 +++---- config/locales/en.yml | 2 +- config/locales/es.yml | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/views/proposal_notifications/new.html.erb b/app/views/proposal_notifications/new.html.erb index a5f829ecc..b76f218fe 100644 --- a/app/views/proposal_notifications/new.html.erb +++ b/app/views/proposal_notifications/new.html.erb @@ -7,10 +7,9 @@

<%= t("proposal_notifications.new.info_about_receivers_html", - count: @proposal.voters.count) %> - - <%= link_to t("proposal_notifications.new.proposal_page"), - proposal_path(@proposal) %> + count: @proposal.voters.count, + proposal_page: link_to(t("proposal_notifications.new.proposal_page"), + proposal_path(@proposal, anchor: "comments"))).html_safe %>

diff --git a/config/locales/en.yml b/config/locales/en.yml index e78f9c4d0..1002042d7 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -374,7 +374,7 @@ en: title_label: "Title" body_label: "Message" submit_button: "Send message" - info_about_receivers_html: "This message will be send to %{count} people and it will be visible in " + info_about_receivers_html: "This message will be send to %{count} people and it will be visible in %{proposal_page}." proposal_page: "the proposal's page" show: back: "Go back to my activity" diff --git a/config/locales/es.yml b/config/locales/es.yml index 592bc9213..30d573c37 100755 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -374,7 +374,7 @@ es: title_label: "Título" body_label: "Mensaje" submit_button: "Enviar mensaje" - info_about_receivers_html: "Este mensaje se enviará a %{count} usuarios y se publicará en " + info_about_receivers_html: "Este mensaje se enviará a %{count} usuarios y se publicará en %{proposal_page}." proposal_page: "la página de la propuesta" show: back: "Volver a mi actividad" From 2dc39192b800886a65f0c5b1dfd59c691c2e72f4 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 15 Jun 2016 17:13:44 +0200 Subject: [PATCH 04/12] Adds button to proposal's show to 'Send notification' --- app/assets/stylesheets/layout.scss | 4 ++++ app/views/proposals/show.html.erb | 5 +++++ app/views/users/_proposals.html.erb | 2 +- config/locales/en.yml | 3 ++- config/locales/es.yml | 3 ++- 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index e9a9f1057..9152955dc 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -253,6 +253,10 @@ a { max-width: none; } +.button.float-right ~ .button.float-right { + margin: 0 $line-height/2; +} + // 02. Header // ---------- diff --git a/app/views/proposals/show.html.erb b/app/views/proposals/show.html.erb index 2153b23e5..7bb2a92a6 100644 --- a/app/views/proposals/show.html.erb +++ b/app/views/proposals/show.html.erb @@ -12,6 +12,11 @@
<%= render "shared/back_link" %> + <% if author_of?(@proposal, current_user) %> + <%= link_to t("proposals.show.send_notification"), new_proposal_notification_path(proposal_id: @proposal.id), + class: 'button hollow float-right' %> + <% end %> + <% if current_user && @proposal.editable_by?(current_user) %> <%= link_to edit_proposal_path(@proposal), class: 'edit-proposal button hollow float-right' do %> <%= t("proposals.show.edit_proposal_link") %> diff --git a/app/views/users/_proposals.html.erb b/app/views/users/_proposals.html.erb index a56b096f6..f50045635 100644 --- a/app/views/users/_proposals.html.erb +++ b/app/views/users/_proposals.html.erb @@ -9,7 +9,7 @@ <% if author? %> - <%= link_to t("users.proposals.send_message"), new_proposal_notification_path(proposal_id: proposal.id), + <%= link_to t("users.proposals.send_notification"), new_proposal_notification_path(proposal_id: proposal.id), class: 'button hollow' %> <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 1002042d7..78ac956a7 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -365,6 +365,7 @@ en: retired_warning_link_to_explanation: Read the explanation before voting for it. retired: Proposal retired by the author share: Share + send_notification: Send notification update: form: submit_button: Save changes @@ -535,7 +536,7 @@ en: private_activity: This user decided to keep the activity list private send_private_message: "Send private message" proposals: - send_message: "Send message" + send_notification: "Send notification" retire: "Retire" retired: "Retired" votes: diff --git a/config/locales/es.yml b/config/locales/es.yml index 30d573c37..219a07dee 100755 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -364,6 +364,7 @@ es: retired_warning: "El autor de esta propuesta considera que ya no debe seguir recogiendo apoyos." retired_warning_link_to_explanation: Revisa su explicación antes de apoyarla. retired: Propuesta retirada por el autor + send_notification: Enviar notificación share: Compartir update: form: @@ -535,7 +536,7 @@ es: private_activity: Este usuario ha decidido mantener en privado su lista de actividades send_private_message: "Enviar un mensaje privado" proposals: - send_message: "Enviar mensaje" + send_notification: "Enviar notificación" retire: "Retirar" retired: "Retirada" votes: From f606a3bcbef34931568412945df329bf865d3293 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 15 Jun 2016 17:33:25 +0200 Subject: [PATCH 05/12] Adds link to unsubscribe in digest email --- .../mailer/proposal_notification_digest.html.erb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/views/mailer/proposal_notification_digest.html.erb b/app/views/mailer/proposal_notification_digest.html.erb index 500a0fade..eda614040 100644 --- a/app/views/mailer/proposal_notification_digest.html.erb +++ b/app/views/mailer/proposal_notification_digest.html.erb @@ -50,4 +50,16 @@ <% end %> + + + + + + + + From 0366d7efb25f7a8d5ace7d1ef6e5c2ab7a483571 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 15 Jun 2016 17:55:42 +0200 Subject: [PATCH 06/12] Adds translations on mailer message --- app/views/mailer/proposal_notification_digest.html.erb | 4 +++- config/locales/mailers.en.yml | 2 ++ config/locales/mailers.es.yml | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/views/mailer/proposal_notification_digest.html.erb b/app/views/mailer/proposal_notification_digest.html.erb index eda614040..cd194de7f 100644 --- a/app/views/mailer/proposal_notification_digest.html.erb +++ b/app/views/mailer/proposal_notification_digest.html.erb @@ -56,7 +56,9 @@ diff --git a/config/locales/mailers.en.yml b/config/locales/mailers.en.yml index 6d91c52a1..099b3c182 100755 --- a/config/locales/mailers.en.yml +++ b/config/locales/mailers.en.yml @@ -34,6 +34,8 @@ en: title: You received the following notifications share: Share proposal comment: Comment proposal + unsubscribe: "If you don't want receive proposal's notification, visit %{account} and unckeck 'Receive a summary of proposal notifications'." + unsubscribe_account: My account direct_message_for_receiver: subject: "You have received a new private message" reply: Reply to %{sender} diff --git a/config/locales/mailers.es.yml b/config/locales/mailers.es.yml index 7593aac43..e510ec2d8 100644 --- a/config/locales/mailers.es.yml +++ b/config/locales/mailers.es.yml @@ -34,6 +34,8 @@ es: title: Has recibido las siguientes notificaciones share: Compartir propuesta comment: Comentar propuesta + unsubscribe: "Si no quieres recibir notificaciones de propuestas, puedes entrar en %{account} y desmarcar la opción 'Recibir resumen de notificaciones sobre propuestas'." + unsubscribe_account: Mi cuenta direct_message_for_receiver: subject: "Has recibido un nuevo mensaje privado" reply: Responder a %{sender} From 0f1d6c1f191ad3b02eab6aa2ce7f1f9a07dbfbc2 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 15 Jun 2016 20:44:32 +0200 Subject: [PATCH 07/12] Adds text in footer about not replying --- app/views/layouts/mailer.html.erb | 4 ++++ app/views/mailer/proposal_notification_digest.html.erb | 2 +- config/locales/mailers.en.yml | 1 + config/locales/mailers.es.yml | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb index e0533ca50..f90b8e39d 100644 --- a/app/views/layouts/mailer.html.erb +++ b/app/views/layouts/mailer.html.erb @@ -32,6 +32,10 @@ diff --git a/app/views/mailer/proposal_notification_digest.html.erb b/app/views/mailer/proposal_notification_digest.html.erb index cd194de7f..97a309d81 100644 --- a/app/views/mailer/proposal_notification_digest.html.erb +++ b/app/views/mailer/proposal_notification_digest.html.erb @@ -17,7 +17,7 @@ diff --git a/config/locales/mailers.en.yml b/config/locales/mailers.en.yml index 72c201dd7..81efbd30c 100755 --- a/config/locales/mailers.en.yml +++ b/config/locales/mailers.en.yml @@ -32,7 +32,7 @@ en: subject: "Your investment project '%{code}' has been marked as unfeasible" unfeasible_html: "From the Madrid City Council we want to thank you for your participation in the participatory budgets of the city of Madrid. We regret to inform you that your proposal '%{title}' will be excluded from this participatory process for the following reason:" proposal_notification_digest: - title: You received the following notifications + title: "Proposal notifications in %{org_name}" share: Share proposal comment: Comment proposal unsubscribe: "If you don't want receive proposal's notification, visit %{account} and unckeck 'Receive a summary of proposal notifications'." diff --git a/config/locales/mailers.es.yml b/config/locales/mailers.es.yml index 41abb53d8..0c9d81ac0 100644 --- a/config/locales/mailers.es.yml +++ b/config/locales/mailers.es.yml @@ -32,7 +32,7 @@ es: subject: "Tu propuesta de inversión '%{code}' ha sido marcada como inviable" unfeasible_html: "Desde el Ayuntamiento de Madrid queremos agradecer tu participación en los Presupuestos Participativos de la ciudad de Madrid. Lamentamos informarte de que tu propuesta '%{title}' quedará excluida de este proceso participativo por el siguiente motivo:" proposal_notification_digest: - title: Has recibido las siguientes notificaciones + title: "Notificaciones de propuestas en %{org_name}" share: Compartir propuesta comment: Comentar propuesta unsubscribe: "Si no quieres recibir notificaciones de propuestas, puedes entrar en %{account} y desmarcar la opción 'Recibir resumen de notificaciones sobre propuestas'." From dd7629b5af5d769ff9b435bb30d850a99617d24c Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 15 Jun 2016 21:00:56 +0200 Subject: [PATCH 09/12] Adds notification menu and message for empty notifications --- app/views/proposals/_comments.html.erb | 7 ------- app/views/proposals/_notifications.html.erb | 6 ++++++ app/views/proposals/show.html.erb | 6 ++---- config/locales/en.yml | 2 +- config/locales/es.yml | 2 +- 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/app/views/proposals/_comments.html.erb b/app/views/proposals/_comments.html.erb index 094814cf1..ed52b1b66 100644 --- a/app/views/proposals/_comments.html.erb +++ b/app/views/proposals/_comments.html.erb @@ -2,13 +2,6 @@
- <% if @notifications.blank? %> -

- <%= t("proposals.show.comments_title") %> - (<%= @proposal.comments_count %>) -

- <% end %> - <%= render 'shared/wide_order_selector', i18n_namespace: "comments" %> <% if user_signed_in? %> diff --git a/app/views/proposals/_notifications.html.erb b/app/views/proposals/_notifications.html.erb index 44bb9f4a2..69389b2c5 100644 --- a/app/views/proposals/_notifications.html.erb +++ b/app/views/proposals/_notifications.html.erb @@ -1,6 +1,12 @@
+ <% if @notifications.blank? %> +
+ <%= t('proposals.show.no_notifications') %> +
+ <% end %> + <% @notifications.each do |notification| %>

<%= notification.title %>

<%= notification.created_at.to_date %>

diff --git a/app/views/proposals/show.html.erb b/app/views/proposals/show.html.erb index 7bb2a92a6..3a9869d83 100644 --- a/app/views/proposals/show.html.erb +++ b/app/views/proposals/show.html.erb @@ -124,10 +124,8 @@ <% end %>
- <% if @notifications.present? %> - <%= render "proposals/filter_subnav" %> - <%= render "proposals/notifications" %> - <% end %> + <%= render "proposals/filter_subnav" %> + <%= render "proposals/notifications" %>
<%= render "proposals/comments" %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 78ac956a7..65d97f997 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -356,7 +356,6 @@ en: other: "%{count} comments" zero: No comments comments_tab: Comments - comments_title: Comments edit_proposal_link: Edit flag: This proposal has been flagged as inappropriate by several users. login_to_comment: You must %{signin} or %{signup} to leave a comment. @@ -366,6 +365,7 @@ en: retired: Proposal retired by the author share: Share send_notification: Send notification + no_notifications: "This proposal has any notifications." update: form: submit_button: Save changes diff --git a/config/locales/es.yml b/config/locales/es.yml index 219a07dee..9ac646584 100755 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -356,7 +356,6 @@ es: other: "%{count} Comentarios" zero: Sin comentarios comments_tab: Comentarios - comments_title: Comentarios edit_proposal_link: Editar propuesta flag: Esta propuesta ha sido marcada como inapropiada por varios usuarios. login_to_comment: Necesitas %{signin} o %{signup} para comentar. @@ -366,6 +365,7 @@ es: retired: Propuesta retirada por el autor send_notification: Enviar notificación share: Compartir + no_notifications: "Esta propuesta no tiene notificaciones." update: form: submit_button: Guardar cambios From 419ced5a18394c5a91586e6b79dfc08b3bd16ace Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 15 Jun 2016 21:14:56 +0200 Subject: [PATCH 10/12] Adds text to form new --- app/views/proposal_notifications/new.html.erb | 6 +++++- config/locales/en.yml | 2 +- config/locales/es.yml | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/views/proposal_notifications/new.html.erb b/app/views/proposal_notifications/new.html.erb index b76f218fe..678e00088 100644 --- a/app/views/proposal_notifications/new.html.erb +++ b/app/views/proposal_notifications/new.html.erb @@ -1,5 +1,5 @@
-
+
<%= render 'shared/back_link' %>

<%= t("proposal_notifications.new.title") %>

@@ -12,7 +12,11 @@ proposal_path(@proposal, anchor: "comments"))).html_safe %>

+
+
+
+
<%= form_for @notification do |f| %> <%= render "shared/errors", resource: @notification %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 65d97f997..7d59f0520 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -375,7 +375,7 @@ en: title_label: "Title" body_label: "Message" submit_button: "Send message" - info_about_receivers_html: "This message will be send to %{count} people and it will be visible in %{proposal_page}." + info_about_receivers_html: "This message will be send to %{count} people and it will be visible in %{proposal_page}.
Message are not sent immediately, users will receive periodically an email with all proposal notifications." proposal_page: "the proposal's page" show: back: "Go back to my activity" diff --git a/config/locales/es.yml b/config/locales/es.yml index 9ac646584..488d0d689 100755 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -375,7 +375,7 @@ es: title_label: "Título" body_label: "Mensaje" submit_button: "Enviar mensaje" - info_about_receivers_html: "Este mensaje se enviará a %{count} usuarios y se publicará en %{proposal_page}." + info_about_receivers_html: "Este mensaje se enviará a %{count} usuarios y se publicará en %{proposal_page}.
El mensaje no se enviará inmediatamente, los usuarios recibirán periódicamente un email con todas las notificaciones de propuestas." proposal_page: "la página de la propuesta" show: back: "Volver a mi actividad" From c83e831cb7a11e19da873ebb0ad25475ce40b4f6 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 15 Jun 2016 21:28:17 +0200 Subject: [PATCH 11/12] Adds link to not receive direct messages --- .../direct_message_for_receiver.html.erb | 14 ++++++++++++++ .../proposal_notification_digest.html.erb | 18 +++++++++--------- config/locales/mailers.en.yml | 2 ++ config/locales/mailers.es.yml | 2 ++ 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/app/views/mailer/direct_message_for_receiver.html.erb b/app/views/mailer/direct_message_for_receiver.html.erb index a6b366ce9..eb1e56fe7 100644 --- a/app/views/mailer/direct_message_for_receiver.html.erb +++ b/app/views/mailer/direct_message_for_receiver.html.erb @@ -20,4 +20,18 @@
+

+ Si no quieres recibir notificaciones de propuestas, puedes entrar en Mi cuenta y desmarcar la opción "Recibir resumen de notificaciones sobre propuestas". +

+

- Si no quieres recibir notificaciones de propuestas, puedes entrar en Mi cuenta y desmarcar la opción "Recibir resumen de notificaciones sobre propuestas". + <%= t('mailers.proposal_notification_digest.unsubscribe', + account: link_to(t('mailers.proposal_notification_digest.unsubscribe_account'), + account_path)).html_safe %>

<%= setting['org_name'] %>

+ +

+ <%= t('mailers.no_reply') %>

+

- <%= link_to notification.notifiable.title, notification_url(notification) %> + <%= link_to notification.notifiable.title, notification_url(notification), style: "color: #2895F1; text-decoration: none;" %>

<%= notification.notifiable.proposal.title %> •  diff --git a/config/locales/mailers.en.yml b/config/locales/mailers.en.yml index 099b3c182..72c201dd7 100755 --- a/config/locales/mailers.en.yml +++ b/config/locales/mailers.en.yml @@ -1,6 +1,7 @@ --- en: mailers: + no_reply: "This message was sent from an email address that does not accept replies." comment: hi: Hi new_comment_by_html: There is a new comment from %{commenter} diff --git a/config/locales/mailers.es.yml b/config/locales/mailers.es.yml index e510ec2d8..41abb53d8 100644 --- a/config/locales/mailers.es.yml +++ b/config/locales/mailers.es.yml @@ -1,6 +1,7 @@ --- es: mailers: + no_reply: "Este mensaje se ha enviado desde una dirección de correo electrónico que no admite respuestas." comment: hi: Hola new_comment_by_html: Hay un nuevo comentario de %{commenter} en From 017ccfb3786a9222e624a23d9ff72e7dfce0dac2 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 15 Jun 2016 20:49:29 +0200 Subject: [PATCH 08/12] Changes title and subject in email --- app/mailers/mailer.rb | 2 +- app/views/mailer/proposal_notification_digest.html.erb | 3 ++- config/locales/mailers.en.yml | 2 +- config/locales/mailers.es.yml | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/mailers/mailer.rb b/app/mailers/mailer.rb index 5f7dc5391..d987e34cc 100644 --- a/app/mailers/mailer.rb +++ b/app/mailers/mailer.rb @@ -64,7 +64,7 @@ class Mailer < ApplicationMailer @notifications = user.notifications.where(notifiable_type: "ProposalNotification") with_user(user) do - mail(to: user.email, subject: "Email digest") + mail(to: user.email, subject: t('mailers.proposal_notification_digest.title', org_name: Setting['org_name'])) end end diff --git a/app/views/mailer/proposal_notification_digest.html.erb b/app/views/mailer/proposal_notification_digest.html.erb index 97a309d81..b9592b21a 100644 --- a/app/views/mailer/proposal_notification_digest.html.erb +++ b/app/views/mailer/proposal_notification_digest.html.erb @@ -4,7 +4,8 @@

- <%= t('mailers.proposal_notification_digest.title') %> + <%= t('mailers.proposal_notification_digest.title', + org_name: Setting['org_name']) %>

+ + + + + + + +
+

+ <%= t('mailers.direct_message_for_receiver.unsubscribe', + account: link_to(t('mailers.proposal_notification_digest.unsubscribe_account'), + account_path, style: "color: #2895F1; text-decoration: none;")).html_safe %> +

+
diff --git a/app/views/mailer/proposal_notification_digest.html.erb b/app/views/mailer/proposal_notification_digest.html.erb index b9592b21a..626d46885 100644 --- a/app/views/mailer/proposal_notification_digest.html.erb +++ b/app/views/mailer/proposal_notification_digest.html.erb @@ -56,13 +56,13 @@ -

- <%= t('mailers.proposal_notification_digest.unsubscribe', - account: link_to(t('mailers.proposal_notification_digest.unsubscribe_account'), - account_path)).html_safe %> -

- - - - +

+ <%= t('mailers.proposal_notification_digest.unsubscribe', + account: link_to(t('mailers.proposal_notification_digest.unsubscribe_account'), + account_path, style: "color: #2895F1; text-decoration: none;")).html_safe %> +

+ + + + diff --git a/config/locales/mailers.en.yml b/config/locales/mailers.en.yml index 81efbd30c..bcf622836 100755 --- a/config/locales/mailers.en.yml +++ b/config/locales/mailers.en.yml @@ -40,5 +40,7 @@ en: direct_message_for_receiver: subject: "You have received a new private message" reply: Reply to %{sender} + unsubscribe: "If you don't want receive direct messages, visit %{account} and unckeck 'Receive emails about direct messages'." + unsubscribe_account: My account direct_message_for_sender: subject: "You have send a new private message" \ No newline at end of file diff --git a/config/locales/mailers.es.yml b/config/locales/mailers.es.yml index 0c9d81ac0..84b2a240e 100644 --- a/config/locales/mailers.es.yml +++ b/config/locales/mailers.es.yml @@ -40,5 +40,7 @@ es: direct_message_for_receiver: subject: "Has recibido un nuevo mensaje privado" reply: Responder a %{sender} + unsubscribe: "Si no quieres recibir mensajes directos, puedes entrar en %{account} y desmarcar la opción 'Recibir emails con mensajes directos'." + unsubscribe_account: Mi cuenta direct_message_for_sender: subject: "Has enviado un nuevo mensaje privado" \ No newline at end of file From 9f7b49838dc51fc1ff9ed8113ece6c8ca7a41b7f Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 15 Jun 2016 21:37:36 +0200 Subject: [PATCH 12/12] Improves texts for the sender's email --- app/views/mailer/direct_message_for_sender.html.erb | 10 +++++++--- config/locales/mailers.en.yml | 3 ++- config/locales/mailers.es.yml | 5 +++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/views/mailer/direct_message_for_sender.html.erb b/app/views/mailer/direct_message_for_sender.html.erb index 219337705..4cf832414 100644 --- a/app/views/mailer/direct_message_for_sender.html.erb +++ b/app/views/mailer/direct_message_for_sender.html.erb @@ -1,9 +1,13 @@ -

<%= @direct_message.receiver.name %>

-

+

+ <%= t('mailers.direct_message_for_sender.title_html', + receiver: @direct_message.receiver.name ) %> +

+ +

<%= @direct_message.title %> -

+

<%= @direct_message.body %> diff --git a/config/locales/mailers.en.yml b/config/locales/mailers.en.yml index bcf622836..c2e2b5d85 100755 --- a/config/locales/mailers.en.yml +++ b/config/locales/mailers.en.yml @@ -43,4 +43,5 @@ en: unsubscribe: "If you don't want receive direct messages, visit %{account} and unckeck 'Receive emails about direct messages'." unsubscribe_account: My account direct_message_for_sender: - subject: "You have send a new private message" \ No newline at end of file + subject: "You have send a new private message" + title_html: "You have send a new private message to %{receiver} with the content:" \ No newline at end of file diff --git a/config/locales/mailers.es.yml b/config/locales/mailers.es.yml index 84b2a240e..bde81ec86 100644 --- a/config/locales/mailers.es.yml +++ b/config/locales/mailers.es.yml @@ -40,7 +40,8 @@ es: direct_message_for_receiver: subject: "Has recibido un nuevo mensaje privado" reply: Responder a %{sender} - unsubscribe: "Si no quieres recibir mensajes directos, puedes entrar en %{account} y desmarcar la opción 'Recibir emails con mensajes directos'." + unsubscribe: "Si no quieres recibir mensajes privados, puedes entrar en %{account} y desmarcar la opción 'Recibir emails con mensajes directos'." unsubscribe_account: Mi cuenta direct_message_for_sender: - subject: "Has enviado un nuevo mensaje privado" \ No newline at end of file + subject: "Has enviado un nuevo mensaje privado" + title_html: "Has enviado un nuevo mensaje privado a %{receiver} con el siguiente contenido:" \ No newline at end of file