From: Herve Saint-Amand Date: Sun, 12 Feb 2017 21:05:38 +0000 (+0000) Subject: merging master into html-mail-fixes X-Git-Tag: live~3574^2~1 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/a520f1251cf06be665d93037c74116a9f769fbf1?hp=a4eef7dab8b1bd1712c9cdd880dd91cb84681140 merging master into html-mail-fixes --- diff --git a/app/helpers/notifier_helper.rb b/app/helpers/notifier_helper.rb index 3e53e2543..da55f6c0e 100644 --- a/app/helpers/notifier_helper.rb +++ b/app/helpers/notifier_helper.rb @@ -5,10 +5,16 @@ module NotifierHelper def link_to_user(display_name) link_to( - display_name, + content_tag( + 'strong', + display_name, + # NB we need "text-decoration: none" twice: GMail only honours it on + # the but Outlook only on the + :style => "text-decoration: none" + ), user_url(display_name, :host => SERVER_URL), :target => "_blank", - :style => "text-decoration: none; color: #222; font-weight: bold" + :style => "text-decoration: none; color: #222" ) end @@ -20,6 +26,9 @@ module NotifierHelper end def style_message(html) - html.gsub /

/, '

' + # Because we can't use stylesheets in HTML emails, we need to inline the + # styles. Rather than copy-paste the same string of CSS into every message, + # we apply it once here, after the message has been composed. + html.gsub /

/, '

' end end diff --git a/app/views/layouts/notifier.html.erb b/app/views/layouts/notifier.html.erb index dd041cca5..883f1b385 100644 --- a/app/views/layouts/notifier.html.erb +++ b/app/views/layouts/notifier.html.erb @@ -5,17 +5,21 @@ -
- + <%# having width=100% on the table and then only a fixed width on the middle cell gives us a max-width that works in Outlook %> + + + -
+ - @@ -32,9 +36,10 @@
- <%= image_tag attachments["logo.png"].url, alt: "OpenStreetMap logo", title: "OpenStreetMap", height: "30", width: "30", border: "0" %> + <%= image_tag attachments["logo.png"].url, alt: "OpenStreetMap", title: "OpenStreetMap", height: "30", width: "30", border: "0" %> + <%# the "width: 100%" here looks wrong, but I couldn't find a better way of making Outlook give this cell full width %> + + <%# NB we need "text-decoration: none" twice: GMail only honours it on the but Outlook only on the %> -

OpenStreetMap

+ OpenStreetMap
+ <%= yield :footer %>

OpenStreetMap diff --git a/app/views/notifier/_message_body.html.erb b/app/views/notifier/_message_body.html.erb index d86d44133..b71c5f994 100644 --- a/app/views/notifier/_message_body.html.erb +++ b/app/views/notifier/_message_body.html.erb @@ -1,6 +1,6 @@ - +
- - diff --git a/app/views/notifier/changeset_comment_notification.html.erb b/app/views/notifier/changeset_comment_notification.html.erb index c2b552ed5..19ca33d85 100644 --- a/app/views/notifier/changeset_comment_notification.html.erb +++ b/app/views/notifier/changeset_comment_notification.html.erb @@ -16,11 +16,11 @@ <% end %>

- <%= raw t 'notifier.changeset_comment_notification.details', :url => link_to(@changeset_url, @changeset_url, :style => "white-space: nowrap") %> + <%= raw t 'notifier.changeset_comment_notification.details', :url => link_to(@changeset_url, @changeset_url) %>

<% content_for :footer do %>

- <%= raw t 'notifier.changeset_comment_notification.unsubscribe', :url => link_to(@changeset_url, @changeset_url, :style => "color: #222; white-space: nowrap") %> + <%= raw t 'notifier.changeset_comment_notification.unsubscribe', :url => link_to(@changeset_url, @changeset_url, :style => "color: #222") %>

<% end %> diff --git a/app/views/notifier/email_confirm.html.erb b/app/views/notifier/email_confirm.html.erb index 5d8f49d3d..5b7c74d7f 100644 --- a/app/views/notifier/email_confirm.html.erb +++ b/app/views/notifier/email_confirm.html.erb @@ -4,4 +4,4 @@

<%= t 'notifier.email_confirm_html.click_the_link' %>

-

<%= @url %>

+

<%= @url %>

diff --git a/app/views/notifier/signup_confirm.html.erb b/app/views/notifier/signup_confirm.html.erb index 41b2ceb49..814deee91 100644 --- a/app/views/notifier/signup_confirm.html.erb +++ b/app/views/notifier/signup_confirm.html.erb @@ -4,6 +4,6 @@

<%= t("notifier.signup_confirm.confirm") %>

-

<%= link_to @url, @url, :style => "white-space: nowrap" %>

+

<%= link_to @url, @url %>

<%= t("notifier.signup_confirm.welcome") %>

+ <%= link_to( image_tag( attachments["avatar.png"].url, @@ -14,7 +14,7 @@ :target => "_blank" ) %> + <%= body %>