]> git.openstreetmap.org Git - rails.git/blob - app/views/trace/georss.rss.builder
Merge branch 'master' into overpass
[rails.git] / app / views / trace / georss.rss.builder
1 xml.instruct!
2
3 xml.rss("version" => "2.0", 
4         "xmlns:dc" => "http://purl.org/dc/elements/1.1/",
5         "xmlns:geo" => "http://www.w3.org/2003/01/geo/wgs84_pos#",
6         "xmlns:georss" => "http://www.georss.org/georss") do
7   xml.channel do
8     xml.title t("trace.georss.title")
9     xml.description t("trace.georss.title")
10     xml.link url_for(:controller => :trace, :action => :list, :only_path => false)
11
12     xml.image do
13       xml.url image_path("mag_map-rss2.0.png")
14       xml.title t("trace.georss.title")
15       xml.width 100
16       xml.height 100
17       xml.link url_for(:controller => :trace, :action => :list, :only_path => false)
18     end
19
20     @traces.each do |trace|
21       xml.item do
22         xml.title trace.name
23
24         xml.link url_for(:controller => :trace, :action => :view, :id => trace.id, :display_name => trace.user.display_name, :only_path => false)
25         xml.guid url_for(:controller => :trace, :action => :view, :id => trace.id, :display_name => trace.user.display_name, :only_path => false)
26
27         xml.description do
28           xml.cdata! render(:partial => "description", :object => trace, :formats => [ :html ])
29         end
30
31         xml.dc :creator, trace.user.display_name
32
33         xml.pubDate trace.timestamp.to_s(:rfc822)
34
35         if trace.latitude and trace.longitude
36           xml.geo :lat, trace.latitude
37           xml.geo :long, trace.longitude
38           xml.georss :point, "#{trace.latitude} #{trace.longitude}"
39         end
40       end
41     end
42   end
43 end