summaryrefslogtreecommitdiff
path: root/app/views/shared/_new_commit_form.html.haml
blob: 14ea96f9669c7fd3b5c8118525a387f69ba82222 (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
- project = @project.present(current_user: current_user)
- branch_name = selected_branch

= render 'shared/commit_message_container', placeholder: placeholder

- if project.empty_repo?
  - ref = local_assigns[:ref] || @ref
  = hidden_field_tag 'branch_name', ref, class: 'js-branch-name'
- else
  - if can?(current_user, :push_code, @project)
    .form-group.row.branch
      = label_tag 'branch_name', _('Target Branch'), class: 'col-form-label col-sm-2'
      .col-sm-10
        = text_field_tag 'branch_name', branch_name, required: true, class: "form-control gl-form-input js-branch-name ref-name"

        .js-create-merge-request-container
          = render 'shared/new_merge_request_checkbox'
  - elsif project.can_current_user_push_to_branch?(branch_name)
    = hidden_field_tag 'branch_name', branch_name
  - else
    = hidden_field_tag 'branch_name', branch_name
    = hidden_field_tag 'create_merge_request', 1

  = hidden_field_tag 'original_branch', @ref, class: 'js-original-branch'