BigW Consortium Gitlab

Commit c1b1c321 by Kyle Fazzari

Add summaries for notes and merge requests to dashboard feed.

This fixes #305.
parent b1ce97d5
......@@ -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
......
......@@ -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"
......
%div{xmlns: "http://www.w3.org/1999/xhtml"}
%p= simple_format merge_request.description
%div{:xmlns => "http://www.w3.org/1999/xhtml"}
%p= simple_format note.note
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment