]> git.openstreetmap.org Git - rails.git/blob - app/helpers/note_helper.rb
Allow moderators to reopen hidden notes
[rails.git] / app / helpers / note_helper.rb
1 module NoteHelper
2   def note_event(event, at, by)
3     if by.nil?
4       I18n.t("browse.note." + event + "_by_anonymous",
5         :when => friendly_date(at),
6         :exact_time => l(at)
7       ).html_safe
8     else
9       I18n.t("browse.note." + event + "_by",
10         :when => friendly_date(at),
11         :exact_time => l(at),
12         :user => note_author(by)
13       ).html_safe
14     end
15   end
16
17   def note_author(author, link_options = {})
18     if author.nil?
19       ""
20     else
21       link_to h(author.display_name), link_options.merge({:controller => "user", :action => "view", :display_name => author.display_name})
22     end
23   end
24
25 end