From 1b5302f8e7050c5c4cd4e7d4cc63be3cd3fbbcb5 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Tue, 8 Dec 2015 12:57:49 +0100 Subject: Reduce MR/issue duplication --- app/views/projects/issues/_discussion.html.haml | 5 +---- app/views/projects/merge_requests/_discussion.html.haml | 4 ++-- app/views/projects/merge_requests/show/_participants.html.haml | 4 ---- app/views/shared/issuable/_participants.html.haml | 5 +++++ 4 files changed, 8 insertions(+), 10 deletions(-) delete mode 100644 app/views/projects/merge_requests/show/_participants.html.haml create mode 100644 app/views/shared/issuable/_participants.html.haml diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index b5f522f2079..21eee70b424 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -12,10 +12,7 @@ .col-md-9 .votes-holder.pull-right #votes= render 'votes/votes_block', votable: @issue - .participants - %span= pluralize(@participants.count, 'participant') - - @participants.each do |participant| - = link_to_member(@project, participant, name: false, size: 24) + = render "shared/issuable/participants" .col-md-3 .input-group.cross-project-reference %span#cross-project-reference.slead.has_tooltip{title: 'Cross-project reference'} diff --git a/app/views/projects/merge_requests/_discussion.html.haml b/app/views/projects/merge_requests/_discussion.html.haml index ea462561668..3d7bd78dce3 100644 --- a/app/views/projects/merge_requests/_discussion.html.haml +++ b/app/views/projects/merge_requests/_discussion.html.haml @@ -12,7 +12,7 @@ .col-md-9 .votes-holder.pull-right #votes= render 'votes/votes_block', votable: @merge_request - = render "projects/merge_requests/show/participants" + = render "shared/issuable/participants" .col-md-3 .input-group.cross-project-reference %span#cross-project-reference.slead.has_tooltip{title: 'Cross-project reference'} @@ -21,7 +21,7 @@ .row %section.col-md-9 - = render "projects/notes/notes_with_form" + .voting_notes#notes= render "projects/notes/notes_with_form" %aside.col-md-3 .issuable-affix .context diff --git a/app/views/projects/merge_requests/show/_participants.html.haml b/app/views/projects/merge_requests/show/_participants.html.haml deleted file mode 100644 index c67afe963e7..00000000000 --- a/app/views/projects/merge_requests/show/_participants.html.haml +++ /dev/null @@ -1,4 +0,0 @@ -.participants - %span #{@participants.count} participants - - @participants.each do |participant| - = link_to_member(@project, participant, name: false, size: 24) diff --git a/app/views/shared/issuable/_participants.html.haml b/app/views/shared/issuable/_participants.html.haml new file mode 100644 index 00000000000..b4e0def48b6 --- /dev/null +++ b/app/views/shared/issuable/_participants.html.haml @@ -0,0 +1,5 @@ +.participants + %span + = pluralize @participants.count, "participant" + - @participants.each do |participant| + = link_to_member(@project, participant, name: false, size: 24) -- cgit v1.2.1