]> source.dussan.org Git - redmine.git/commitdiff
Adds new projects atom feed (#1290).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 27 May 2008 16:49:18 +0000 (16:49 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 27 May 2008 16:49:18 +0000 (16:49 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1465 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/projects_controller.rb
app/views/projects/index.rhtml

index 320def41b94d3087dba97ae9b1706f5559da0981..d15c6bc2ab53ac34c1360438b463f9eb4b19d1e1 100644 (file)
@@ -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
index b8bb62ebb05ac8f3fa24c86dbc6cc58a11dc2919..e12b0597914b37defa2cf6a61873abd1b62e9f79 100644 (file)
 <% end %>
 
 <% if User.current.logged? %>
-<div class="contextual">
+<p style="text-align:right;">
 <span class="icon icon-fav"><%= l(:label_my_projects) %></span>
-</div>
+</p>
 <% end %>
 
+<p class="other-formats">
+<%= l(:label_export_to) %>
+<span><%= link_to 'Atom', {:format => 'atom', :key => User.current.rss_key}, :class => 'feed' %></span>
+</p>
+
 <% html_title(l(:label_project_plural)) -%>