BigW Consortium Gitlab

_change.html.haml 2.09 KB
Newer Older
1 2 3
- case type.to_s
- when 'revert'
  - label = 'Revert'
4
  - branch_label = 'Revert in branch'
5 6
- when 'cherry-pick'
  - label = 'Cherry-pick'
7
  - branch_label = 'Pick into branch'
8

9
.modal{ id: "modal-#{type}-commit" }
10 11 12
  .modal-dialog
    .modal-content
      .modal-header
13
        %a.close{ href: "#", "data-dismiss" => "modal" } ×
14
        %h3.page-title== #{label} this #{commit.change_type_title(current_user)}
15
      .modal-body
16
        = form_tag [type.underscore, @project.namespace.becomes(Namespace), @project, commit], method: :post, remote: false, class: "form-horizontal js-#{type}-form js-requires-input" do
17
          .form-group.branch
18
            = label_tag 'start_branch', branch_label, class: 'control-label'
19
            .col-sm-10
20 21
              = hidden_field_tag :start_branch, @project.default_branch, id: 'start_branch'
              = dropdown_tag(@project.default_branch, options: { title: "Switch branch", filter: true, placeholder: "Search branches", toggle_class: 'js-project-refs-dropdown js-target-branch dynamic', dropdown_class: 'dropdown-menu-selectable', data: { field_name: "start_branch", selected: @project.default_branch, start_branch: @project.default_branch, refs_url: namespace_project_branches_path(@project.namespace, @project), submit_form_on_click: false } })
22

23 24 25
              - if can?(current_user, :push_code, @project)
                .js-create-merge-request-container
                  .checkbox
26
                    = label_tag do
27
                      = check_box_tag 'create_merge_request', 1, true, class: 'js-create-merge-request', id: nil
28 29
                      Start a <strong>new merge request</strong> with these changes
              - else
30
                = hidden_field_tag 'create_merge_request', 1, id: nil
31
          .form-actions
32
            = submit_tag label, class: 'btn btn-create'
33 34 35 36 37 38 39
            = link_to "Cancel", '#', class: "btn btn-cancel", "data-dismiss" => "modal"

            - unless can?(current_user, :push_code, @project)
              .inline.prepend-left-10
                = commit_in_fork_help

:javascript
40
  new NewCommitForm($('.js-#{type}-form'), 'start_branch')