diff options
author | micael.bergeron <micael.bergeron@solutionstlm.com> | 2017-08-15 09:21:27 -0400 |
---|---|---|
committer | micael.bergeron <micael.bergeron@solutionstlm.com> | 2017-09-06 09:00:57 -0400 |
commit | b44a1bcd0b94a68f680c24d0dfd6d3402af9a881 (patch) | |
tree | b20c07b3bfaf86f00255a27f7428e1000c930fca /app/controllers | |
parent | 45b83ed99afc5cfe24a8d84869894124d93d5b51 (diff) | |
download | gitlab-ce-b44a1bcd0b94a68f680c24d0dfd6d3402af9a881.tar.gz |
rework the contributor badge
- only show in merge-requests
- show as a little glyph
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/concerns/renders_notes.rb | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/app/controllers/concerns/renders_notes.rb b/app/controllers/concerns/renders_notes.rb index b6cf366c05c..4791bc561a4 100644 --- a/app/controllers/concerns/renders_notes.rb +++ b/app/controllers/concerns/renders_notes.rb @@ -2,7 +2,7 @@ module RendersNotes def prepare_notes_for_rendering(notes, noteable = nil) preload_noteable_for_regular_notes(notes) preload_max_access_for_authors(notes, @project) - preload_first_time_contribution_for_authors(noteable, notes) if noteable.is_a?(Issuable) + preload_first_time_contribution_for_authors(noteable, notes) Banzai::NoteRenderer.render(notes, @project, current_user) notes @@ -21,12 +21,9 @@ module RendersNotes ActiveRecord::Associations::Preloader.new.preload(notes.reject(&:for_commit?), :noteable) end - def preload_first_time_contribution_for_authors(issuable, notes) - return unless issuable.first_contribution? + def preload_first_time_contribution_for_authors(noteable, notes) + return unless noteable.is_a?(Issuable) && noteable.first_contribution? - same_author = lambda {|n| n.author_id == issuable.author_id} - notes.each do |note| - note.specialize!(Note::SpecialRole::FIRST_TIME_CONTRIBUTOR, &same_author) - end + notes.each {|n| n.specialize_for_first_contribution!(noteable)} end end |