diff options
author | Winnie Hellmann <winnie@gitlab.com> | 2017-09-15 12:33:50 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-09-15 12:33:50 +0000 |
commit | 72a30d613404ed9a77ad8062f311cac7aece0370 (patch) | |
tree | 87d180faa11b045dd9e98264b9679a20822ee6ee /app/views | |
parent | 20295b3db379f4be02521cac591feca3452a2b1c (diff) | |
download | gitlab-ce-72a30d613404ed9a77ad8062f311cac7aece0370.tar.gz |
Display whether branch has been merged when deleting protected branch
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/projects/branches/_branch.html.haml | 3 | ||||
-rw-r--r-- | app/views/projects/branches/_delete_protected_modal.html.haml | 9 |
2 files changed, 9 insertions, 3 deletions
diff --git a/app/views/projects/branches/_branch.html.haml b/app/views/projects/branches/_branch.html.haml index 19712a8f1be..05c1d2b383c 100644 --- a/app/views/projects/branches/_branch.html.haml +++ b/app/views/projects/branches/_branch.html.haml @@ -43,7 +43,8 @@ data: { toggle: "modal", target: "#modal-delete-branch", delete_path: project_branch_path(@project, branch.name), - branch_name: branch.name } } + branch_name: branch.name, + is_merged: ("true" if @repository.merged_to_root_ref?(branch.name)) } } = icon("trash-o") - else %button{ class: "btn btn-remove remove-row js-ajax-loading-spinner has-tooltip disabled", diff --git a/app/views/projects/branches/_delete_protected_modal.html.haml b/app/views/projects/branches/_delete_protected_modal.html.haml index c5888afa54d..f00a0ee6925 100644 --- a/app/views/projects/branches/_delete_protected_modal.html.haml +++ b/app/views/projects/branches/_delete_protected_modal.html.haml @@ -6,13 +6,18 @@ %h3.page-title Delete protected branch = surround "'", "'?" do - %span.js-branch-name>[branch name] + %span.js-branch-name.ref-name>[branch name] .modal-body %p You’re about to permanently delete the protected branch = succeed '.' do - %strong.js-branch-name [branch name] + %strong.js-branch-name.ref-name [branch name] + %p.js-not-merged + - default_branch = capture do + %span.ref-name= @repository.root_ref + = s_("Branches|This branch hasn’t been merged into %{default_branch}.").html_safe % { default_branch: default_branch } + = s_("Branches|To avoid data loss, consider merging this branch before deleting it.") %p Once you confirm and press = succeed ',' do |