#modal-revert-commit.modal
  .modal-dialog
    .modal-content
      .modal-header
        %a.close{href: "#", "data-dismiss" => "modal"} ×
        %h3.page-title== Revert this #{revert_commit_type(commit)}
      .modal-body
        = form_tag revert_namespace_project_commit_path(@project.namespace, @project, commit.id), method: :post, remote: false, class: 'form-horizontal js-create-dir-form js-requires-input' do
          .form-group.branch
            = label_tag 'target_branch', 'Revert in branch', class: 'control-label'
            .col-sm-10
              = select_tag "target_branch", grouped_options_refs, class: "select2 select2-sm js-target-branch"
              - 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
            = submit_tag "Revert", class: 'btn btn-create'
            = 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
  new NewCommitForm($('.js-create-dir-form'))
