From: Herve Saint-Amand Date: Wed, 8 Feb 2017 22:22:21 +0000 (+0000) Subject: Don't display a box at all if the note event doesn't include a comment body X-Git-Tag: live~4179 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/448a68447fcadbb1e544fe8ebdea4d029e9593a1?ds=inline;hp=-c Don't display a box at all if the note event doesn't include a comment body Before this it just displays en empty box, which looks wrong. --- 448a68447fcadbb1e544fe8ebdea4d029e9593a1 diff --git a/app/views/notifier/note_comment_notification.html.erb b/app/views/notifier/note_comment_notification.html.erb index ecaff81dc..909bffaa6 100644 --- a/app/views/notifier/note_comment_notification.html.erb +++ b/app/views/notifier/note_comment_notification.html.erb @@ -6,8 +6,10 @@

<%= raw t "notifier.note_comment_notification.#{@event}.commented_note", :commenter => link_to_user(@commenter), :place => @place %>

<% end %> -<%= message_body do %> - <%= @comment.to_html %> +<% unless @comment.empty? %> + <%= message_body do %> + <%= @comment.to_html %> + <% end %> <% end %>

<%= raw t 'notifier.note_comment_notification.details', :url => link_to(@noteurl, @noteurl) %>

diff --git a/app/views/notifier/note_comment_notification.text.erb b/app/views/notifier/note_comment_notification.text.erb index c8a967450..5924c8a9d 100644 --- a/app/views/notifier/note_comment_notification.text.erb +++ b/app/views/notifier/note_comment_notification.text.erb @@ -6,8 +6,10 @@ <%= t "notifier.note_comment_notification.#{@event}.commented_note", :commenter => @commenter, :place => @place %> <% end %> +<% unless @comment.empty? %> == <%= @comment.to_text %> == +<% end %> <%= t 'notifier.note_comment_notification.details', :url => @noteurl %>