2020-06-22 12:08:47 +00:00
|
|
|
- page_title _("New Branch")
|
2017-05-04 18:49:56 +00:00
|
|
|
- default_ref = params[:ref] || @project.default_branch
|
2015-09-17 10:16:24 +00:00
|
|
|
|
2014-07-27 14:40:00 +00:00
|
|
|
- if @error
|
2021-06-25 00:08:34 +00:00
|
|
|
= render 'shared/global_alert',
|
|
|
|
variant: :danger,
|
2022-02-23 06:18:49 +00:00
|
|
|
close_button_class: 'js-close' do
|
2021-01-05 03:10:19 +00:00
|
|
|
.gl-alert-body
|
|
|
|
= @error
|
2013-07-16 21:09:23 +00:00
|
|
|
%h3.page-title
|
2021-09-03 12:09:03 +00:00
|
|
|
= _('New Branch')
|
2015-12-02 13:27:29 +00:00
|
|
|
%hr
|
|
|
|
|
2018-04-12 20:11:22 +00:00
|
|
|
= form_tag namespace_project_branches_path, method: :post, id: "new-branch-form", class: "js-create-branch-form js-requires-input" do
|
|
|
|
.form-group.row
|
2018-04-12 23:16:56 +00:00
|
|
|
= label_tag :branch_name, nil, class: 'col-form-label col-sm-2'
|
2013-12-30 23:27:02 +00:00
|
|
|
.col-sm-10
|
2018-11-15 15:20:18 +00:00
|
|
|
= text_field_tag :branch_name, params[:branch_name], required: true, autofocus: true, class: 'form-control js-branch-name monospace'
|
2018-04-11 18:26:37 +00:00
|
|
|
.form-text.text-muted.text-danger.js-branch-name-error
|
2018-04-12 20:11:22 +00:00
|
|
|
.form-group.row
|
2018-04-12 23:16:56 +00:00
|
|
|
= label_tag :ref, 'Create from', class: 'col-form-label col-sm-2'
|
2017-05-11 02:24:21 +00:00
|
|
|
.col-sm-10.create-from
|
|
|
|
.dropdown
|
|
|
|
= hidden_field_tag :ref, default_ref
|
2018-11-20 18:47:38 +00:00
|
|
|
= button_tag type: 'button', title: default_ref, class: 'dropdown-menu-toggle wide js-branch-select monospace', required: true, data: { toggle: 'dropdown', selected: default_ref, field_name: 'ref' } do
|
2017-05-11 02:24:21 +00:00
|
|
|
.text-left.dropdown-toggle-text= default_ref
|
2020-11-12 18:09:26 +00:00
|
|
|
= sprite_icon('chevron-down', css_class: "dropdown-menu-toggle-icon gl-top-3")
|
2017-05-11 02:24:21 +00:00
|
|
|
= render 'shared/ref_dropdown', dropdown_class: 'wide'
|
2018-04-11 18:26:37 +00:00
|
|
|
.form-text.text-muted Existing branch name, tag, or commit SHA
|
2013-07-16 21:09:23 +00:00
|
|
|
.form-actions
|
2021-03-17 21:11:29 +00:00
|
|
|
= button_tag 'Create branch', class: 'gl-button btn btn-confirm'
|
2021-08-30 12:09:48 +00:00
|
|
|
= link_to _('Cancel'), project_branches_path(@project), class: 'gl-button btn btn-default btn-cancel'
|
2021-10-06 12:11:40 +00:00
|
|
|
-# haml-lint:disable InlineJavaScript
|
2017-08-01 08:50:59 +00:00
|
|
|
%script#availableRefs{ type: "application/json" }= @project.repository.ref_names.to_json.html_safe
|