X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/a1853204faefd8270e3db4a988ef373ea1ab342d..b446138aefb04799cc1253886335ced16e546517:/app/views/traces/georss.rss.builder diff --git a/app/views/traces/georss.rss.builder b/app/views/traces/georss.rss.builder new file mode 100644 index 000000000..66dad596d --- /dev/null +++ b/app/views/traces/georss.rss.builder @@ -0,0 +1,43 @@ +xml.instruct! + +xml.rss("version" => "2.0", + "xmlns:dc" => "http://purl.org/dc/elements/1.1/", + "xmlns:geo" => "http://www.w3.org/2003/01/geo/wgs84_pos#", + "xmlns:georss" => "http://www.georss.org/georss") do + xml.channel do + xml.title t(".title") + xml.description t(".title") + xml.link url_for(:controller => :traces, :action => :list, :only_path => false) + + xml.image do + xml.url image_url("mag_map-rss2.0.png") + xml.title t(".title") + xml.width 100 + xml.height 100 + xml.link url_for(:controller => :traces, :action => :list, :only_path => false) + end + + @traces.each do |trace| + xml.item do + xml.title trace.name + + xml.link url_for(:controller => :traces, :action => :view, :id => trace.id, :display_name => trace.user.display_name, :only_path => false) + xml.guid url_for(:controller => :traces, :action => :view, :id => trace.id, :display_name => trace.user.display_name, :only_path => false) + + xml.description do + xml.cdata! render(:partial => "description", :object => trace, :formats => [:html]) + end + + xml.dc :creator, trace.user.display_name + + xml.pubDate trace.timestamp.to_s(:rfc822) + + if trace.latitude && trace.longitude + xml.geo :lat, trace.latitude + xml.geo :long, trace.longitude + xml.georss :point, "#{trace.latitude} #{trace.longitude}" + end + end + end + end +end