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 "Open Data Commons Open Database License", :href => "https://opendatacommons.org/licenses/odbl/"
 
  16   @changesets.each do |changeset|
 
  17     feed.entry(changeset, :updated => changeset.closed_at, :id => changeset_url(changeset.id, :only_path => false)) do |entry|
 
  18       entry.link :rel => "alternate",
 
  19                  :href => api_changeset_url(changeset, :only_path => false),
 
  20                  :type => "application/osm+xml"
 
  21       entry.link :rel => "alternate",
 
  22                  :href => api_changeset_download_url(changeset, :only_path => false),
 
  23                  :type => "application/osmChange+xml"
 
  25       if !changeset.tags.empty? && changeset.tags.key?("comment")
 
  26         entry.title t(".feed.title_comment", :id => changeset.id, :comment => changeset.tags["comment"])
 
  28         entry.title t(".feed.title", :id => changeset.id)
 
  31       if changeset.user.data_public?
 
  32         entry.author do |author|
 
  33           author.name changeset.user.display_name
 
  34           author.uri user_url(changeset.user, :only_path => false)
 
  38       feed.content :type => "xhtml" do |xhtml|
 
  39         xhtml.style "th { text-align: left } tr { vertical-align: top }"
 
  40         xhtml.table do |table|
 
  42             tr.th t(".feed.created")
 
  43             tr.td l(changeset.created_at)
 
  46             tr.th t(".feed.closed")
 
  47             tr.td l(changeset.closed_at)
 
  49           if changeset.user.data_public?
 
  51               tr.th t(".feed.belongs_to")
 
  53                 td.a changeset.user.display_name, :href => user_url(changeset.user, :only_path => false)
 
  57           unless changeset.tags.empty?
 
  59               tr.th t("browse.tag_details.tags")
 
  61                 td.table :cellpadding => "0" do |tag_table|
 
  62                   changeset.tags.sort.each do |tag|
 
  63                     tag_table.tr do |tag_tr|
 
  64                       tag_tr.td "#{tag[0]} = #{linkify(tag[1])}"
 
  74       if changeset.bbox_valid?
 
  75         bbox = changeset.bbox.to_unscaled
 
  77         # See http://georss.org/Encodings#Geometry
 
  78         lower_corner = "#{bbox.min_lat} #{bbox.min_lon}"
 
  79         upper_corner = "#{bbox.max_lat} #{bbox.max_lon}"
 
  81         feed.georss :box, "#{lower_corner} #{upper_corner}"