From 29f869046a22598bfb0a03fc158bd61a28d21628 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Fri, 10 Jun 2016 18:01:59 +0200 Subject: [PATCH 1/3] Adds message for no accepting private messages --- app/views/users/show.html.erb | 6 +++++- config/locales/en.yml | 1 + config/locales/es.yml | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 6adb97b37..31c62d13c 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -2,10 +2,14 @@
- <% if @user != current_user %> + <% if @user != current_user %> <%= link_to t("users.show.send_private_message"), new_user_direct_message_path(@user), class: "button hollow float-right" %> + +
+ <%= t("users.show.no_private_messages") %> +
<% end %>

diff --git a/config/locales/en.yml b/config/locales/en.yml index 40403561e..c0a68815b 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -530,6 +530,7 @@ en: one: 1 Spending proposal other: "%{count} Spending proposals" no_activity: User has no public activity + no_private_messages: "This user doesn't accept private messages." private_activity: This user decided to keep the activity list private send_private_message: "Send private message" proposals: diff --git a/config/locales/es.yml b/config/locales/es.yml index 397eca876..2354e4742 100755 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -530,6 +530,7 @@ es: one: 1 Propuesta de inversión other: "%{count} Propuestas de inversión" no_activity: Usuario sin actividad pública + no_private_messages: "Este usuario no acepta mensajes privados." private_activity: Este usuario ha decidido mantener en privado su lista de actividades send_private_message: "Enviar un mensaje privado" proposals: From 988f1f645a27eb0939351c2e9ee48d161c1e03fa Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Fri, 10 Jun 2016 18:02:37 +0200 Subject: [PATCH 2/3] Improves proposal notification mailer and fixes settings.scss --- app/assets/stylesheets/_settings.scss | 2 +- app/views/mailer/proposal_notification.html.erb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/_settings.scss b/app/assets/stylesheets/_settings.scss index 1e181e1c1..57a1afb7c 100644 --- a/app/assets/stylesheets/_settings.scss +++ b/app/assets/stylesheets/_settings.scss @@ -192,7 +192,7 @@ $header-color: inherit; $header-lineheight: 1.4; $header-margin-bottom: 0.5rem; $header-text-rendering: optimizeLegibility; -$small-font-size: 80%; +$small-font-size: rem-calc(14); $header-small-font-color: $medium-gray; $paragraph-lineheight: 1.6; $paragraph-margin-bottom: 1rem; diff --git a/app/views/mailer/proposal_notification.html.erb b/app/views/mailer/proposal_notification.html.erb index 3bcfccc1b..04ca39d86 100644 --- a/app/views/mailer/proposal_notification.html.erb +++ b/app/views/mailer/proposal_notification.html.erb @@ -7,18 +7,18 @@ <%= @notification.body %>

- +
diff --git a/config/locales/mailers.en.yml b/config/locales/mailers.en.yml index c90ca12c9..66c1c75ea 100755 --- a/config/locales/mailers.en.yml +++ b/config/locales/mailers.en.yml @@ -33,5 +33,9 @@ en: proposal_notification: share: Share comment: Comment proposal + proposal_notification_digest: + title: You received the following notifications + share: Share + comment: Comment proposal direct_message: reply: Reply to %{sender} \ No newline at end of file diff --git a/config/locales/mailers.es.yml b/config/locales/mailers.es.yml index 75ff487d1..36343267d 100644 --- a/config/locales/mailers.es.yml +++ b/config/locales/mailers.es.yml @@ -33,5 +33,9 @@ es: proposal_notification: share: Compartir comment: Comentar propuesta + proposal_notification_digest: + title: Has recibido las siguientes notificaciones + share: Compartir + comment: Comentar propuesta direct_message: reply: Responder a %{sender} \ No newline at end of file
- <%= link_to "#comments", 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: 200px; display: inline-block;" do %> + <%= link_to "#comments", 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.proposal_notification.share') %> <% end %> - <%= link_to "#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: 200px; display: inline-block;" do %> + <%= link_to "#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_comment.png', style: "border: 0; display: inline-block; width: 100%; max-width: 16px; vertical-align: middle;", alt: "") %> <%= t('mailers.proposal_notification.comment') %> <% end %> From a417d88f9113219fd491121ea06d56a059613db3 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Fri, 10 Jun 2016 18:03:03 +0200 Subject: [PATCH 3/3] Adds proposal notification digest mailer --- .../proposal_notification_digest.html.erb | 51 +++++++++++++++++++ config/locales/mailers.en.yml | 4 ++ config/locales/mailers.es.yml | 4 ++ 3 files changed, 59 insertions(+) create mode 100644 app/views/mailer/proposal_notification_digest.html.erb diff --git a/app/views/mailer/proposal_notification_digest.html.erb b/app/views/mailer/proposal_notification_digest.html.erb new file mode 100644 index 000000000..4733d900e --- /dev/null +++ b/app/views/mailer/proposal_notification_digest.html.erb @@ -0,0 +1,51 @@ + + + + + + + +
+

+ <%= t('mailers.proposal_notification_digest.title') %> +

+
+ + + + + + + + +
+

+ <%= @notification.title %> +

+

+ <%= @notification.proposal.title %> • <%= @notification.proposal.created_at.to_date %> • <%= @notification.proposal.author.name %> +

+

+ <%= @notification.body %> +

+ + + + + + + +
+ <%= link_to "#comments", 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.proposal_notification_digest.share') %> + <% end %> + + <%= link_to "#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; margin-left: 12px;" do %> + <%= image_tag('icon_mailer_comment.png', style: "border: 0; display: inline-block; width: 100%; max-width: 16px; vertical-align: middle;", alt: "") %> + <%= t('mailers.proposal_notification_digest.comment') %> + <% end %> +
+
+ +