summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/issues_controller.rb3
-rw-r--r--app/views/issues/index.atom.builder23
-rw-r--r--app/views/layouts/project.html.haml2
3 files changed, 27 insertions, 1 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 508cfc3974a..2ba54f3073d 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -22,6 +22,7 @@ class IssuesController < ApplicationController
respond_to do |format|
format.html # index.html.erb
format.js
+ format.atom { render :layout => false }
end
end
@@ -38,7 +39,7 @@ class IssuesController < ApplicationController
@notes = @issue.notes.order("created_at DESC").limit(20)
@note = @project.notes.new(:noteable => @issue)
- respond_to do |format|
+ respond_to do |format|
format.html
format.js { respond_with_notes }
end
diff --git a/app/views/issues/index.atom.builder b/app/views/issues/index.atom.builder
new file mode 100644
index 00000000000..00ddd4bf702
--- /dev/null
+++ b/app/views/issues/index.atom.builder
@@ -0,0 +1,23 @@
+xml.instruct!
+xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do
+ xml.title "#{@project.name} issues"
+ xml.link :href => project_issues_url(@project, :atom), :rel => "self", :type => "application/atom+xml"
+ xml.link :href => project_issues_url(@project), :rel => "alternate", :type => "text/html"
+ xml.id project_issues_url(@project)
+ xml.updated @issues.first.created_at.strftime("%Y-%m-%dT%H:%M:%SZ") if @issues.any?
+
+ @issues.each do |issue|
+ xml.entry do
+ xml.id project_issue_url(@project, issue)
+ xml.link :href => project_issue_url(@project, issue)
+ xml.title truncate(issue.title, :length => 80)
+ xml.updated issue.created_at.strftime("%Y-%m-%dT%H:%M:%SZ")
+ xml.media :thumbnail, :width => "40", :height => "40", :url => gravatar_icon(issue.author_email)
+ xml.author do |author|
+ xml.name issue.author_name
+ xml.email issue.author_email
+ end
+ xml.summary issue.title
+ end
+ end
+end
diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project.html.haml
index 927d62db295..4fb3354bc02 100644
--- a/app/views/layouts/project.html.haml
+++ b/app/views/layouts/project.html.haml
@@ -7,6 +7,8 @@
= javascript_include_tag "application"
- if current_page?(tree_project_path(@project)) || current_page?(project_commits_path(@project))
= auto_discovery_link_tag(:atom, project_commits_url(@project, :atom, :ref => @ref), :title => "Recent commits to #{@project.name}:#{@ref}")
+ - if request.path == project_issues_path(@project)
+ = auto_discovery_link_tag(:atom, project_issues_url(@project, :atom), :title => "#{@project.name} issues")
= csrf_meta_tags
= javascript_tag do
REQ_URI = "#{request.env["REQUEST_URI"]}";