diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-05-27 16:49:18 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-05-27 16:49:18 +0000 |
commit | eb0e218603fb334f3281515f15b23b246c6b351d (patch) | |
tree | 3d2f08e392f5c4fcecb3578d48499638290ef700 /app/controllers/projects_controller.rb | |
parent | 744d8669260b63a94f5cd41c6b79b8396dd47df3 (diff) | |
download | redmine-eb0e218603fb334f3281515f15b23b246c6b351d.tar.gz redmine-eb0e218603fb334f3281515f15b23b246c6b351d.zip |
Adds new projects atom feed (#1290).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1465 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/projects_controller.rb')
-rw-r--r-- | app/controllers/projects_controller.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 320def41b..d15c6bc2a 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -49,8 +49,16 @@ class ProjectsController < ApplicationController projects = Project.find :all, :conditions => Project.visible_by(User.current), :include => :parent - @project_tree = projects.group_by {|p| p.parent || p} - @project_tree.each_key {|p| @project_tree[p] -= [p]} + respond_to do |format| + format.html { + @project_tree = projects.group_by {|p| p.parent || p} + @project_tree.each_key {|p| @project_tree[p] -= [p]} + } + format.atom { + render_feed(projects.sort_by(&:created_on).reverse.slice(0, Setting.feeds_limit.to_i), + :title => "#{Setting.app_title}: #{l(:label_project_latest)}") + } + end end # Add a new project |