diff options
author | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2012-10-08 14:52:07 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2012-10-08 14:52:07 +0400 |
commit | 624abdfc72f57da5650e239c8dd20e14f2f9a186 (patch) | |
tree | a70b0ff9931d3e9ba6e694e4a37b74032450250d /app/decorators | |
parent | fd2320849f07071258ec045b414fe2baa0dea9da (diff) | |
parent | 987e351de7fb6c98094a1c099c717dacb3f1416e (diff) |
Merge branch 'feature/dashboardfeed' of https://github.com/alexleutgoeb/gitlabhq into alexleutgoeb-feature/dashboardfeed
Conflicts:
app/decorators/event_decorator.rb
Diffstat (limited to 'app/decorators')
-rw-r--r-- | app/decorators/event_decorator.rb | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/app/decorators/event_decorator.rb b/app/decorators/event_decorator.rb index 312ac6517d1..b2f9c439589 100644 --- a/app/decorators/event_decorator.rb +++ b/app/decorators/event_decorator.rb @@ -3,11 +3,11 @@ class EventDecorator < ApplicationDecorator def feed_title if self.issue? - "#{self.author_name} #{self.action_name} issue ##{self.target_id}:" + self.issue_title + "#{self.author_name} #{self.action_name} issue ##{self.target_id}: #{self.issue_title} at #{self.project.name}" elsif self.merge_request? - "#{self.author_name} #{self.action_name} MR ##{self.target_id}:" + self.merge_request_title + "#{self.author_name} #{self.action_name} MR ##{self.target_id}: #{self.merge_request_title} at #{self.project.name}" elsif self.push? - "#{self.author_name} #{self.push_action_name} #{self.ref_type} " + self.ref_name + "#{self.author_name} #{self.push_action_name} #{self.ref_type} #{self.ref_name} at #{self.project.name}" elsif self.membership_changed? "#{self.author_name} #{self.action_name} #{self.project.name}" else @@ -20,8 +20,26 @@ class EventDecorator < ApplicationDecorator 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? + if self.push_with_commits? + if self.commits_count > 1 + h.compare_project_commits_path(self.project, :from => self.parent_commit.id, :to => self.last_commit.id) + else + h.project_commit_path(self.project, :id => self.last_commit.id) + end + else + h.project_commits_url(self.project, ref: self.ref_name) + end + end + + end + + def feed_summary + if self.issue? + h.render "events/event_issue", issue: self.issue elsif self.push? - h.project_commits_url(self.project, self.ref_name) + h.render "events/event_push", event: self end end end |