Added feeds auto discovery links on projects/show (patch by Nicolas Chuche).

Also fixed 'issue changes details' feed title.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@647 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2007-08-16 11:01:00 +00:00
parent 2f0edb0b61
commit 1f991c6a79
7 changed files with 22 additions and 6 deletions

View File

@ -69,7 +69,7 @@ class FeedsController < ApplicationController
:order => "#{Journal.table_name}.created_on DESC"
end
@title = (@project ? @project.name : Setting.app_title) + ": " + (query ? query.name : l(:label_reported_issues))
@title = (@project ? @project.name : Setting.app_title) + ": " + (query ? query.name : l(:label_changes_details))
headers["Content-Type"] = "application/rss+xml"
render :action => 'history_atom' if 'atom' == params[:format]
end

View File

@ -95,6 +95,8 @@ class ProjectsController < ApplicationController
@trackers = Tracker.find(:all, :order => 'position')
@open_issues_by_tracker = Issue.count(:group => :tracker, :joins => "INNER JOIN #{IssueStatus.table_name} ON #{IssueStatus.table_name}.id = #{Issue.table_name}.status_id", :conditions => ["project_id=? and #{IssueStatus.table_name}.is_closed=?", @project.id, false])
@total_issues_by_tracker = Issue.count(:group => :tracker, :conditions => ["project_id=?", @project.id])
@key = logged_in_user.get_or_create_rss_key.value if logged_in_user
end
def settings

View File

@ -21,5 +21,7 @@ class WelcomeController < ApplicationController
def index
@news = News.latest logged_in_user
@projects = Project.latest logged_in_user
@key = logged_in_user.get_or_create_rss_key.value if logged_in_user
end
end

View File

@ -4,7 +4,7 @@ xml.rss "version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/" do
xml.title @title
xml.link url_for(:controller => 'welcome', :only_path => false)
xml.pubDate CGI.rfc1123_date(@journals.first ? @journals.first.created_on : Time.now)
xml.description l(:label_reported_issues)
xml.description l(:label_changes_details)
@journals.each do |journal|
issue = journal.issue
xml.item do

View File

@ -17,4 +17,4 @@ xml.rss "version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/" do
end
end
end
end
end

View File

@ -56,4 +56,15 @@
<p class="textcenter"><small><%= link_to l(:label_news_view_all), :controller => 'projects', :action => 'list_news', :id => @project %></small></p>
</div>
<% end %>
</div>
</div>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:rss, {:controller => 'feeds', :action => 'issues', :project_id => @project, :key => @key}, {:title => l(:label_reported_issues)}) %>
<%= auto_discovery_link_tag(:atom, {:controller => 'feeds', :action => 'issues', :project_id => @project, :key => @key, :format => 'atom'}, {:title => l(:label_reported_issues)}) %>
<%= auto_discovery_link_tag(:rss, {:controller => 'feeds', :action => 'history', :project_id => @project, :key => @key }, {:title => l(:label_changes_details)}) %>
<%= auto_discovery_link_tag(:atom, {:controller => 'feeds', :action => 'history', :project_id => @project, :key => @key, :format => 'atom'}, {:title => l(:label_changes_details)}) %>
<%= auto_discovery_link_tag(:rss, {:controller => 'feeds', :action => 'news', :project_id => @project, :key => @key}, {:title => l(:label_news_latest)}) %>
<%= auto_discovery_link_tag(:atom, {:controller => 'feeds', :action => 'news', :project_id => @project, :key => @key, :format => 'atom'}, {:title => l(:label_news_latest)}) %>
<% end %>

View File

@ -23,5 +23,6 @@
</div>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:rss, {:controller => 'feeds' , :action => 'news' }) %>
<% end %>
<%= auto_discovery_link_tag(:rss, {:controller => 'feeds', :action => 'news', :key => @key}, {:title => l(:label_news_latest)}) %>
<%= auto_discovery_link_tag(:atom, {:controller => 'feeds', :action => 'news', :key => @key, :format => 'atom'}, {:title => l(:label_news_latest)}) %>
<% end %>