X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/2ed84e26cdeaaa20b8f607624d65b7891fcf1fed..9b780a689b398e0d41d7aac0e9b9b3d58f5b1166:/app/helpers/browse_helper.rb diff --git a/app/helpers/browse_helper.rb b/app/helpers/browse_helper.rb index 34302a8af..67420151c 100644 --- a/app/helpers/browse_helper.rb +++ b/app/helpers/browse_helper.rb @@ -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 = object.id.to_s + if version + name = "#{name}, v#{object.version.to_s}" + end + if object.tags.include? 'name' + name = "#{object.tags['name'].to_s} (#{name})" + end + return name + end end