]> git.openstreetmap.org Git - rails.git/blob - app/helpers/browse_helper.rb
Escape non-ascii characters in exported HTML. Closes #2075.
[rails.git] / app / helpers / browse_helper.rb
1 module BrowseHelper
2   def link_to_page(page, page_param)
3     return link_to(page, page_param => page)
4   end
5   
6   def printable_name(object, version=false)
7     name = t 'printable_name.with_id', :id => object.id.to_s
8     if version
9       name = t 'printable_name.with_version', :id => name, :version => object.version.to_s
10     end
11     if object.tags.include? "name:#{I18n.locale}"
12       name = t 'printable_name.with_name',  :name => object.tags["name:#{I18n.locale}"].to_s, :id => name
13     elsif object.tags.include? 'name'
14       name = t 'printable_name.with_name',  :name => object.tags['name'].to_s, :id => name
15     end
16     return name
17   end
18 end