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
return name
end
+ def link_class(type, object)
+ return type + " " + h(icon_tags(object).join(' '))
+ end
+
+ def link_title(object)
+ return h(icon_tags(object).map { |k,v| k + '=' + v }.to_sentence)
+ 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)
private
+ ICON_TAGS = [
+ "aeroway", "amenity", "barrier", "building", "highway", "landuse",
+ "leisure", "man_made", "natural", "railway", "shop", "tourism", "waterway"
+ ]
+
+ def icon_tags(object)
+ object.tags.find_all { |k,v| ICON_TAGS.include? k }
+ end
+
def wiki_link(type, lookup)
locale = I18n.locale.to_s
<td>
<table cellpadding="0">
<% @nodes.each do |node| %>
- <tr><td><%= link_to h(printable_name(node, true)), :action => "node", :id => node.id.to_s %></td></tr>
+ <tr><td><%= link_to h(printable_name(node, true)), { :action => "node", :id => node.id.to_s }, :class => link_class('node', node), :title => link_title(node) %></td></tr>
<% end %>
</table>
</td>
<td>
<table cellpadding="0">
<% @ways.each do |way| %>
- <tr><td><%= link_to h(printable_name(way, true)), :action => "way", :id => way.id.to_s %></td></tr>
+ <tr><td><%= link_to h(printable_name(way, true)), { :action => "way", :id => way.id.to_s }, :class => link_class('way', way), :title => link_title(way) %></td></tr>
<% end %>
<%=
#render :partial => "containing_relation", :collection => changeset_details.containing_relation_members
<td>
<table cellpadding="0">
<% @relations.each do |relation| %>
- <tr><td><%= link_to h(printable_name(relation, true)), :action => "relation", :id => relation.id.to_s %></td></tr>
+ <tr><td><%= link_to h(printable_name(relation, true)), { :action => "relation", :id => relation.id.to_s }, :class => "relation " %></td></tr>
<% end %>
</table>
</td>
--- /dev/null
+.node { padding-left: 25px; }
+.way { padding-left: 25px; }
+
+/* Nodes */
+
+.aeroway.aerodrome { background: url(/images/browse/aerodrome.p.16.png) no-repeat center left; }
+
+.amenity.atm { background: url(/images/browse/atm2.p.16.png) no-repeat center left; }
+.amenity.bank { background: url(/images/browse/bank2.p.16.png) no-repeat center left; }
+.amenity.bar { background: url(/images/browse/bar.p.16.png) no-repeat center left; }
+.amenity.bicycle_rental { background: url(/images/browse/rental_bicycle.p.20.png) no-repeat center left; }
+.amenity.bus_station { background: url(/images/browse/bus_station.n.16.png) no-repeat center left; }
+.amenity.cafe { background: url(/images/browse/cafe.p.16.png) no-repeat center left; }
+.amenity.car_sharing { background: url(/images/browse/car_share.p.16.png) no-repeat center left; }
+.amenity.cinema { background: url(/images/browse/cinema.p.16.png) no-repeat center left; }
+.amenity.drinking_water { background: url(/images/browse/drinkingtap.p.16.png) no-repeat center left; }
+.amenity.fast_food { background: url(/images/browse/fast_food.p.16.png) no-repeat center left; }
+.amenity.fire_station { background: url(/images/browse/firestation.p.16.png) no-repeat center left; }
+.amenity.fuel { background: url(/images/browse/fuel.p.16.png) no-repeat center left; }
+.amenity.hospital { background: url(/images/browse/hospital.p.16.png) no-repeat center left; }
+.amenity.library { background: url(/images/browse/library.p.16.png) no-repeat center left; }
+.amenity.parking { background: url(/images/browse/parking.p.16.png) no-repeat center left; }
+.amenity.pharmacy { background: url(/images/browse/pharmacy.p.16.png) no-repeat center left; }
+.amenity.place_of_worship { background: url(/images/browse/place_of_worship.png) no-repeat center left; }
+.amenity.police { background: url(/images/browse/police.p.16.png) no-repeat center left; }
+.amenity.post_box { background: url(/images/browse/post_box.p.16.png) no-repeat center left; }
+.amenity.post_office { background: url(/images/browse/post_office.p.16.png) no-repeat center left; }
+.amenity.prison { background: url(/images/browse/prison.p.16.png) no-repeat center left; }
+.amenity.pub { background: url(/images/browse/pub.p.16.png) no-repeat center left; }
+.amenity.restaurant { background: url(/images/browse/restaurant.p.16.png) no-repeat center left; }
+.amenity.recycling { background: url(/images/browse/recycling.p.16.png) no-repeat center left; }
+.amenity.shelter { background: url(/images/browse/shelter2.p.16.png) no-repeat center left; }
+.amenity.telephone { background: url(/images/browse/telephone.p.16.png) no-repeat center left; }
+.amenity.theatre { background: url(/images/browse/theatre.p.16.png) no-repeat center left; }
+.amenity.toilets { background: url(/images/browse/toilets.p.16.png) no-repeat center left; }
+
+.barrier.gate { background: url(/images/browse/gate2.p.16.png) no-repeat center left; }
+
+.highway.bus_stop { background: url(/images/browse/bus_stop.p.16.png) no-repeat center left; }
+.highway.mini_roundabout { background: url(/images/browse/mini_round.p.16.png) no-repeat center left; }
+.highway.traffic_signals { background: url(/images/browse/traffic_light.png) no-repeat center left; }
+.highway.turning_circle { background: url(/images/browse/turning_circle.p.16.png) no-repeat center left; }
+
+.man_made.lighthouse { background: url(/images/browse/lighthouse.p.16.png) no-repeat center left; }
+
+.natural.tree { background: url(/images/browse/tree.p.16.png) no-repeat center left; }
+
+.railway.halt { background: url(/images/browse/halt.p.16.png) no-repeat center left; }
+.railway.station { background: url(/images/browse/station.p.16.png) no-repeat center left; }
+.railway.level_crossing { background: url(/images/browse/level_crossing.p.16.png) no-repeat center left; }
+
+.shop { background: url(/images/browse/shop_convenience.p.16.png) no-repeat center left; }
+.shop.bakery { background: url(/images/browse/shop_bakery.p.16.png) no-repeat center left; }
+.shop.clothes { background: url(/images/browse/shop_clothes.p.16.png) no-repeat center left; }
+.shop.convenience { background: url(/images/browse/shop_convenience.p.16.png) no-repeat center left; }
+.shop.diy { background: url(/images/browse/shop_diy.p.16.png) no-repeat center left; }
+.shop.hairdresser { background: url(/images/browse/shop_hairdresser.p.16.png) no-repeat center left; }
+.shop.supermarket { background: url(/images/browse/shop_supermarket.p.16.png) no-repeat center left; }
+
+.tourism.alpine_hut { background: url(/images/browse/alpinehut.p.16.png) no-repeat center left; }
+.tourism.camp_site { background: url(/images/browse/camping.n.16.png) no-repeat center left; }
+.tourism.caravan_site { background: url(/images/browse/caravan_park.n.16.png) no-repeat center left; }
+.tourism.hostel { background: url(/images/browse/hostel.p.16.png) no-repeat center left; }
+.tourism.hotel { background: url(/images/browse/hotel.p.16.png) no-repeat center left; }
+.tourism.museum { background: url(/images/browse/museum.p.16.png) no-repeat center left; }
+.tourism.viewpoint { background: url(/images/browse/view_point.p.16.png) no-repeat center left; }
+
+/* Ways */
+
+.aeroway.runway { background: url(/images/browse/runway.20.png) no-repeat center left; }
+.aeroway.taxiway { background: url(/images/browse/taxiway.20.png) no-repeat center left; }
+
+.building { background: url(/images/browse/building.png) no-repeat center left; }
+
+.highway.bridleway { background: url(/images/browse/bridleway.20.png) no-repeat center left; }
+.highway.byway { background: url(/images/browse/byway.20.png) no-repeat center left; }
+.highway.cycleway { background: url(/images/browse/cycleway.20.png) no-repeat center left; }
+.highway.footway { background: url(/images/browse/footway.20.png) no-repeat center left; }
+.highway.motorway { background: url(/images/browse/motorway.20.png) no-repeat center left; }
+.highway.primary { background: url(/images/browse/primary.20.png) no-repeat center left; }
+.highway.residential { background: url(/images/browse/unclassified.20.png) no-repeat center left; }
+.highway.secondary { background: url(/images/browse/secondary.20.png) no-repeat center left; }
+.highway.trunk { background: url(/images/browse/trunk.20.png) no-repeat center left; }
+.highway.unclassified { background: url(/images/browse/unclassified.20.png) no-repeat center left; }
+
+.landuse.brownfield { background: url(/images/browse/brownfield.png) no-repeat center left; }
+.landuse.cemetery { background: url(/images/browse/cemetery.png) no-repeat center left; }
+.landuse.commercial { background: url(/images/browse/commercial.png) no-repeat center left; }
+.landuse.farm { background: url(/images/browse/farm.png) no-repeat center left; }
+.landuse.forest { background: url(/images/browse/forest.png) no-repeat center left; }
+.landuse.industrial { background: url(/images/browse/industrial.png) no-repeat center left; }
+.landuse.military { background: url(/images/browse/military.png) no-repeat center left; }
+.landuse.residential { background: url(/images/browse/residential.png) no-repeat center left; }
+.landuse.retail { background: url(/images/browse/retail.png) no-repeat center left; }
+.landuse.tourism { background: url(/images/browse/tourism.png) no-repeat center left; }
+.landuse.wood { background: url(/images/browse/wood.png) no-repeat center left; }
+
+.leisure.golf_course { background: url(/images/browse/golf.png) no-repeat center left; }
+.leisure.park { background: url(/images/browse/park.png) no-repeat center left; }
+.leisure.pitch { background: url(/images/browse/pitch.png) no-repeat center left; }
+.leisure.nature_reserve { background: url(/images/browse/reserve.png) no-repeat center left; }
+
+.natural.heath { background: url(/images/browse/heathland.png) no-repeat center left; }
+.natural.water { background: url(/images/browse/lake.png) no-repeat center left; }
+
+.railway.light_rail { background: url(/images/browse/light_rail.20.png) no-repeat center left; }
+.railway.rail { background: url(/images/browse/rail.20.png) no-repeat center left; }
+.railway.subway { background: url(/images/browse/subway.20.png) no-repeat center left; }
+.railway.tram { background: url(/images/browse/tram.20.png) no-repeat center left; }