X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/bed9cd00ed166ce346da4b8a9b654ddf86e64e70..d907b40eabd3c9560e9d9a88232dbda494a32e3c:/app/helpers/browse_helper.rb?ds=sidebyside diff --git a/app/helpers/browse_helper.rb b/app/helpers/browse_helper.rb index 34302a8af..aed0c518f 100644 --- a/app/helpers/browse_helper.rb +++ b/app/helpers/browse_helper.rb @@ -2,4 +2,17 @@ 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:#{I18n.locale}" + name = t 'printable_name.with_name', :name => object.tags["name:#{I18n.locale}"].to_s, :id => name + elsif object.tags.include? 'name' + name = t 'printable_name.with_name', :name => object.tags['name'].to_s, :id => name + end + return name + end end