]> git.openstreetmap.org Git - rails.git/blob - app/views/changeset/list.rss.builder
0251367fcdaf97ae9c72d5027bf9dd25200337f6
[rails.git] / app / views / changeset / list.rss.builder
1 xml.rss("version" => "2.0", 
2         "xmlns:geo" => "http://www.w3.org/2003/01/geo/wgs84_pos#",
3         "xmlns:georss" => "http://www.georss.org/georss") do
4   xml.channel do
5     xml.title @title
6     xml.description @description
7     xml.link url_for(params.merge({ :only_path => false }))
8     xml.image do
9       xml.url "http://www.openstreetmap.org/images/mag_map-rss2.0.png"
10       xml.title "OpenStreetMap"
11       xml.width "100"
12       xml.height "100"
13       xml.link url_for(params.merge({ :only_path => false }))
14     end
15
16     for changeset in @edits
17       xml.item do
18         xml.title t('browse.changeset.title') + " " + h(changeset.id)
19         xml.link url_for(:controller => 'browse', :action => "changeset", :id => changeset.id, :only_path => false)
20         xml.guid url_for(:controller => 'browse', :action => "changeset", :id => changeset.id, :only_path => false)
21         if changeset.user.data_public?
22           xml.author changeset.user.display_name
23         end
24         if changeset.tags['comment']
25           xml.description changeset.tags['comment']
26         end
27         xml.pubDate changeset.created_at.to_s(:rfc822)
28         if changeset.user.data_public?
29           xml.comments url_for(:controller => "message", :action => "new", :id => changeset.user.id, :only_path => false)
30         end
31
32         unless changeset.min_lat.nil?
33           minlon = changeset.min_lon/GeoRecord::SCALE.to_f
34           minlat = changeset.min_lat/GeoRecord::SCALE.to_f
35           maxlon = changeset.max_lon/GeoRecord::SCALE.to_f
36           maxlat = changeset.max_lat/GeoRecord::SCALE.to_f
37
38           # See http://georss.org/Encodings#Geometry
39           lower_corner = "#{minlat} #{minlon}"
40           upper_corner = "#{maxlat} #{maxlon}"
41
42           xml.georss :box, lower_corner + " " + upper_corner
43         end
44       end
45     end
46   end
47 end