diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-03-17 15:18:50 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-03-17 15:18:50 +0000 |
commit | 10cf1ccc1abe1c6ffdf21259b54292f9068b569c (patch) | |
tree | d43c2fd622b2126f72672d177f482e4934106e3d /app/views | |
parent | 22b42dc90a86b16904224bf638054fffd062b53f (diff) | |
download | redmine-10cf1ccc1abe1c6ffdf21259b54292f9068b569c.tar.gz redmine-10cf1ccc1abe1c6ffdf21259b54292f9068b569c.zip |
added rss/atom feeds at project levels for:
* news
* new issues reported
* details of issue changes
issue cutom queries can be used as feeds
git-svn-id: http://redmine.rubyforge.org/svn/trunk@339 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/feeds/history.rxml | 28 | ||||
-rw-r--r-- | app/views/feeds/history_atom.rxml | 28 | ||||
-rw-r--r-- | app/views/feeds/issues.rxml | 20 | ||||
-rw-r--r-- | app/views/feeds/issues_atom.rxml | 22 | ||||
-rw-r--r-- | app/views/feeds/news.rxml | 38 | ||||
-rw-r--r-- | app/views/feeds/news_atom.rxml | 22 | ||||
-rw-r--r-- | app/views/projects/feeds.rhtml | 33 | ||||
-rw-r--r-- | app/views/projects/show.rhtml | 4 |
8 files changed, 176 insertions, 19 deletions
diff --git a/app/views/feeds/history.rxml b/app/views/feeds/history.rxml new file mode 100644 index 000000000..b7e5a3509 --- /dev/null +++ b/app/views/feeds/history.rxml @@ -0,0 +1,28 @@ +xml.instruct! +xml.rss "version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/" do + xml.channel 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) + @journals.each do |journal| + issue = journal.issue + xml.item do + xml.title "#{issue.project.name} - #{issue.tracker.name} ##{issue.id}: #{issue.subject}" + url = url_for(:controller => 'issues' , :action => 'show', :id => issue, :only_path => false) + xml.link url + xml.description do + xml.text! h(journal.notes) + xml.text! "<ul>" + journal.details.each do |detail| + xml.text! "<li>" + show_detail(detail, false) + "</li>" + end + xml.text! "</ul>" + end + xml.pubDate CGI.rfc1123_date(journal.created_on) + xml.guid url + xml.author h(journal.user.name) + end + end + end +end
\ No newline at end of file diff --git a/app/views/feeds/history_atom.rxml b/app/views/feeds/history_atom.rxml new file mode 100644 index 000000000..9d82ef606 --- /dev/null +++ b/app/views/feeds/history_atom.rxml @@ -0,0 +1,28 @@ +xml.instruct! +xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do + xml.title @title + xml.link "rel" => "self", "href" => url_for(:controller => 'feeds', :action => 'history', :format => 'atom', :only_path => false) + xml.link "rel" => "alternate", "href" => url_for(:controller => 'welcome', :only_path => false) + xml.id url_for(:controller => 'welcome', :only_path => false) + xml.updated CGI.rfc1123_date(@journals.first.created_on) if @journals.any? + xml.author { xml.name "#{Setting.app_title}" } + @journals.each do |journal| + issue = journal.issue + xml.entry do + xml.title "#{issue.project.name} - #{issue.tracker.name} ##{issue.id}: #{issue.subject}" + xml.link "rel" => "alternate", "href" => url_for(:controller => 'issues' , :action => 'show', :id => issue, :only_path => false) + xml.id url_for(:controller => 'issues' , :action => 'show', :id => issue, :only_path => false) + xml.updated CGI.rfc1123_date(journal.created_on) + xml.author { xml.name journal.user.name } + xml.summary journal.notes + xml.content "type" => "html" do + xml.text! journal.notes + xml.text! "<ul>" + journal.details.each do |detail| + xml.text! "<li>" + show_detail(detail, false) + "</li>" + end + xml.text! "</ul>" + end + end + end +end
\ No newline at end of file diff --git a/app/views/feeds/issues.rxml b/app/views/feeds/issues.rxml new file mode 100644 index 000000000..fb120b7cb --- /dev/null +++ b/app/views/feeds/issues.rxml @@ -0,0 +1,20 @@ +xml.instruct! +xml.rss "version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/" do + xml.channel do + xml.title @title + xml.link url_for(:controller => 'welcome', :only_path => false) + xml.pubDate CGI.rfc1123_date(@issues.first ? @issues.first.created_on : Time.now) + xml.description l(:label_reported_issues) + @issues.each do |issue| + xml.item do + xml.title "#{issue.project.name} - #{issue.tracker.name} ##{issue.id}: #{issue.subject}" + url = url_for(:controller => 'issues' , :action => 'show', :id => issue, :only_path => false) + xml.link url + xml.description h(issue.description) + xml.pubDate CGI.rfc1123_date(issue.created_on) + xml.guid url + xml.author h(issue.author.name) + end + end + end +end
\ No newline at end of file diff --git a/app/views/feeds/issues_atom.rxml b/app/views/feeds/issues_atom.rxml new file mode 100644 index 000000000..bb15fc493 --- /dev/null +++ b/app/views/feeds/issues_atom.rxml @@ -0,0 +1,22 @@ +xml.instruct! +xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do + xml.title @title + xml.link "rel" => "self", "href" => url_for(:controller => 'feeds', :action => 'issues', :format => 'atom', :only_path => false) + xml.link "rel" => "alternate", "href" => url_for(:controller => 'welcome', :only_path => false) + xml.id url_for(:controller => 'welcome', :only_path => false) + xml.updated CGI.rfc1123_date(@issues.first.updated_on) if @issues.any? + xml.author { xml.name "#{Setting.app_title}" } + @issues.each do |issue| + xml.entry do + xml.title "#{issue.project.name} - #{issue.tracker.name} ##{issue.id}: #{issue.subject}" + xml.link "rel" => "alternate", "href" => url_for(:controller => 'issues' , :action => 'show', :id => issue, :only_path => false) + xml.id url_for(:controller => 'issues' , :action => 'show', :id => issue, :only_path => false) + xml.updated CGI.rfc1123_date(issue.updated_on) + xml.author { xml.name issue.author.name } + xml.summary issue.description + xml.content "type" => "html" do + xml.text! issue.description + end + end + end +end
\ No newline at end of file diff --git a/app/views/feeds/news.rxml b/app/views/feeds/news.rxml index a85d86715..d7248b6cb 100644 --- a/app/views/feeds/news.rxml +++ b/app/views/feeds/news.rxml @@ -1,20 +1,20 @@ -xml.instruct!
-xml.rss "version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/" do
- xml.channel do
- xml.title "#{Setting.app_title}: #{l(:label_news_latest)}"
- xml.link url_for(:controller => 'welcome', :only_path => false)
- xml.pubDate CGI.rfc1123_date(@news.first ? @news.first.created_on : Time.now)
- xml.description 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
+xml.instruct! +xml.rss "version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/" do + xml.channel do + xml.title "#{Setting.app_title}: #{l(:label_news_latest)}" + xml.link url_for(:controller => 'welcome', :only_path => false) + xml.pubDate CGI.rfc1123_date(@news.first ? @news.first.created_on : Time.now) + xml.description 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 diff --git a/app/views/feeds/news_atom.rxml b/app/views/feeds/news_atom.rxml new file mode 100644 index 000000000..2550341c8 --- /dev/null +++ b/app/views/feeds/news_atom.rxml @@ -0,0 +1,22 @@ +xml.instruct! +xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do + xml.title "#{Setting.app_title}: #{l(:label_news_latest)}" + xml.link "rel" => "self", "href" => url_for(:controller => 'feeds', :action => 'news', :format => 'atom', :only_path => false) + xml.link "rel" => "alternate", "href" => url_for(:controller => 'welcome', :only_path => false) + xml.id url_for(:controller => 'welcome', :only_path => false) + xml.updated CGI.rfc1123_date(@news.first.created_on) if @news.any? + xml.author { xml.name "#{Setting.app_title}" } + @news.each do |news| + xml.entry do + xml.title news.title + xml.link "rel" => "alternate", "href" => url_for(:controller => 'news' , :action => 'show', :id => news, :only_path => false) + xml.id url_for(:controller => 'news' , :action => 'show', :id => news, :only_path => false) + xml.updated CGI.rfc1123_date(news.created_on) + xml.author { xml.name news.author.name } + xml.summary h(news.summary) + xml.content "type" => "html" do + xml.text! news.description + end + end + end +end
\ No newline at end of file diff --git a/app/views/projects/feeds.rhtml b/app/views/projects/feeds.rhtml new file mode 100644 index 000000000..037469a8a --- /dev/null +++ b/app/views/projects/feeds.rhtml @@ -0,0 +1,33 @@ +<h2><%= l(:label_feed_plural) %> (<%=h @project.name %>)</h2> + +<table> + +<tr><td colspan="3"><h3><%= l(:label_issue_plural) %></h3></td></tr> +<tr><td><%= l(:label_reported_issues) %></td> +<td><%= link_to 'RSS', {:controller => 'feeds', :action => 'issues', :project_id => @project, :key => @key}, :class => 'icon icon-feed' %></td> +<td><%= link_to 'Atom', {:controller => 'feeds', :action => 'issues', :project_id => @project, :key => @key, :format => 'atom'}, :class => 'icon icon-feed' %></td> +</tr> +<tr><td><%= l(:label_changes_details) %></td> +<td><%= link_to 'RSS', {:controller => 'feeds', :action => 'history', :project_id => @project, :key => @key}, :class => 'icon icon-feed' %></td> +<td><%= link_to 'Atom', {:controller => 'feeds', :action => 'history', :project_id => @project, :key => @key, :format => 'atom'}, :class => 'icon icon-feed' %></td> +</tr> + +<% @queries.each do |query| %> +<tr><td colspan="3"><h4><%=h query.name %></h4></td></tr> +<tr><td><%= l(:label_reported_issues) %></td> +<td><%= link_to 'RSS', {:controller => 'feeds', :action => 'issues', :project_id => @project, :query_id => query, :key => @key}, :class => 'icon icon-feed' %></td> +<td><%= link_to 'Atom', {:controller => 'feeds', :action => 'issues', :project_id => @project, :query_id => query, :key => @key, :format => 'atom'}, :class => 'icon icon-feed' %></td> +</tr> +<tr><td><%= l(:label_changes_details) %></td> +<td><%= link_to 'RSS', {:controller => 'feeds', :action => 'history', :project_id => @project, :query_id => query, :key => @key}, :class => 'icon icon-feed' %></td> +<td><%= link_to 'Atom', {:controller => 'feeds', :action => 'history', :project_id => @project, :query_id => query, :key => @key, :format => 'atom'}, :class => 'icon icon-feed' %></td> +</tr> +<% end %> + +<tr><td colspan="3"> <h3><%= l(:label_news_plural) %></h3></td></tr> +<tr><td><%= l(:label_news_latest) %></td> +<td><%= link_to 'RSS', {:controller => 'feeds', :action => 'news', :project_id => @project, :key => @key}, :class => 'icon icon-feed' %></td> +<td><%= link_to 'Atom', {:controller => 'feeds', :action => 'news', :project_id => @project, :key => @key, :format => 'atom'}, :class => 'icon icon-feed' %></td> +</tr> + +</table>
\ No newline at end of file diff --git a/app/views/projects/show.rhtml b/app/views/projects/show.rhtml index b38eceaac..9ecbbb663 100644 --- a/app/views/projects/show.rhtml +++ b/app/views/projects/show.rhtml @@ -1,3 +1,7 @@ +<div class="contextual"> +<%= link_to l(:label_feed_plural), {:action => 'feeds', :id => @project}, :class => 'icon icon-feed' %> +</div> + <h2><%=l(:label_overview)%></h2> <div class="splitcontentleft"> |