Move changeset comments controller to feeds module

This commit is contained in:
Anton Khorev 2024-08-23 17:40:26 +03:00
parent 30f975c609
commit 09d5ae68dd
11 changed files with 139 additions and 134 deletions

View file

@ -0,0 +1,7 @@
<h2><%= t ".comment",
:author => comment.author.display_name,
:changeset_id => comment.changeset.id.to_s %></h2>
<div class="changeset-comment" style="margin-top: 5px">
<div class="changeset-comment-description" style="font-size: smaller; color: #999999"><%= t ".commented_at_by_html", :when => friendly_date_ago(comment.created_at), :user => comment.author.display_name %></div>
<div class="changeset-comment-text"><%= comment.body %></div>
</div>

View file

@ -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

View file

@ -0,0 +1,13 @@
xml.rss("version" => "2.0",
"xmlns:dc" => "http://purl.org/dc/elements/1.1/") do
xml.channel do
if @changeset
xml.title t(".title_particular", :changeset_id => @changeset.id)
else
xml.title t(".title_all")
end
xml.link root_url
xml << render(:partial => "comment", :collection => @comments)
end
end

View file

@ -0,0 +1,12 @@
atom_feed(:language => I18n.locale, :schema_date => 2009,
:id => url_for(params.merge(:only_path => false)),
:root_url => url_for(params.merge(:only_path => false, :format => nil)),
"xmlns:georss" => "http://www.georss.org/georss") do |feed|
feed.title @title
feed.subtitle :type => "xhtml" do |xhtml|
xhtml.p do |p|
p << t(".sorry")
end
end
end

View file

@ -0,0 +1 @@
<p><%= t ".sorry" %></p>