Project

General

Profile

Defect #33829 » patch_trunk_r19958_pt1.diff

note-3 patch pattern 1 - Tatsuya Saito, 2020-08-08 17:26

View differences:

app/controllers/application_controller.rb (working copy)
end
def render_feed(items, options={})
@type = options[:type]
@items = (items || []).to_a
@items.sort! {|x,y| y.event_datetime <=> x.event_datetime }
if @type == :issues
@items.sort! {|x,y| y.updated_on <=> x.updated_on }
else
@items.sort! {|x,y| y.event_datetime <=> x.event_datetime }
end
@items = @items.slice(0, Setting.feeds_limit.to_i)
@title = options[:title] || Setting.app_title
render :template => "common/feed", :formats => [:atom], :layout => false,
app/controllers/issues_controller.rb (working copy)
format.atom do
@issues = @query.issues(:limit => Setting.feeds_limit.to_i)
render_feed(@issues,
:title => "#{@project || Setting.app_title}: #{l(:label_issue_plural)}")
:title => "#{@project || Setting.app_title}: #{l(:label_issue_plural)}",
:type => :issues)
end
format.csv do
@issues = @query.issues(:limit => Setting.issues_export_limit.to_i)
app/views/common/feed.atom.builder (working copy)
xml.link "rel" => "alternate", "href" => url_for(:params => request.query_parameters.merge(:format => nil, :key => nil), :only_path => false, :protocol => protocol, :host => host)
xml.id home_url
xml.icon favicon_url
xml.updated((@items.first ? @items.first.event_datetime : Time.now).xmlschema)
xml.updated((@items.first ? (@type == :issues ? @items.first.updated_on : @items.first.event_datetime) : Time.now).xmlschema)
xml.author { xml.name "#{Setting.app_title}" }
xml.generator(:uri => Redmine::Info.url) { xml.text! Redmine::Info.app_name; }
@items.each do |item|
......
end
xml.link "rel" => "alternate", "href" => url
xml.id url
xml.updated item.event_datetime.xmlschema
xml.updated (@type == :issues ? item.updated_on : item.event_datetime).xmlschema
author = item.event_author if item.respond_to?(:event_author)
xml.author do
xml.name(author)
(2-2/4)