Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
f295ff84
Commit
f295ff84
authored
Nov 11, 2011
by
Nihad Abbasov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create atom feed for issues
parent
2b04c2a6
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
9 deletions
+44
-9
app/controllers/issues_controller.rb
app/controllers/issues_controller.rb
+2
-1
app/views/issues/index.atom.builder
app/views/issues/index.atom.builder
+23
-0
app/views/layouts/project.html.haml
app/views/layouts/project.html.haml
+2
-0
spec/requests/issues_spec.rb
spec/requests/issues_spec.rb
+17
-8
No files found.
app/controllers/issues_controller.rb
View file @
f295ff84
...
@@ -22,6 +22,7 @@ class IssuesController < ApplicationController
...
@@ -22,6 +22,7 @@ class IssuesController < ApplicationController
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
# index.html.erb
format
.
html
# index.html.erb
format
.
js
format
.
js
format
.
atom
{
render
:layout
=>
false
}
end
end
end
end
...
...
app/views/issues/index.atom.builder
0 → 100644
View file @
f295ff84
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
app/views/layouts/project.html.haml
View file @
f295ff84
...
@@ -7,6 +7,8 @@
...
@@ -7,6 +7,8 @@
=
javascript_include_tag
"application"
=
javascript_include_tag
"application"
-
if
current_page?
(
tree_project_path
(
@project
))
||
current_page?
(
project_commits_path
(
@project
))
-
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
}
"
)
=
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
=
csrf_meta_tags
=
javascript_tag
do
=
javascript_tag
do
REQ_URI = "
#{
request
.
env
[
"REQUEST_URI"
]
}
";
REQ_URI = "
#{
request
.
env
[
"REQUEST_URI"
]
}
";
...
...
spec/requests/issues_spec.rb
View file @
f295ff84
...
@@ -27,6 +27,15 @@ describe "Issues" do
...
@@ -27,6 +27,15 @@ describe "Issues" do
it
{
should
have_content
(
@issue
.
project
.
name
)
}
it
{
should
have_content
(
@issue
.
project
.
name
)
}
it
{
should
have_content
(
@issue
.
assignee
.
name
)
}
it
{
should
have_content
(
@issue
.
assignee
.
name
)
}
it
"should render atom feed"
do
visit
project_issues_path
(
project
,
:atom
)
page
.
response_headers
[
'Content-Type'
].
should
have_content
(
"application/atom+xml"
)
page
.
body
.
should
have_selector
(
"title"
,
:text
=>
"
#{
project
.
name
}
issues"
)
page
.
body
.
should
have_selector
(
"author email"
,
:text
=>
@issue
.
author_email
)
page
.
body
.
should
have_selector
(
"entry summary"
,
:text
=>
@issue
.
title
)
end
describe
"Destroy"
do
describe
"Destroy"
do
before
do
before
do
# admin access to remove issue
# admin access to remove issue
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment