Add some more detail to the changeset Atom feeds.
authorTom Hughes <tom@compton.nu>
Sun, 5 Jul 2009 23:46:28 +0000 (23:46 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 5 Jul 2009 23:46:28 +0000 (23:46 +0000)
app/views/browse/changeset.html.erb
app/views/changeset/list.atom.builder
config/locales/en.yml

index e5963c57f415dbd1d9a65773420016ae3c7f257b..8e110212893968f9f0c6c15d2e49fb5364386e82 100644 (file)
@@ -1,7 +1,7 @@
 <table width="100%">
   <tr>
     <td>
-      <h2><%= t 'browse.changeset.changeset' %> <%= h(@changeset.id) %></h2>
+      <h2><%= t 'browse.changeset.changeset', :id => @changeset.id %></h2>
     </td>
     <td>
       <%= render :partial => "navigation" %>
index 7c1cf8bda0ad9d9027a6fe2a2670e109f4a7ef79..650ef43756c984f80f063dcb501ed43858fc1cab 100644 (file)
@@ -36,8 +36,38 @@ atom_feed(:language => I18n.locale, :schema_date => 2009,
         end
       end
 
-      if changeset.tags['comment']
-        feed.content changeset.tags['comment']
+      feed.content :type => 'xhtml' do |xhtml|
+        xhtml.h2 t("browse.changeset.changeset", :id => changeset.id)
+        xhtml.table do |table|
+          table.tr do |tr|
+            tr.th t("browse.changeset_details.created_at")
+            tr.td l(changeset.created_at)
+          end
+          table.tr do |tr|
+            tr.th t("browse.changeset_details.closed_at")
+            tr.td l(changeset.closed_at)
+          end
+          if changeset.user.data_public?
+            table.tr do |tr|
+              tr.th t("browse.changeset_details.belongs_to")
+              tr.td link_to(h(changeset.user.display_name), :controller => "user", :action => "view", :display_name => changeset.user.display_name, :only_path => false)
+            end
+          end
+          unless changeset.tags.empty?
+            table.tr :valign => "top" do |tr|
+              tr.th t("browse.tag_details.tags")
+              tr.td do |td|
+                td.table :cellpadding => "0" do |table|
+                  changeset.tags.sort.each do |tag|
+                    table.tr do |tr|
+                      tr.td "#{h(tag[0])} = #{sanitize(auto_link(tag[1]))}"
+                    end
+                  end
+                end
+              end
+            end
+          end
+        end
       end
 
       unless changeset.min_lat.nil?
index 1bb1b5c4bc3ff3ac029bfbb786f1f92a4a35f46a..c52e9b47475ed7055704f246a359340e1012541f 100644 (file)
@@ -83,7 +83,7 @@ en:
   browse:
     changeset:
       title: "Changeset"
-      changeset: "Changeset:"
+      changeset: "Changeset: {{id}}"
       download: "Download {{changeset_xml_link}} or {{osmchange_xml_link}}"
       changesetxml: "Changeset XML"
       osmchangexml: "osmChange XML"