debian-mirror-gitlab/app/views/projects/issues/_new_branch.html.haml

67 lines
4.4 KiB
Text
Raw Normal View History

2016-06-02 11:05:42 +05:30
- if can?(current_user, :push_code, @project)
2018-05-09 12:01:36 +05:30
- can_create_merge_request = can?(current_user, :create_merge_request_in, @project)
- data_action = can_create_merge_request ? 'create-mr' : 'create-branch'
- value = can_create_merge_request ? 'Create merge request' : 'Create branch'
2019-09-30 21:07:59 +05:30
- value = can_create_confidential_merge_request? ? _('Create confidential merge request') : value
- create_mr_text = can_create_confidential_merge_request? ? _('Create confidential merge request') : _('Create merge request')
2018-05-09 12:01:36 +05:30
2018-03-17 18:26:18 +05:30
- can_create_path = can_create_branch_project_issue_path(@project, @issue)
- create_mr_path = create_merge_request_project_issue_path(@project, @issue, branch_name: @issue.to_branch_name, ref: @project.default_branch)
- create_branch_path = project_branches_path(@project, branch_name: @issue.to_branch_name, ref: @project.default_branch, issue_iid: @issue.iid)
- refs_path = refs_namespace_project_path(@project.namespace, @project, search: '')
2019-09-30 21:07:59 +05:30
.create-mr-dropdown-wrap.d-inline-block.full-width-mobile.js-create-mr{ data: { project_path: @project.full_path, project_id: @project.id, can_create_path: can_create_path, create_mr_path: create_mr_path, create_branch_path: create_branch_path, refs_path: refs_path, is_confidential: can_create_confidential_merge_request?.to_s } }
2021-04-29 21:17:54 +05:30
.btn-group.unavailable
%button.gl-button.btn{ type: 'button', disabled: 'disabled' }
2021-06-08 01:23:25 +05:30
.gl-spinner.align-text-bottom.gl-button-icon.hide
2017-08-17 22:00:37 +05:30
%span.text
Checking branch availability…
2018-12-13 13:39:08 +05:30
2021-04-29 21:17:54 +05:30
.btn-group.available.hidden
%button.gl-button.btn.js-create-merge-request.btn-confirm{ type: 'button', data: { action: data_action } }
2021-06-08 01:23:25 +05:30
.gl-spinner.js-spinner.gl-mr-2.gl-display-none
2018-03-17 18:26:18 +05:30
= value
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-confirm.btn-icon.dropdown-toggle.create-merge-request-dropdown-toggle.js-dropdown-toggle{ type: 'button', data: { dropdown: { trigger: '#create-merge-request-dropdown' }, display: 'static' } }
2021-02-22 17:27:13 +05:30
= sprite_icon('chevron-down')
2018-03-17 18:26:18 +05:30
.droplab-dropdown
2019-09-30 21:07:59 +05:30
%ul#create-merge-request-dropdown.create-merge-request-dropdown-menu.dropdown-menu.dropdown-menu-right.gl-show-field-errors{ class: ("create-confidential-merge-request-dropdown-menu" if can_create_confidential_merge_request?), data: { dropdown: true } }
2018-03-17 18:26:18 +05:30
- if can_create_merge_request
2019-09-30 21:07:59 +05:30
%li.droplab-item-selected{ role: 'button', data: { value: 'create-mr', text: create_mr_text } }
2020-01-01 13:55:28 +05:30
.menu-item.text-nowrap
2021-01-29 00:20:46 +05:30
= sprite_icon('check', css_class: 'icon')
2019-09-30 21:07:59 +05:30
- if can_create_confidential_merge_request?
= _('Create confidential merge request and branch')
- else
= _('Create merge request and branch')
2018-03-17 18:26:18 +05:30
2019-03-02 22:35:43 +05:30
%li{ class: [!can_create_merge_request && 'droplab-item-selected'], role: 'button', data: { value: 'create-branch', text: _('Create branch') } }
2018-03-17 18:26:18 +05:30
.menu-item
2021-01-29 00:20:46 +05:30
= sprite_icon('check', css_class: 'icon')
2018-03-17 18:26:18 +05:30
= _('Create branch')
%li.divider.droplab-item-ignore
2020-07-28 23:09:34 +05:30
%li.droplab-item-ignore.gl-ml-3.gl-mr-3.gl-mt-5
2019-09-30 21:07:59 +05:30
- if can_create_confidential_merge_request?
2021-01-03 14:25:43 +05:30
#js-forked-project{ data: { namespace_path: @project.namespace.full_path, project_path: @project.full_path, new_fork_path: new_project_fork_path(@project), help_page_path: help_page_path('user/project/merge_requests/index.md') } }
2018-03-17 18:26:18 +05:30
.form-group
%label{ for: 'new-branch-name' }
= _('Branch name')
2021-03-11 19:13:27 +05:30
%input#new-branch-name.js-branch-name.form-control.gl-form-input{ type: 'text', placeholder: "#{@issue.to_branch_name}", value: "#{@issue.to_branch_name}" }
2018-11-08 19:23:39 +05:30
%span.js-branch-message.form-text
2018-03-17 18:26:18 +05:30
.form-group
%label{ for: 'source-name' }
= _('Source (branch or tag)')
2021-03-11 19:13:27 +05:30
%input#source-name.js-ref.ref.form-control.gl-form-input{ type: 'text', placeholder: "#{@project.default_branch}", value: "#{@project.default_branch}", data: { value: "#{@project.default_branch}" } }
2018-11-08 19:23:39 +05:30
%span.js-ref-message.form-text.text-muted
2018-03-17 18:26:18 +05:30
.form-group
2021-04-29 21:17:54 +05:30
%button.btn.gl-button.btn-confirm.js-create-target{ type: 'button', data: { action: 'create-mr' } }
2019-09-30 21:07:59 +05:30
= create_mr_text
- if can_create_confidential_merge_request?
%p.text-warning.js-exposed-info-warning.hidden
= _('This may expose confidential information as the selected fork is in another namespace that can have other members.')