Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-02-14 14:18:40 +0300
committerSean McGivern <sean@mcgivern.me.uk>2017-02-14 14:18:40 +0300
commit478e01ce7b38cdbdff8bd2b7138abd31cf1c37f9 (patch)
tree7674f1313bc9a1b0d12b2687680ae368b7fa0887 /app
parent640e977d4d5b6ab8f0c48f3b58a14ed2301d8257 (diff)
parent4f51e1fad0609c0cd50468243a83970728186a8e (diff)
Merge branch '22645-add-discussion-contribs-to-calendar' into 'master'
Add discussion events to contributions calendar Closes #22645 See merge request !8821
Diffstat (limited to 'app')
-rw-r--r--app/models/event.rb7
-rw-r--r--app/views/users/calendar.html.haml2
-rw-r--r--app/views/users/calendar_activities.html.haml6
3 files changed, 9 insertions, 6 deletions
diff --git a/app/models/event.rb b/app/models/event.rb
index cf89ac5207f..e5027df3f8a 100644
--- a/app/models/event.rb
+++ b/app/models/event.rb
@@ -45,9 +45,10 @@ class Event < ActiveRecord::Base
class << self
# Update Gitlab::ContributionsCalendar#activity_dates if this changes
def contributions
- where("action = ? OR (target_type in (?) AND action in (?))",
- Event::PUSHED, ["MergeRequest", "Issue"],
- [Event::CREATED, Event::CLOSED, Event::MERGED])
+ where("action = ? OR (target_type IN (?) AND action IN (?)) OR (target_type = ? AND action = ?)",
+ Event::PUSHED,
+ ["MergeRequest", "Issue"], [Event::CREATED, Event::CLOSED, Event::MERGED],
+ "Note", Event::COMMENTED)
end
def limit_recent(limit = 20, offset = nil)
diff --git a/app/views/users/calendar.html.haml b/app/views/users/calendar.html.haml
index 6228245d8d0..57b8845c55d 100644
--- a/app/views/users/calendar.html.haml
+++ b/app/views/users/calendar.html.haml
@@ -1,7 +1,7 @@
.clearfix.calendar
.js-contrib-calendar
.calendar-hint
- Summary of issues, merge requests, and push events
+ Summary of issues, merge requests, push events, and comments
:javascript
new Calendar(
#{@activity_dates.to_json},
diff --git a/app/views/users/calendar_activities.html.haml b/app/views/users/calendar_activities.html.haml
index b09782749f5..dae147ca8be 100644
--- a/app/views/users/calendar_activities.html.haml
+++ b/app/views/users/calendar_activities.html.haml
@@ -13,8 +13,10 @@
#{event.action_name} #{event.ref_type} #{event.ref_name}
- else
= event_action_name(event)
- - if event.target
- %strong= link_to "#{event.target.to_reference}", [event.project.namespace.becomes(Namespace), event.project, event.target]
+ - if event.note?
+ %strong= link_to event.note_target.to_reference, event_note_target_path(event)
+ - elsif event.target
+ %strong= link_to event.target.to_reference, [event.project.namespace.becomes(Namespace), event.project, event.target]
at
%strong