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 => :index, :format => nil, :only_path => false)),
4 "xmlns:xhtml" => "http://www.w3.org/1999/xhtml",
5 "xmlns:georss" => "http://www.georss.org/georss") do |feed|
6 feed.title changeset_index_title(params, current_user)
8 feed.updated @changesets.map { |e| [e.created_at, e.closed_at].max }.max
9 feed.icon image_url("favicon.ico")
10 feed.logo image_url("mag_map-rss2.0.png")
12 feed.rights :type => "xhtml" do |xhtml|
13 xhtml.a :href => "https://creativecommons.org/licenses/by-sa/2.0/" do |a|
14 a.img :src => image_url("cc_button.png"), :alt => "CC by-sa 2.0"
18 @changesets.each do |changeset|
19 feed.entry(changeset, :updated => changeset.closed_at, :id => changeset_url(changeset.id, :only_path => false)) do |entry|
20 entry.link :rel => "alternate",
21 :href => changeset_show_url(changeset, :only_path => false),
22 :type => "application/osm+xml"
23 entry.link :rel => "alternate",
24 :href => changeset_download_url(changeset, :only_path => false),
25 :type => "application/osmChange+xml"
27 if !changeset.tags.empty? && changeset.tags.key?("comment")
28 entry.title t(".feed.title_comment", :id => changeset.id, :comment => changeset.tags["comment"])
30 entry.title t(".feed.title", :id => changeset.id)
33 if changeset.user.data_public?
34 entry.author do |author|
35 author.name changeset.user.display_name
36 author.uri user_url(changeset.user, :only_path => false)
40 feed.content :type => "xhtml" do |xhtml|
41 xhtml.style "th { text-align: left } tr { vertical-align: top }"
42 xhtml.table do |table|
44 tr.th t(".feed.created")
45 tr.td l(changeset.created_at)
48 tr.th t(".feed.closed")
49 tr.td l(changeset.closed_at)
51 if changeset.user.data_public?
53 tr.th t(".feed.belongs_to")
55 td.a changeset.user.display_name, :href => user_url(changeset.user, :only_path => false)
59 unless changeset.tags.empty?
61 tr.th t("browse.tag_details.tags")
63 td.table :cellpadding => "0" do |tag_table|
64 changeset.tags.sort.each do |tag|
65 tag_table.tr do |tag_tr|
66 tag_tr.td "#{tag[0]} = #{linkify(tag[1])}"
76 if changeset.bbox_valid?
77 bbox = changeset.bbox.to_unscaled
79 # See http://georss.org/Encodings#Geometry
80 lower_corner = "#{bbox.min_lat} #{bbox.min_lon}"
81 upper_corner = "#{bbox.max_lat} #{bbox.max_lon}"
83 feed.georss :box, "#{lower_corner} #{upper_corner}"