BigW Consortium Gitlab

_accept.html.haml 1.55 KB
Newer Older
1
= form_for [:automerge, @project.namespace.becomes(Namespace), @project, @merge_request], remote: true, method: :post, html: { class: 'accept-mr-form' } do |f|
2
  = hidden_field_tag :authenticity_token, form_authenticity_token
3 4
  .accept-merge-holder.clearfix.js-toggle-container
    .accept-action
5 6
      = f.button class: "btn btn-create accept_merge_request" do
        Accept Merge Request
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
    - if can_remove_branch?(@merge_request.source_project, @merge_request.source_branch) && !@merge_request.for_fork?
      .accept-control.checkbox
        = label_tag :should_remove_source_branch, class: "remove_source_checkbox" do
          = check_box_tag :should_remove_source_branch
          Remove source-branch
    .accept-control
      = link_to "#", class: "modify-merge-commit-link js-toggle-button", title: "Modify merge commit message" do
        %i.fa.fa-edit
        Modify commit message
    .js-toggle-content.hide.prepend-top-20
      = render 'shared/commit_message_container', params: params,
          text: @merge_request.merge_commit_message,
          rows: 14, hint: true

  %br
  .light
    If you want to merge this request manually, you can use the
    %strong
      = link_to "command line", "#modal_merge_info", class: "how_to_merge_link vlink", title: "How To Merge", "data-toggle" => "modal"

27 28 29
  :coffeescript
    disableButtonIfEmptyField '#commit_message', '.accept_merge_request'

30 31 32 33 34
    $('.accept-mr-form').on 'ajax:before', ->
      btn = $('.accept_merge_request')
      btn.disable()
      btn.html("<i class='fa fa-spinner fa-spin'></i> Merge in progress")