Feature #1521 » rss.patch
| app/controllers/issues_controller.rb (working copy) | ||
|---|---|---|
|
respond_to do |format|
|
||
|
format.html { }
|
||
|
format.atom { }
|
||
|
format.rss { }
|
||
|
format.csv { limit = Setting.issues_export_limit.to_i }
|
||
|
format.pdf { limit = Setting.issues_export_limit.to_i }
|
||
|
end
|
||
| ... | ... | |
|
:offset => @issue_pages.current.offset
|
||
|
respond_to do |format|
|
||
|
format.html { render :template => 'issues/index.rhtml', :layout => !request.xhr? }
|
||
|
format.atom { render_feed(@issues, :title => l(:label_issue_plural)) }
|
||
|
format.atom { render_feed(@issues, :format => 'atom', :title => l(:label_issue_plural)) }
|
||
|
format.rss { render_feed(@issues, :format => 'rss', :title => l(:label_issue_plural)) }
|
||
|
format.csv { send_data(issues_to_csv(@issues, @project).read, :type => 'text/csv; header=present', :filename => 'export.csv') }
|
||
|
format.pdf { send_data(render(:template => 'issues/index.rfpdf', :layout => false), :type => 'application/pdf', :filename => 'export.pdf') }
|
||
|
end
|
||
| ... | ... | |
|
respond_to do |format|
|
||
|
format.html { render :template => 'issues/show.rhtml' }
|
||
|
format.atom { render :action => 'changes', :layout => false, :content_type => 'application/atom+xml' }
|
||
|
format.rss { render :action => 'changes', :layout => false, :content_type => 'application/rss+xml' }
|
||
|
format.pdf { send_data(render(:template => 'issues/show.rfpdf', :layout => false), :type => 'application/pdf', :filename => "#{@project.identifier}-#{@issue.id}.pdf") }
|
||
|
end
|
||
|
end
|
||
| app/controllers/application.rb (working copy) | ||
|---|---|---|
|
@items.sort! {|x,y| y.event_datetime <=> x.event_datetime }
|
||
|
@items = @items.slice(0, Setting.feeds_limit.to_i)
|
||
|
@title = options[:title] || Setting.app_title
|
||
|
render :template => "common/feed.atom.rxml", :layout => false, :content_type => 'application/atom+xml'
|
||
|
format = options[:format] || 'atom'
|
||
|
render :template => "common/feed.#{format}.rxml", :layout => false, :content_type => "application/#{format}+xml"
|
||
|
end
|
||
|
|
||
|
def self.accept_key_auth(*actions)
|
||
| app/views/common/feed.rss.rxml (revision 0) | ||
|---|---|---|
|
xml.instruct!
|
||
|
xml.rss "version" => "2.0" do
|
||
|
xml.channel do
|
||
|
xml.title truncate_single_line(@title, 100)
|
||
|
xml.language "en-us"
|
||
|
xml.link url_for(params.merge({:format => nil, :only_path => false}))
|
||
|
xml.description ""
|
||
|
xml.lastBuildDate((@items.first ? @items.first.event_datetime : Time.now).strftime("%a, %d %b %Y %H:%M:%S CST"))
|
||
|
xml.generator Redmine::Info.url
|
||
|
@items.each do |item|
|
||
|
xml.item do
|
||
|
url = url_for(item.event_url(:only_path => false))
|
||
|
if @project
|
||
|
xml.title truncate_single_line(item.event_title, 100)
|
||
|
else
|
||
|
xml.title truncate_single_line("#{item.project} - #{item.event_title}", 100)
|
||
|
end
|
||
|
xml.link url
|
||
|
xml.guid url
|
||
|
xml.pubDate item.event_datetime.strftime("%a, %d %b %Y %H:%M:%S CST")
|
||
|
author = item.event_author if item.respond_to?(:event_author)
|
||
|
if author then
|
||
|
author = "#{author.mail} (#{author})" if author.respond_to?(:mail) && !author.mail.blank?
|
||
|
xml.author(author)
|
||
|
end
|
||
|
xml.description do
|
||
|
xml.text! textilizable(item.event_description)
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
| app/views/issues/index.rhtml (working copy) | ||
|---|---|---|
|
<p class="other-formats">
|
||
|
<%= l(:label_export_to) %>
|
||
|
<span><%= link_to 'Atom', {:query_id => @query, :format => 'atom', :key => User.current.rss_key}, :class => 'feed' %></span>
|
||
|
<span><%= link_to 'RSS', {:query_id => @query, :format => 'rss', :key => User.current.rss_key}, :class => 'feed' %></span>
|
||
|
<span><%= link_to 'CSV', {:format => 'csv'}, :class => 'csv' %></span>
|
||
|
<span><%= link_to 'PDF', {:format => 'pdf'}, :class => 'pdf' %></span>
|
||
|
</p>
|
||
| ... | ... | |
|
<% end %>
|
||
|
<% content_for :header_tags do %>
|
||
|
<%= auto_discovery_link_tag(:atom, {:query_id => @query, :format => 'atom', :page => nil, :key => User.current.rss_key}, :title => l(:label_issue_plural)) %>
|
||
|
<%= auto_discovery_link_tag(:atom, {:action => 'changes', :query_id => @query, :format => 'atom', :page => nil, :key => User.current.rss_key}, :title => l(:label_changes_details)) %>
|
||
|
<%= auto_discovery_link_tag(:atom, {:query_id => @query, :format => 'atom', :page => nil, :key => User.current.rss_key}, :title => l(:label_issue_plural) + " (atom)") %>
|
||
|
<%= auto_discovery_link_tag(:atom, {:action => 'changes', :query_id => @query, :format => 'atom', :page => nil, :key => User.current.rss_key}, :title => l(:label_changes_details) + " (atom)") %>
|
||
|
<%= auto_discovery_link_tag(:rss, {:query_id => @query, :format => 'rss', :page => nil, :key => User.current.rss_key}, :title => l(:label_issue_plural) + " (rss)") %>
|
||
|
<%= auto_discovery_link_tag(:rss, {:action => 'changes', :query_id => @query, :format => 'rss', :page => nil, :key => User.current.rss_key}, :title => l(:label_changes_details) + " (rss)") %>
|
||
|
<%= javascript_include_tag 'context_menu' %>
|
||
|
<%= stylesheet_link_tag 'context_menu' %>
|
||
|
<% end %>
|
||
| app/views/issues/show.rhtml (working copy) | ||
|---|---|---|
|
<p class="other-formats">
|
||
|
<%= l(:label_export_to) %>
|
||
|
<span><%= link_to 'Atom', {:format => 'atom', :key => User.current.rss_key}, :class => 'feed' %></span>
|
||
|
<span><%= link_to 'RSS', {:format => 'rss', :key => User.current.rss_key}, :class => 'feed' %></span>
|
||
|
<span><%= link_to 'PDF', {:format => 'pdf'}, :class => 'pdf' %></span>
|
||
|
</p>
|
||
| ... | ... | |
|
<% end %>
|
||
|
<% content_for :header_tags do %>
|
||
|
<%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@issue.project} - #{@issue.tracker} ##{@issue.id}: #{@issue.subject}") %>
|
||
|
<%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@issue.project} - #{@issue.tracker} ##{@issue.id}: #{@issue.subject} (atom)") %>
|
||
|
<%= auto_discovery_link_tag(:rss, {:format => 'rss', :key => User.current.rss_key}, :title => "#{@issue.project} - #{@issue.tracker} ##{@issue.id}: #{@issue.subject} (rss)") %>
|
||
|
<%= stylesheet_link_tag 'scm' %>
|
||
|
<% end %>
|
||
- « Previous
- 1
- 2
- Next »