]> git.openstreetmap.org Git - rails.git/blobdiff - app/helpers/application_helper.rb
Add support for creating new notes
[rails.git] / app / helpers / application_helper.rb
index e0c299ca54ce0e4b2a6c329b5f7be0b6d7eb75ac..fb422cc17ead31643db19b04a2f55a9f358f5a85 100644 (file)
@@ -87,4 +87,16 @@ module ApplicationHelper
       end
     end
   end
+
+  def friendly_date(date)
+    content_tag(:span, time_ago_in_words(date), :title => l(date, :format => :friendly))
+  end
+
+  def note_author(object, link_options = {})
+    if object.author.nil?
+      h(object.author_name)
+    else
+      link_to h(object.author_name), link_options.merge({:controller => "user", :action => "view", :display_name => object.author_name})
+    end
+  end
 end