diff options
author | Sean McGivern <sean@gitlab.com> | 2017-02-01 14:28:04 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-02-03 09:46:03 +0000 |
commit | 7550f60ddeecebac3f84e8690ab3f42428600ff7 (patch) | |
tree | f2121574ae7e46a2cc970f92a1287ad1289c4e5b /app/views/shared/issuable | |
parent | fd46fb1cd9cc1fdf826d31261aa594baa38d4898 (diff) | |
download | gitlab-ce-7550f60ddeecebac3f84e8690ab3f42428600ff7.tar.gz |
Backport changes from EE squash
Backport changes from the EE-only squash implementation, which would
otherwise conflict when merge CE into EE.
<https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1024>
Diffstat (limited to 'app/views/shared/issuable')
-rw-r--r-- | app/views/shared/issuable/_form.html.haml | 2 | ||||
-rw-r--r-- | app/views/shared/issuable/form/_branch_chooser.html.haml | 9 | ||||
-rw-r--r-- | app/views/shared/issuable/form/_merge_params.html.haml | 16 |
3 files changed, 18 insertions, 9 deletions
diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml index 0a4de709fcd..cb92b2e97a7 100644 --- a/app/views/shared/issuable/_form.html.haml +++ b/app/views/shared/issuable/_form.html.haml @@ -43,6 +43,8 @@ = render 'shared/issuable/form/branch_chooser', issuable: issuable, form: form += render 'shared/issuable/form/merge_params', issuable: issuable + - if @merge_request_for_resolving_discussions .form-group .col-sm-10.col-sm-offset-2 diff --git a/app/views/shared/issuable/form/_branch_chooser.html.haml b/app/views/shared/issuable/form/_branch_chooser.html.haml index b757893ea04..2793e7bcff4 100644 --- a/app/views/shared/issuable/form/_branch_chooser.html.haml +++ b/app/views/shared/issuable/form/_branch_chooser.html.haml @@ -19,12 +19,3 @@ - if issuable.new_record? = link_to 'Change branches', mr_change_branches_path(issuable) - -- if issuable.can_remove_source_branch?(current_user) - .form-group - .col-sm-10.col-sm-offset-2 - .checkbox - = label_tag 'merge_request[force_remove_source_branch]' do - = hidden_field_tag 'merge_request[force_remove_source_branch]', '0', id: nil - = check_box_tag 'merge_request[force_remove_source_branch]', '1', issuable.force_remove_source_branch? - Remove source branch when merge request is accepted. diff --git a/app/views/shared/issuable/form/_merge_params.html.haml b/app/views/shared/issuable/form/_merge_params.html.haml new file mode 100644 index 00000000000..03309722326 --- /dev/null +++ b/app/views/shared/issuable/form/_merge_params.html.haml @@ -0,0 +1,16 @@ +- issuable = local_assigns.fetch(:issuable) + +- return unless issuable.is_a?(MergeRequest) +- return if issuable.closed_without_fork? + +-# This check is duplicated below, to avoid conflicts with EE. +- return unless issuable.can_remove_source_branch?(current_user) + +.form-group + .col-sm-10.col-sm-offset-2 + - if issuable.can_remove_source_branch?(current_user) + .checkbox + = label_tag 'merge_request[force_remove_source_branch]' do + = hidden_field_tag 'merge_request[force_remove_source_branch]', '0', id: nil + = check_box_tag 'merge_request[force_remove_source_branch]', '1', issuable.force_remove_source_branch? + Remove source branch when merge request is accepted. |