##// END OF EJS Templates
Added atom feed on the new cross-project issue list....
Jean-Philippe Lang -
r675:c68dac7e9ad0
parent child
Show More
@@ -135,8 +135,9 class ApplicationController < ActionController::Base
135 return false
135 return false
136 end
136 end
137
137
138 def render_feed(items, options={})
138 def render_feed(items, options={})
139 @items = items.sort {|x,y| y.event_datetime <=> x.event_datetime }
139 @items = items || []
140 @items.sort! {|x,y| y.event_datetime <=> x.event_datetime }
140 @title = options[:title] || Setting.app_title
141 @title = options[:title] || Setting.app_title
141 render :template => "common/feed.atom.rxml", :layout => false, :content_type => 'application/atom+xml'
142 render :template => "common/feed.atom.rxml", :layout => false, :content_type => 'application/atom+xml'
142 end
143 end
@@ -18,6 +18,7
18 class IssuesController < ApplicationController
18 class IssuesController < ApplicationController
19 layout 'base', :except => :export_pdf
19 layout 'base', :except => :export_pdf
20 before_filter :find_project, :authorize, :except => :index
20 before_filter :find_project, :authorize, :except => :index
21 accept_key_auth :index
21
22
22 cache_sweeper :issue_sweeper, :only => [ :edit, :change_status, :destroy ]
23 cache_sweeper :issue_sweeper, :only => [ :edit, :change_status, :destroy ]
23
24
@@ -50,7 +51,10 class IssuesController < ApplicationController
50 :limit => @issue_pages.items_per_page,
51 :limit => @issue_pages.items_per_page,
51 :offset => @issue_pages.current.offset
52 :offset => @issue_pages.current.offset
52 end
53 end
53 render :layout => false if request.xhr?
54 respond_to do |format|
55 format.html { render :layout => false if request.xhr? }
56 format.atom { render_feed(@issues, :title => l(:label_issue_plural)) }
57 end
54 end
58 end
55
59
56 def show
60 def show
@@ -53,3 +53,7
53 [ <%= @issue_pages.current.first_item %> - <%= @issue_pages.current.last_item %> / <%= @issue_count %> ]</p>
53 [ <%= @issue_pages.current.first_item %> - <%= @issue_pages.current.last_item %> / <%= @issue_count %> ]</p>
54 <% end %>
54 <% end %>
55 <% end %>
55 <% end %>
56
57 <% content_for :header_tags do %>
58 <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
59 <% end %>
General Comments 0
You need to be logged in to leave comments. Login now