Patch from bug #2787 to add icons to data browser pages

This commit is contained in:
Dan Karran 2010-04-20 09:08:51 +01:00 committed by Tom Hughes
parent 8657cd4724
commit 10dca1b6df
97 changed files with 135 additions and 12 deletions

View file

@ -2,7 +2,7 @@ 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
@ -16,6 +16,16 @@ module BrowseHelper
return name
end
def css_class(type, object)
css = type + " " + h(object.tags.find_all { |k,v| k == "aeroway" || k == "amenity" || k == "barrier" || k == "building" || k == "highway" || k == "landuse" || k == "leisure" || k == "man_made" || k == "natural" || k == "railway" || k == "shop" || k == "tourism" || k == "waterway" }.join(' '))
return css
end
def link_title(object)
title = h(object.tags.map { |k,v| k + '=' + v }.to_sentence)
return title
end
def format_key(key)
if url = wiki_link("key", key)
link_to h(key), url, :title => t('browse.tag_details.wiki_link.key', :key => key)