From bbc700b9ac39eb4ff5f267aef6c321dc2f9f6a84 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sun, 7 Jun 2009 02:32:16 +0000 Subject: [PATCH 1/1] Don't add a entry for anonymous users --- app/views/changeset/list_user_rss.rxml | 51 ++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 app/views/changeset/list_user_rss.rxml diff --git a/app/views/changeset/list_user_rss.rxml b/app/views/changeset/list_user_rss.rxml new file mode 100644 index 000000000..4db0bd515 --- /dev/null +++ b/app/views/changeset/list_user_rss.rxml @@ -0,0 +1,51 @@ +xml.instruct! + +xml.rss("version" => "2.0", + "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('changeset.list_user_rss.title', :user => @display_name) + xml.description t('changeset.list_user_rss.description', :user => @display_name) + xml.link url_for(:controller => "user", :action => "edits", :id => @display_name, :only_path => false) + xml.image do + xml.url "http://www.openstreetmap.org/images/mag_map-rss2.0.png" + xml.title "OpenStreetMap" + xml.width "100" + xml.height "100" + xml.link url_for(:controller => "user", :action => "edits", :id => @display_name, :only_path => false) + end + + + for changeset in @edits + xml.item do + xml.title t('browse.changeset.title') + " " + h(changeset.id) + xml.link url_for(:controller => 'browse', :action => "changeset", :id => changeset.id, :only_path => false) + xml.guid url_for(:controller => 'browse', :action => "changeset", :id => changeset.id, :only_path => false) + if changeset.user.data_public? + xml.author changeset.user.display_name + end + if changeset.tags['comment'] + xml.description changeset.tags['comment'] + end + xml.pubDate changeset.created_at.to_s(:rfc822) + if changeset.user.data_public? + xml.comments url_for(:controller => "message", :action => "new", :id => changeset.user.id, :only_path => false) + end + + unless changeset.min_lat.nil? + minlon = changeset.min_lon/GeoRecord::SCALE.to_f + minlat = changeset.min_lat/GeoRecord::SCALE.to_f + maxlon = changeset.max_lon/GeoRecord::SCALE.to_f + maxlat = changeset.max_lat/GeoRecord::SCALE.to_f + + # See http://georss.org/Encodings#Geometry + lower_corner = "#{minlat} #{minlon}" + upper_corner = "#{maxlat} #{maxlon}" + + xml.georss :box, lower_corner + " " + upper_corner + end + end + end + end +end + -- 2.43.2