From 448a68447fcadbb1e544fe8ebdea4d029e9593a1 Mon Sep 17 00:00:00 2001 From: Herve Saint-Amand Date: Wed, 8 Feb 2017 22:22:21 +0000 Subject: [PATCH] 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. --- app/views/notifier/note_comment_notification.html.erb | 6 ++++-- app/views/notifier/note_comment_notification.text.erb | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) 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 %> -- 2.43.2