2017-11-06 14:33:37 +00:00
|
|
|
- can_create_merge_request = can?(current_user, :create_merge_request, @project)
|
|
|
|
- data_action = can_create_merge_request ? 'create-mr' : 'create-branch'
|
|
|
|
- value = can_create_merge_request ? 'Create a merge request' : 'Create a branch'
|
|
|
|
|
2016-04-21 14:34:00 +00:00
|
|
|
- if can?(current_user, :push_code, @project)
|
2017-06-29 17:06:35 +00:00
|
|
|
.create-mr-dropdown-wrap{ data: { can_create_path: can_create_branch_project_issue_path(@project, @issue), create_mr_path: create_merge_request_project_issue_path(@project, @issue), create_branch_path: project_branches_path(@project, branch_name: @issue.to_branch_name, issue_iid: @issue.iid) } }
|
2017-05-04 08:09:21 +00:00
|
|
|
.btn-group.unavailable
|
|
|
|
%button.btn.btn-grouped{ type: 'button', disabled: 'disabled' }
|
|
|
|
= icon('spinner', class: 'fa-spin')
|
|
|
|
%span.text
|
|
|
|
Checking branch availability…
|
|
|
|
.btn-group.available.hide
|
2017-11-06 14:33:37 +00:00
|
|
|
%input.btn.js-create-merge-request.btn-inverted.btn-success{ type: 'button', value: value, data: { action: data_action } }
|
2017-05-04 08:09:21 +00:00
|
|
|
%button.btn.btn-inverted.dropdown-toggle.btn-inverted.btn-success.js-dropdown-toggle{ type: 'button', data: { 'dropdown-trigger' => '#create-merge-request-dropdown' } }
|
|
|
|
= icon('caret-down')
|
|
|
|
%ul#create-merge-request-dropdown.dropdown-menu.dropdown-menu-align-right{ data: { dropdown: true } }
|
2017-11-06 14:33:37 +00:00
|
|
|
- if can_create_merge_request
|
|
|
|
%li.droplab-item-selected{ role: 'button', data: { value: 'create-mr', 'text' => 'Create a merge request' } }
|
|
|
|
.menu-item
|
|
|
|
.icon-container
|
|
|
|
= icon('check')
|
|
|
|
.description
|
|
|
|
%strong Create a merge request
|
|
|
|
%span
|
|
|
|
Creates a merge request named after this issue, with source branch created from '#{@project.default_branch}'.
|
|
|
|
%li.divider.droplab-item-ignore
|
|
|
|
%li{ class: [!can_create_merge_request && 'droplab-item-selected'], role: 'button', data: { value: 'create-branch', 'text' => 'Create a branch' } }
|
2017-05-04 08:09:21 +00:00
|
|
|
.menu-item
|
|
|
|
.icon-container
|
|
|
|
= icon('check')
|
|
|
|
.description
|
|
|
|
%strong Create a branch
|
|
|
|
%span
|
2017-05-11 17:32:47 +00:00
|
|
|
Creates a branch named after this issue, from '#{@project.default_branch}'.
|