2018-02-28 08:06:18 +00:00
|
|
|
- project = @project.present(current_user: current_user)
|
|
|
|
- branch_name = selected_branch
|
|
|
|
|
2015-11-17 17:53:56 +00:00
|
|
|
= render 'shared/commit_message_container', placeholder: placeholder
|
|
|
|
|
2021-02-17 18:09:19 +00:00
|
|
|
- if project.empty_repo?
|
|
|
|
- ref = local_assigns[:ref] || @ref
|
|
|
|
- branch_name_class = project.empty_repo_upload_experiment? ? 'js-branch-name' : nil
|
|
|
|
|
|
|
|
= hidden_field_tag 'branch_name', ref, class: branch_name_class
|
2015-12-18 09:03:34 +00:00
|
|
|
- else
|
|
|
|
- if can?(current_user, :push_code, @project)
|
2018-04-12 20:11:22 +00:00
|
|
|
.form-group.row.branch
|
2018-04-12 23:16:56 +00:00
|
|
|
= label_tag 'branch_name', _('Target Branch'), class: 'col-form-label col-sm-2'
|
2015-12-18 09:03:34 +00:00
|
|
|
.col-sm-10
|
2021-01-29 15:09:40 +00:00
|
|
|
= text_field_tag 'branch_name', branch_name, required: true, class: "form-control gl-form-input js-branch-name ref-name"
|
2015-11-17 17:53:56 +00:00
|
|
|
|
2015-12-18 09:03:34 +00:00
|
|
|
.js-create-merge-request-container
|
2017-06-16 03:02:14 +00:00
|
|
|
= render 'shared/new_merge_request_checkbox'
|
2018-02-28 08:06:18 +00:00
|
|
|
- elsif project.can_current_user_push_to_branch?(branch_name)
|
|
|
|
= hidden_field_tag 'branch_name', branch_name
|
2015-12-18 09:03:34 +00:00
|
|
|
- else
|
2018-02-28 08:06:18 +00:00
|
|
|
= hidden_field_tag 'branch_name', branch_name
|
2015-12-18 09:03:34 +00:00
|
|
|
= hidden_field_tag 'create_merge_request', 1
|
2015-11-17 17:53:56 +00:00
|
|
|
|
|
|
|
= hidden_field_tag 'original_branch', @ref, class: 'js-original-branch'
|