From: Herve Saint-Amand Date: Mon, 9 Jan 2017 23:42:43 +0000 (+0000) Subject: Dressed up a few more messages. X-Git-Tag: live~3594^2~24 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/3aa69ffbdda5f111aed60d77e1a1eec8cdcad3ba?ds=sidebyside Dressed up a few more messages. email_confirm, message_notification and signup_confirm now use the new templates. This fixes some, but not all, of the currently broken tests. --- diff --git a/app/models/notifier.rb b/app/models/notifier.rb index ee40a0d6e..8f3486626 100644 --- a/app/models/notifier.rb +++ b/app/models/notifier.rb @@ -77,6 +77,9 @@ class Notifier < ActionMailer::Base @replyurl = url_for(:host => SERVER_URL, :controller => "message", :action => "reply", :message_id => message.id) + @user_message_author = @from_user + + attach_user_avatar(message.sender) mail :from => from_address(message.sender.display_name, "m", message.id, message.digest), :to => message.recipient.email, diff --git a/app/views/notifier/email_confirm.html.erb b/app/views/notifier/email_confirm.html.erb index 5b7c74d7f..5c639d57f 100644 --- a/app/views/notifier/email_confirm.html.erb +++ b/app/views/notifier/email_confirm.html.erb @@ -1,7 +1,9 @@ -

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

+<% content_for :body do %> +

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

-

<%= t 'notifier.email_confirm_html.hopefully_you', :server_url => SERVER_URL, :new_address => @address %>

+

<%= t 'notifier.email_confirm_html.hopefully_you', :server_url => SERVER_URL, :new_address => @address %>

-

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

+

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

-

<%= @url %>

+

<%= @url %>

+<% end %> diff --git a/app/views/notifier/message_notification.html.erb b/app/views/notifier/message_notification.html.erb index 19704251d..823f1487a 100644 --- a/app/views/notifier/message_notification.html.erb +++ b/app/views/notifier/message_notification.html.erb @@ -1,9 +1,24 @@ -

<%= t'notifier.message_notification.hi', :to_user => @to_user %>

+<% content_for :body do %> +

+ <%= t'notifier.message_notification.hi', :to_user => @to_user %> +

+

+ <%= raw t'notifier.message_notification.header', + :from_user => link_to_user(@from_user), + :subject => content_tag("em", @title) + %> +

-

<%= raw t'notifier.message_notification.header', :from_user => link_to(@from_user, :host => SERVER_URL, :controller => :user, :action => :view, :display_name => @from_user), :subject => @title %>

+ <%= render "notifier/user_message_table", :captured => capture { %> + <%= @text.to_html %> + <% } %> +<% end %> -== -<%= @text.to_html %> -== - -

<%= t'notifier.message_notification.footer_html', :readurl => link_to(@readurl, @readurl), :replyurl => link_to(@replyurl, @replyurl) %>

+<% content_for :footer do %> +

+ <%= t'notifier.message_notification.footer_html', + :readurl => link_to(@readurl, @readurl) + tag(:br), + :replyurl => link_to(@replyurl, @replyurl) + %> +

+<% end %> diff --git a/app/views/notifier/signup_confirm.html.erb b/app/views/notifier/signup_confirm.html.erb index 814deee91..66528bd83 100644 --- a/app/views/notifier/signup_confirm.html.erb +++ b/app/views/notifier/signup_confirm.html.erb @@ -1,9 +1,11 @@ -

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

+<% content_for :body do %> +

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

-

<%= t("notifier.signup_confirm.created", :site_url => SERVER_URL) %>

+

<%= t("notifier.signup_confirm.created", :site_url => SERVER_URL) %>

-

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

+

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

-

<%= link_to @url, @url %>

+

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

-

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

+

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

+<% end %>