1 atom_feed(:language => I18n.locale, :schema_date => 2009,
2 :id => url_for(params.merge({ :only_path => false })),
3 :root_url => url_for(params.merge({ :action => :list, :format => nil, :only_path => false })),
4 "xmlns:georss" => "http://www.georss.org/georss") do |feed|
7 feed.updated @edits.map {|e| [e.created_at, e.closed_at].max }.max
8 feed.icon "http://#{SERVER_URL}/favicon.ico"
9 feed.logo "http://#{SERVER_URL}/images/mag_map-rss2.0.png"
11 feed.rights :type => 'xhtml' do |xhtml|
12 xhtml.a :href => "http://creativecommons.org/licenses/by-sa/2.0/" do |a|
13 a.img :src => "http://#{SERVER_URL}/images/cc_button.png", :alt => "CC by-sa 2.0"
17 for changeset in @edits
18 feed.entry(changeset, :updated => changeset.closed_at, :id => changeset_url(changeset.id, :only_path => false)) do |entry|
19 entry.link :rel => "alternate",
20 :href => changeset_read_url(changeset, :only_path => false),
21 :type => "application/osm+xml"
22 entry.link :rel => "alternate",
23 :href => changeset_download_url(changeset, :only_path => false),
24 :type => "application/osmChange+xml"
26 if !changeset.tags.empty? and changeset.tags.has_key? "comment"
27 entry.title t('browse.changeset.feed.title_comment', :id => h(changeset.id), :comment => h(changeset.tags['comment'])), :type => "html"
29 entry.title t('browse.changeset.feed.title', :id => h(changeset.id))
32 if changeset.user.data_public?
33 entry.author do |author|
34 author.name changeset.user.display_name
35 author.uri url_for(:controller => 'user', :action => 'view', :display_name => changeset.user.display_name, :only_path => false)
39 feed.content :type => 'xhtml' do |xhtml|
40 xhtml.style "th { text-align: left } tr { vertical-align: top }"
41 xhtml.table do |table|
43 tr.th t("browse.changeset_details.created_at")
44 tr.td l(changeset.created_at)
47 tr.th t("browse.changeset_details.closed_at")
48 tr.td l(changeset.closed_at)
50 if changeset.user.data_public?
52 tr.th t("browse.changeset_details.belongs_to")
54 td.a h(changeset.user.display_name), :href => url_for(:controller => "user", :action => "view", :display_name => changeset.user.display_name, :only_path => false)
58 unless changeset.tags.empty?
60 tr.th t("browse.tag_details.tags")
62 td.table :cellpadding => "0" do |table|
63 changeset.tags.sort.each do |tag|
65 tr.td << "#{h(tag[0])} = #{auto_link(h(tag[1]))}"
75 if changeset.has_valid_bbox?
76 bbox = changeset.bbox.to_unscaled
78 # See http://georss.org/Encodings#Geometry
79 lower_corner = "#{bbox.min_lat} #{bbox.min_lon}"
80 upper_corner = "#{bbox.max_lat} #{bbox.max_lon}"
82 feed.georss :box, lower_corner + " " + upper_corner