diff options
author | Clement Ho <ClemMakesApps@gmail.com> | 2018-04-12 13:47:30 -0500 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2018-04-12 13:47:30 -0500 |
commit | b8401cd0b201ab9caecb60dcc477637e70da4df9 (patch) | |
tree | e197770a94a39ea4956007503440d13cf0b5434e /app/views/projects/commit | |
parent | b75f9721df6c7f5231a9d19e38ec8f0395957c0d (diff) | |
parent | 7f01d49b69130343d95d7ec470d69aeb14fb94fe (diff) | |
download | gitlab-ce-b8401cd0b201ab9caecb60dcc477637e70da4df9.tar.gz |
Merge branch 'master' into bootstrap4
Diffstat (limited to 'app/views/projects/commit')
-rw-r--r-- | app/views/projects/commit/_commit_box.html.haml | 11 | ||||
-rw-r--r-- | app/views/projects/commit/show.html.haml | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/app/views/projects/commit/_commit_box.html.haml b/app/views/projects/commit/_commit_box.html.haml index a663434e990..715cab3d766 100644 --- a/app/views/projects/commit/_commit_box.html.haml +++ b/app/views/projects/commit/_commit_box.html.haml @@ -1,3 +1,5 @@ +- can_collaborate = can_collaborate_with_project?(@project) + .page-content-header.js-commit-box{ 'data-commit-path' => branches_project_commit_path(@project, @commit.id) } .header-main-content = render partial: 'signature', object: @commit.signature @@ -32,12 +34,13 @@ %li.d-block.d-sm-none.d-md-none = link_to project_tree_path(@project, @commit) do #{ _('Browse Files') } - - unless @commit.has_been_reverted?(current_user) + - if can_collaborate && !@commit.has_been_reverted?(current_user) %li.clearfix = revert_commit_link(@commit, project_commit_path(@project, @commit.id), has_tooltip: false) - %li.clearfix - = cherry_pick_commit_link(@commit, project_commit_path(@project, @commit.id), has_tooltip: false) - - if can_collaborate_with_project? + - if can_collaborate + %li.clearfix + = cherry_pick_commit_link(@commit, project_commit_path(@project, @commit.id), has_tooltip: false) + - if can?(current_user, :push_code, @project) %li.clearfix = link_to s_("CreateTag|Tag"), new_project_tag_path(@project, ref: @commit) %li.divider 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 |