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
6451e837
Commit
6451e837
authored
Jul 06, 2012
by
randx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better event feed for dashboard
parent
0daf53b7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
10 deletions
+28
-10
app/decorators/event_decorator.rb
app/decorators/event_decorator.rb
+25
-0
app/views/dashboard/index.atom.builder
app/views/dashboard/index.atom.builder
+3
-10
No files found.
app/decorators/event_decorator.rb
0 → 100644
View file @
6451e837
class
EventDecorator
<
ApplicationDecorator
decorates
:event
def
feed_title
if
self
.
issue?
"
#{
self
.
author_name
}
#{
self
.
action_name
}
issue #
#{
self
.
target_id
}
:"
+
self
.
issue_title
elsif
self
.
merge_request?
"
#{
self
.
author_name
}
#{
self
.
action_name
}
MR #
#{
self
.
target_id
}
:"
+
self
.
merge_request_title
elsif
self
.
push?
"
#{
self
.
author_name
}
#{
self
.
push_action_name
}
#{
self
.
ref_type
}
"
+
self
.
ref_name
else
""
end
end
def
feed_url
if
self
.
issue?
h
.
project_issue_url
(
self
.
project
,
self
.
issue
)
elsif
self
.
merge_request?
h
.
project_merge_request_url
(
self
.
project
,
self
.
merge_request
)
elsif
self
.
push?
h
.
project_commits_url
(
self
.
project
,
:ref
=>
self
.
ref_name
)
end
end
end
app/views/dashboard/index.atom.builder
View file @
6451e837
...
...
@@ -8,17 +8,10 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
@events.each do |event|
if event.allowed?
event = EventDecorator.decorate(event)
xml.entry do
if event.issue?
event_link = project_issue_url(event.project, event.issue)
event_title = event.issue_title
elsif event.merge_request?
event_link = project_merge_request_url(event.project, event.merge_request)
event_title = event.merge_request_title
elsif event.push?
event_link = project_commits_url(event.project, :ref => event.ref_name)
event_title = event.ref_name
end
event_link = event.feed_url
event_title = event.feed_title
xml.id "tag:#{request.host},#{event.created_at.strftime("%Y-%m-%d")}:#{event.id}"
xml.link :href => event_link
...
...
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