]> git.openstreetmap.org Git - rails.git/commitdiff
Replace collection partial with single item in changeset comments feed
authorAnton Khorev <tony29@yandex.ru>
Sun, 24 Mar 2024 04:08:59 +0000 (07:08 +0300)
committerAnton Khorev <tony29@yandex.ru>
Sun, 24 Mar 2024 04:08:59 +0000 (07:08 +0300)
app/views/changeset_comments/_comment.rss.builder [new file with mode: 0644]
app/views/changeset_comments/_comments.rss.builder [deleted file]
app/views/changeset_comments/index.rss.builder

diff --git a/app/views/changeset_comments/_comment.rss.builder b/app/views/changeset_comments/_comment.rss.builder
new file mode 100644 (file)
index 0000000..83dfadd
--- /dev/null
@@ -0,0 +1,14 @@
+xml.item do
+  xml.title t(".comment", :author => comment.author.display_name, :changeset_id => comment.changeset.id.to_s)
+
+  xml.link changeset_url(comment.changeset, :anchor => "c#{comment.id}")
+  xml.guid changeset_url(comment.changeset, :anchor => "c#{comment.id}")
+
+  xml.description do
+    xml.cdata! render(:partial => "comment", :object => comment, :formats => [:html])
+  end
+
+  xml.dc :creator, comment.author.display_name if comment.author
+
+  xml.pubDate comment.created_at.to_fs(:rfc822)
+end
diff --git a/app/views/changeset_comments/_comments.rss.builder b/app/views/changeset_comments/_comments.rss.builder
deleted file mode 100644 (file)
index b1344b4..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-comments.each do |comment|
-  xml.item do
-    xml.title t(".comment", :author => comment.author.display_name, :changeset_id => comment.changeset.id.to_s)
-
-    xml.link changeset_url(comment.changeset, :anchor => "c#{comment.id}")
-    xml.guid changeset_url(comment.changeset, :anchor => "c#{comment.id}")
-
-    xml.description do
-      xml.cdata! render(:partial => "comment", :object => comment, :formats => [:html])
-    end
-
-    xml.dc :creator, comment.author.display_name if comment.author
-
-    xml.pubDate comment.created_at.to_fs(:rfc822)
-  end
-end
index acaa54727279e21a7a6816c5f8d39fad26b5bce8..f055c20144c6c9e257552a66d5e7c4bac5fa6e70 100644 (file)
@@ -8,6 +8,6 @@ xml.rss("version" => "2.0",
     end
     xml.link url_for(:controller => "site", :action => "index", :only_path => false)
 
-    xml << render(:partial => "comments", :object => @comments)
+    xml << render(:partial => "comment", :collection => @comments)
   end
 end