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