summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-08-31 20:22:36 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-08-31 20:22:36 +0000
commitc68dac7e9ad0e4f8d46a5799de7aef75d28da664 (patch)
treede79ceee270e792f5eb136a9768141335b1b1c97 /app/controllers
parent6bdc13b33d8d8d2052d029ac8f99ad0f62df6211 (diff)
downloadredmine-c68dac7e9ad0e4f8d46a5799de7aef75d28da664.tar.gz
redmine-c68dac7e9ad0e4f8d46a5799de7aef75d28da664.zip
Added atom feed on the new cross-project issue list.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@686 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/application.rb5
-rw-r--r--app/controllers/issues_controller.rb6
2 files changed, 8 insertions, 3 deletions
diff --git a/app/controllers/application.rb b/app/controllers/application.rb
index b1e2b3d73..9a7096728 100644
--- a/app/controllers/application.rb
+++ b/app/controllers/application.rb
@@ -135,8 +135,9 @@ class ApplicationController < ActionController::Base
return false
end
- def render_feed(items, options={})
- @items = items.sort {|x,y| y.event_datetime <=> x.event_datetime }
+ def render_feed(items, options={})
+ @items = items || []
+ @items.sort! {|x,y| y.event_datetime <=> x.event_datetime }
@title = options[:title] || Setting.app_title
render :template => "common/feed.atom.rxml", :layout => false, :content_type => 'application/atom+xml'
end
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index fe1c78884..b83d950ea 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -18,6 +18,7 @@
class IssuesController < ApplicationController
layout 'base', :except => :export_pdf
before_filter :find_project, :authorize, :except => :index
+ accept_key_auth :index
cache_sweeper :issue_sweeper, :only => [ :edit, :change_status, :destroy ]
@@ -50,7 +51,10 @@ class IssuesController < ApplicationController
:limit => @issue_pages.items_per_page,
:offset => @issue_pages.current.offset
end
- render :layout => false if request.xhr?
+ respond_to do |format|
+ format.html { render :layout => false if request.xhr? }
+ format.atom { render_feed(@issues, :title => l(:label_issue_plural)) }
+ end
end
def show