File: new.html.haml

package info (click to toggle)
gitlab 17.6.5-19
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 629,368 kB
  • sloc: ruby: 1,915,304; javascript: 557,307; sql: 60,639; xml: 6,509; sh: 4,567; makefile: 1,239; python: 406
file content (23 lines) | stat: -rw-r--r-- 1,217 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
- add_to_breadcrumbs _("Branches"), project_branches_path(@project)
- page_title _("New branch")
- default_ref = params[:ref] || @project.default_branch

- if @error
  = render Pajamas::AlertComponent.new(variant: :danger) do |c|
    - c.with_body do
      = @error
= render ::Layouts::PageHeadingComponent.new(_('New branch'))

= form_tag namespace_project_branches_path, method: :post, id: "new-branch-form", class: "js-create-branch-form" do
  .form-group.gl-max-w-80
    = label_tag :branch_name, _('Branch name')
    = text_field_tag :branch_name, params[:branch_name], required: true, autofocus: true, class: 'form-control js-branch-name monospace'
    .form-text.gl-text-danger.js-branch-name-error{ 'aria-live': 'assertive' }
  .form-group.gl-max-w-80
    = label_tag :ref, _('Create from')
    .js-new-branch-ref-selector{ data: { project_id: @project.id, default_branch_name: default_ref, hidden_input_name: 'ref' } }
    .form-text.gl-text-subtle
      = _('Existing branch name, tag, or commit SHA')
  = render Pajamas::ButtonComponent.new(variant: :confirm, button_options: { type: 'submit', class: 'gl-mr-3' }) do
    = _('Create branch')
  = link_button_to _('Cancel'), project_branches_path(@project)