diff options
author | Kyle Fazzari <gitlab_cloud@status.e4ward.com> | 2014-05-29 07:55:55 -0700 |
---|---|---|
committer | Kyle Fazzari <gitlab_cloud@status.e4ward.com> | 2014-05-29 07:55:55 -0700 |
commit | c1b1c321962de51090d590dc40fc2784aaa0d561 (patch) | |
tree | fd15124703486490f2ee7836064dcc0b85633fd4 /app | |
parent | b1ce97d5a1b3890e4137212547d97f3ab38c3991 (diff) | |
download | gitlab-ce-c1b1c321962de51090d590dc40fc2784aaa0d561.tar.gz |
Add summaries for notes and merge requests to dashboard feed.
This fixes #305.
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/events_helper.rb | 4 | ||||
-rw-r--r-- | app/models/event.rb | 5 | ||||
-rw-r--r-- | app/views/events/_event_merge_request.atom.haml | 2 | ||||
-rw-r--r-- | app/views/events/_event_note.atom.haml | 2 |
4 files changed, 13 insertions, 0 deletions
diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb index 929f9a9c381..63210324a19 100644 --- a/app/helpers/events_helper.rb +++ b/app/helpers/events_helper.rb @@ -83,6 +83,10 @@ module EventsHelper render "events/event_issue", issue: event.issue elsif event.push? render "events/event_push", event: event + elsif event.merge_request? + render "events/event_merge_request", merge_request: event.merge_request + elsif event.note? + render "events/event_note", note: event.note end end diff --git a/app/models/event.rb b/app/models/event.rb index cf88e9f4afc..3c8b9ac1736 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -33,6 +33,7 @@ class Event < ActiveRecord::Base delegate :name, :email, to: :author, prefix: true, allow_nil: true delegate :title, to: :issue, prefix: true, allow_nil: true delegate :title, to: :merge_request, prefix: true, allow_nil: true + delegate :title, to: :note, prefix: true, allow_nil: true belongs_to :author, class_name: "User" belongs_to :project @@ -147,6 +148,10 @@ class Event < ActiveRecord::Base target if target_type == "MergeRequest" end + def note + target if target_type == "Note" + end + def action_name if closed? "closed" diff --git a/app/views/events/_event_merge_request.atom.haml b/app/views/events/_event_merge_request.atom.haml new file mode 100644 index 00000000000..b7d3563f1c1 --- /dev/null +++ b/app/views/events/_event_merge_request.atom.haml @@ -0,0 +1,2 @@ +%div{xmlns: "http://www.w3.org/1999/xhtml"} + %p= simple_format merge_request.description diff --git a/app/views/events/_event_note.atom.haml b/app/views/events/_event_note.atom.haml new file mode 100644 index 00000000000..932ba0a0483 --- /dev/null +++ b/app/views/events/_event_note.atom.haml @@ -0,0 +1,2 @@ +%div{:xmlns => "http://www.w3.org/1999/xhtml"} + %p= simple_format note.note |