]> git.openstreetmap.org Git - rails.git/commitdiff
Don't display a box at all if the note event doesn't include a comment body
authorHerve Saint-Amand <git@saintamh.org>
Wed, 8 Feb 2017 22:22:21 +0000 (22:22 +0000)
committerHerve Saint-Amand <git@saintamh.org>
Wed, 8 Feb 2017 22:22:21 +0000 (22:22 +0000)
Before this it just displays en empty box, which looks wrong.

app/views/notifier/note_comment_notification.html.erb
app/views/notifier/note_comment_notification.text.erb

index ecaff81dc54c193be45c922cb832e10209035049..909bffaa664c087873694dae8b8356d1a073d8d8 100644 (file)
@@ -6,8 +6,10 @@
   <p><%= raw t "notifier.note_comment_notification.#{@event}.commented_note", :commenter => link_to_user(@commenter), :place => @place %></p>
 <% end %>
 
   <p><%= raw t "notifier.note_comment_notification.#{@event}.commented_note", :commenter => link_to_user(@commenter), :place => @place %></p>
 <% end %>
 
-<%= message_body do %>
-  <%= @comment.to_html %>
+<% unless @comment.empty? %>
+  <%= message_body do %>
+    <%= @comment.to_html %>
+  <% end %>
 <% end %>
 
 <p><%= raw t 'notifier.note_comment_notification.details', :url => link_to(@noteurl, @noteurl) %></p>
 <% end %>
 
 <p><%= raw t 'notifier.note_comment_notification.details', :url => link_to(@noteurl, @noteurl) %></p>
index c8a967450d4b5a2d22b73e0f7030bf599fcc01ef..5924c8a9d2036975a35ce07db95439b83f351748 100644 (file)
@@ -6,8 +6,10 @@
 <%= t "notifier.note_comment_notification.#{@event}.commented_note", :commenter => @commenter, :place => @place %>
 <% end %>
 
 <%= t "notifier.note_comment_notification.#{@event}.commented_note", :commenter => @commenter, :place => @place %>
 <% end %>
 
+<% unless @comment.empty? %>
 ==
 <%= @comment.to_text %>
 ==
 
 ==
 <%= @comment.to_text %>
 ==
 
+<% end %>
 <%= t 'notifier.note_comment_notification.details', :url => @noteurl %>
 <%= t 'notifier.note_comment_notification.details', :url => @noteurl %>