Commit 58f8a23d authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

* news rss feed added

* "header_tags" block added to allow inclusion of page specific tags in the html header (stylesheets, javascripts, feeds...)

git-svn-id: http://redmine.rubyforge.org/svn/trunk@121 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 1f3380bf
# redMine - project management software
# Copyright (C) 2006 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class FeedsController < ApplicationController
session :off
def news
@news = News.find :all, :order => 'news.created_on DESC', :limit => 10, :include => [ :author, :project ]
@headers["Content-Type"] = "application/rss+xml"
end
end
# redMine - project management software
# Copyright (C) 2006 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module FeedsHelper
end
xml.instruct!
xml.rss "version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/" do
xml.channel do
xml.title "#{$RDM_HEADER_TITLE}: #{l(:label_news_latest)}"
xml.link url_for(:controller => '', :only_path => false)
xml.pubDate CGI.rfc1123_date(@news.first.created_on)
xml.description "#{$RDM_HEADER_TITLE}: #{l(:label_news_latest)}"
@news.each do |news|
xml.item do
xml.title "#{news.project.name}: #{news.title}"
news_url = url_for(:controller => 'news' , :action => 'show', :id => news, :only_path => false)
xml.link news_url
xml.description h(news.summary)
xml.pubDate CGI.rfc1123_date(news.created_on)
xml.guid news_url
xml.author h(news.author.name)
end
end
end
end
\ No newline at end of file
......@@ -14,6 +14,8 @@
<%= javascript_include_tag 'calendar/calendar-setup' %>
<%= stylesheet_link_tag 'calendar' %>
<%= stylesheet_link_tag 'jstoolbar' %>
<!-- page specific tags -->
<%= yield :header_tags %>
</head>
<body>
......
......@@ -21,3 +21,7 @@
</ul>
</div>
</div>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:rss, {:controller => 'feeds' , :action => 'news' }) %>
<% end %>
\ No newline at end of file
......@@ -26,6 +26,7 @@ http://redmine.org/
* calendar date picker for date fields (LGPL DHTML Calendar http://sourceforge.net/projects/jscalendar)
* new filter in issues list: Author
* ajaxified paginators
* news rss feed added
* option to set number of results per page on issues list
* localized csv separator (comma/semicolon)
* csv output encoded to ISO-8859-1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment