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

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

- source_title, target_title = format_mr_branch_names(@merge_request)

.form-group.row.d-flex.gl-pl-3.gl-pr-3.branch-selector
  .align-self-center
    %span= s_('From %{source_title} into').html_safe % { source_title: "<code>#{source_title}</code>".html_safe }
    - if issuable.new_record?
      %code= target_title
      &nbsp;
      = link_to _('Change branches'), mr_change_branches_path(issuable)
    - elsif issuable.for_fork?
      %code= issuable.target_project_path + ":"
  - unless issuable.new_record?
    %span.dropdown.prepend-left-5.d-inline-block
      = form.hidden_field(:target_branch,
        { class: 'target_branch js-target-branch-select ref-name mw-xl',
          data: { placeholder: _('Select branch'), endpoint: refs_project_path(@project, sort: 'updated_desc', find: 'branches') }})
%hr