]> git.openstreetmap.org Git - rails.git/blobdiff - app/helpers/application_helper.rb
Link user names to their pages
[rails.git] / app / helpers / application_helper.rb
index fb422cc17ead31643db19b04a2f55a9f358f5a85..e32d1bb6ead572bace0b7d64a7c86f1776b9f087 100644 (file)
@@ -88,15 +88,23 @@ module ApplicationHelper
     end
   end
 
+  def dir
+    if dir = params[:dir]
+      dir == "rtl" ? "rtl" : "ltr"
+    else
+      I18n.t("html.dir")
+    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})
+      link_to h(object.author.display_name), link_options.merge({:controller => "user", :action => "view", :display_name => object.author.display_name})
     end
   end
 end