]> git.openstreetmap.org Git - rails.git/blobdiff - app/helpers/browse_helper.rb
Fix links to changeset feeds.
[rails.git] / app / helpers / browse_helper.rb
index 34302a8af2d7f8af01c963d1b7ba1b2059216742..879d516eff7b5643f4bd79ca4383ad7088a7c967 100644 (file)
@@ -2,4 +2,15 @@ module BrowseHelper
   def link_to_page(page, page_param)
     return link_to(page, page_param => page)
   end
+  
+  def printable_name(object, version=false)
+    name = t 'printable_name.with_id', :id => object.id.to_s
+    if version
+      name = t 'printable_name.with_version', :id => name, :version => object.version.to_s
+    end
+    if object.tags.include? 'name'
+      name = t 'printable_name.with_name',  :name => object.tags['name'].to_s, :id => name
+    end
+    return name
+  end
 end