Commit 119b0287 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'bugfix/305/dashboard_feed_summaries' into 'master'

Incorporate Summaries for Notes and Merge Requests Into Dashboard Feed

This MR fixes #305 by adding summaries for notes and merge requests into the dashboard feed.
parents 54e69988 1f976a64
...@@ -92,6 +92,10 @@ module EventsHelper ...@@ -92,6 +92,10 @@ module EventsHelper
render "events/event_issue", issue: event.issue render "events/event_issue", issue: event.issue
elsif event.push? elsif event.push?
render "events/event_push", event: event 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
end end
......
...@@ -30,6 +30,7 @@ class Event < ActiveRecord::Base ...@@ -30,6 +30,7 @@ class Event < ActiveRecord::Base
delegate :name, :email, to: :author, prefix: true, allow_nil: true delegate :name, :email, to: :author, prefix: true, allow_nil: true
delegate :title, to: :issue, 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: :merge_request, prefix: true, allow_nil: true
delegate :title, to: :note, prefix: true, allow_nil: true
belongs_to :author, class_name: "User" belongs_to :author, class_name: "User"
belongs_to :project belongs_to :project
...@@ -147,6 +148,10 @@ class Event < ActiveRecord::Base ...@@ -147,6 +148,10 @@ class Event < ActiveRecord::Base
target if target_type == "MergeRequest" target if target_type == "MergeRequest"
end end
def note
target if target_type == "Note"
end
def action_name def action_name
if closed? if closed?
"closed" "closed"
......
%div{:xmlns => "http://www.w3.org/1999/xhtml"} %div{:xmlns => "http://www.w3.org/1999/xhtml"}
%p= simple_format issue.description %p= markdown issue.description
%div{xmlns: "http://www.w3.org/1999/xhtml"}
%p= markdown merge_request.description
%div{:xmlns => "http://www.w3.org/1999/xhtml"}
%p= markdown note.note
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
%i %i
at at
= commit[:timestamp].to_time.to_s(:short) = commit[:timestamp].to_time.to_s(:short)
%blockquote= simple_format(escape_once(commit[:message])) %blockquote= markdown(escape_once(commit[:message]))
- if event.commits_count > 15 - if event.commits_count > 15
%p %p
%i %i
......
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