diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-04-06 16:02:36 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-04-11 10:51:15 +0200 |
commit | 12dd2b0cc0cf6dd8dc43ff8b8df8687268ba4af5 (patch) | |
tree | 65dd7c5467b931dc1777214dc1416c78add7891a /app/views/projects/commit | |
parent | 8ad9c4e873f2185e8bbfa6f363db32dbbba27141 (diff) | |
download | gitlab-ce-12dd2b0cc0cf6dd8dc43ff8b8df8687268ba4af5.tar.gz |
Share collaboration check between view and presenter
Diffstat (limited to 'app/views/projects/commit')
-rw-r--r-- | app/views/projects/commit/_commit_box.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/commit/show.html.haml | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/views/projects/commit/_commit_box.html.haml b/app/views/projects/commit/_commit_box.html.haml index aec58a91a71..e391f08acca 100644 --- a/app/views/projects/commit/_commit_box.html.haml +++ b/app/views/projects/commit/_commit_box.html.haml @@ -35,7 +35,7 @@ - unless @commit.has_been_reverted?(current_user) %li.clearfix = revert_commit_link(@commit, project_commit_path(@project, @commit.id), has_tooltip: false) - - if can_collaborate_with_project? + - if can_collaborate_with_project?(@project) %li.clearfix = cherry_pick_commit_link(@commit, project_commit_path(@project, @commit.id), has_tooltip: false) - if can?(current_user, :push_code, @project) diff --git a/app/views/projects/commit/show.html.haml b/app/views/projects/commit/show.html.haml index abb292f8f27..541ae905246 100644 --- a/app/views/projects/commit/show.html.haml +++ b/app/views/projects/commit/show.html.haml @@ -17,6 +17,6 @@ .limited-width-notes = render "shared/notes/notes_with_form", :autocomplete => true - - if can_collaborate_with_project? + - if can_collaborate_with_project?(@project) - %w(revert cherry-pick).each do |type| = render "projects/commit/change", type: type, commit: @commit, title: @commit.title |