_accept.html.haml 1.37 KB
Newer Older
1 2
- status_class = @merge_request.ci_commit ? " ci-#{@merge_request.ci_commit.status}" : nil

3
= form_for [:merge, @project.namespace.becomes(Namespace), @project, @merge_request], remote: true, method: :post, html: { class: 'accept-mr-form js-requires-input' } do |f|
4
  = hidden_field_tag :authenticity_token, form_authenticity_token
5 6
  .accept-merge-holder.clearfix.js-toggle-container
    .accept-action
7
      = f.button class: "btn btn-create accept_merge_request#{status_class}" do
8
        Accept Merge Request
9 10 11 12
    - 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
13
          Remove source branch
14
    .accept-control.right
15 16
      = link_to "#", class: "modify-merge-commit-link js-toggle-button" do
        = icon('edit')
17 18 19 20 21 22
        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

23 24 25 26 27 28
  :javascript
    $('.accept-mr-form').on('ajax:before', function() {
      var btn = $('.accept_merge_request');
      btn.disable();
      btn.html("<i class='fa fa-spinner fa-spin'></i> Merge in progress");
    });