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

.modal{id: "modal-#{type}-commit"}
10
11
12
13
  .modal-dialog
    .modal-content
      .modal-header
        %a.close{href: "#", "data-dismiss" => "modal"} ×
14
        %h3.page-title== #{label} this #{commit.change_type_title}
15
      .modal-body
16
        = form_tag send("#{type.underscore}_namespace_project_commit_path", @project.namespace, @project, commit.id), method: :post, remote: false, class: 'form-horizontal js-#{type}-form js-requires-input' do
17
          .form-group.branch
18
            = label_tag 'target_branch', target_label, class: 'control-label'
19
            .col-sm-10
20
              = select_tag "target_branch", project_branches, class: "select2 select2-sm js-target-branch"
21
22
23
24
25
26
27
28
29
30
              - if can?(current_user, :push_code, @project)
                .js-create-merge-request-container
                  .checkbox
                    - nonce = SecureRandom.hex
                    = label_tag "create_merge_request-#{nonce}" do
                      = check_box_tag 'create_merge_request', 1, true, class: 'js-create-merge-request', id: "create_merge_request-#{nonce}"
                      Start a <strong>new merge request</strong> with these changes
              - else
                = hidden_field_tag 'create_merge_request', 1
          .form-actions
31
            = submit_tag label, class: 'btn btn-create'
32
33
34
35
36
37
38
            = 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
39
  new NewCommitForm($('.js-#{type}-form'))