]> git.openstreetmap.org Git - rails.git/commitdiff
Make the notification mails for notes show when a note is resolved
authorTom Hughes <tom@compton.nu>
Mon, 29 Apr 2013 18:26:03 +0000 (19:26 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 29 Apr 2013 18:26:03 +0000 (19:26 +0100)
app/models/notifier.rb
app/views/notifier/note_comment_notification.html.erb
config/locales/en.yml

index 5972a700b8af794c9246c777df171a458e445820..341c9072a94b6635e1a7b409267b400c320c5cfc 100644 (file)
@@ -129,6 +129,7 @@ class Notifier < ActionMailer::Base
     @place = Nominatim.describe_location(comment.note.lat, comment.note.lon, 14, @locale)
     @comment = comment.body
     @owner = recipient == comment.note.author
     @place = Nominatim.describe_location(comment.note.lat, comment.note.lon, 14, @locale)
     @comment = comment.body
     @owner = recipient == comment.note.author
+    @event = comment.event
 
     if comment.author
       @commenter = comment.author.display_name
 
     if comment.author
       @commenter = comment.author.display_name
@@ -137,9 +138,9 @@ class Notifier < ActionMailer::Base
     end
 
     if @owner
     end
 
     if @owner
-      subject = I18n.t('notifier.note_comment_notification.subject_own', :commenter => @commenter)
+      subject = I18n.t("notifier.note_comment_notification.#{@event}.subject_own", :commenter => @commenter)
     else
     else
-      subject = I18n.t('notifier.note_comment_notification.subject_other', :commenter => @commenter)
+      subject = I18n.t("notifier.note_comment_notification.#{@event}.subject_other", :commenter => @commenter)
     end
 
     mail :to => recipient.email, :subject => subject
     end
 
     mail :to => recipient.email, :subject => subject
index b17fe67f840102968aacc516f82f485d21d69dc1..d82723bbb86d5dac0c5ca46a6a3a2f19cb08fde2 100644 (file)
@@ -1,9 +1,9 @@
 <p><%= t 'notifier.note_comment_notification.greeting' %></p>
 
 <% if @owner %>
 <p><%= t 'notifier.note_comment_notification.greeting' %></p>
 
 <% if @owner %>
-<p><%= t 'notifier.note_comment_notification.your_note', :commenter => @commenter, :place => @place %></p>
+<p><%= t "notifier.note_comment_notification.#{@event}.your_note", :commenter => @commenter, :place => @place %></p>
 <% else %>
 <% else %>
-<p><%= t 'notifier.note_comment_notification.commented_note', :commenter => @commenter, :place => @place %></p>
+<p><%= t "notifier.note_comment_notification.#{@event}.commented_note", :commenter => @commenter, :place => @place %></p>
 <% end %>
 
 ==
 <% end %>
 
 ==
index 0114751b69a82cdd8762c882535f44f3758396ad..67ef5d09bdfc79aab64543677d302819098efee2 100644 (file)
@@ -1209,11 +1209,17 @@ en:
       click_the_link: "If this is you, please click the link below to reset your password."
     note_comment_notification:
       anonymous: An anonymous user
       click_the_link: "If this is you, please click the link below to reset your password."
     note_comment_notification:
       anonymous: An anonymous user
-      subject_own: "[OpenStreetMap] %{commenter} has commented on one of your notes"
-      subject_other: "[OpenStreetMap] %{commenter} has commented on a note you are interested in"
       greeting: "Hi,"
       greeting: "Hi,"
-      your_note: "%{commenter} has left a comment on one of your map notes near %{place}."
-      commented_note: "%{commenter} has left a comment on a map note you have commented on. The note is near %{place}."
+      commented:
+        subject_own: "[OpenStreetMap] %{commenter} has commented on one of your notes"
+        subject_other: "[OpenStreetMap] %{commenter} has commented on a note you are interested in"
+        your_note: "%{commenter} has left a comment on one of your map notes near %{place}."
+        commented_note: "%{commenter} has left a comment on a map note you have commented on. The note is near %{place}."
+      closed:
+        subject_own: "[OpenStreetMap] %{commenter} has resolved one of your notes"
+        subject_other: "[OpenStreetMap] %{commenter} has resolved a note you are interested in"
+        your_note: "%{commenter} has resolved one of your map notes near %{place}."
+        commented_note: "%{commenter} has resolved a map note you have commented on. The note is near %{place}."
       details: "More details about the note can be found at %{url}."
   message:
     inbox:
       details: "More details about the note can be found at %{url}."
   message:
     inbox: