Adds new projects atom feed (#1290).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1465 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2008-05-27 16:49:18 +00:00
parent 744d866926
commit eb0e218603
2 changed files with 17 additions and 4 deletions

View File

@ -49,8 +49,16 @@ class ProjectsController < ApplicationController
projects = Project.find :all, projects = Project.find :all,
:conditions => Project.visible_by(User.current), :conditions => Project.visible_by(User.current),
:include => :parent :include => :parent
respond_to do |format|
format.html {
@project_tree = projects.group_by {|p| p.parent || p} @project_tree = projects.group_by {|p| p.parent || p}
@project_tree.each_key {|p| @project_tree[p] -= [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 end
# Add a new project # Add a new project

View File

@ -17,9 +17,14 @@
<% end %> <% end %>
<% if User.current.logged? %> <% if User.current.logged? %>
<div class="contextual"> <p style="text-align:right;">
<span class="icon icon-fav"><%= l(:label_my_projects) %></span> <span class="icon icon-fav"><%= l(:label_my_projects) %></span>
</div> </p>
<% end %> <% 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)) -%> <% html_title(l(:label_project_plural)) -%>