summaryrefslogtreecommitdiff
path: root/app/views/shared/issuable/form/_branch_chooser.html.haml
blob: b757893ea049a4821faa8c2c9b947c135802c794 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
- issuable = local_assigns.fetch(:issuable)
- form = local_assigns.fetch(:form)

- return unless issuable.is_a?(MergeRequest)
- return if issuable.closed_without_fork?

%hr
- if issuable.new_record?
  .form-group
    = form.label :source_branch, class: 'control-label'
    .col-sm-10
      .issuable-form-select-holder
        = form.select(:source_branch, [issuable.source_branch], {}, { class: 'source_branch select2 span2', disabled: true })
.form-group
  = form.label :target_branch, class: 'control-label'
  .col-sm-10
    .issuable-form-select-holder
      = form.select(:target_branch, issuable.target_branches, { include_blank: true }, { class: 'target_branch select2 span2', disabled: issuable.new_record?, data: { placeholder: "Select branch" }})
    - 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.