_accept.html.haml 2.59 KB
Newer Older
1 2 3
- content_for :page_specific_javascripts do
  = page_specific_javascript_tag('merge_request_widget/ci_bundle.js')

4
- status_class = @pipeline ? " ci-#{@pipeline.status}" : nil
5

6
= form_for [:merge, @project.namespace.becomes(Namespace), @project, @merge_request], remote: true, method: :post, html: { class: 'accept-mr-form js-quick-submit js-requires-input' } do |f|
7
  = hidden_field_tag :authenticity_token, form_authenticity_token
8
  = hidden_field_tag :sha, @merge_request.diff_head_sha
9
  .accept-merge-holder.clearfix.js-toggle-container
10 11
    .clearfix
      .accept-action
12
        - if @pipeline && @pipeline.active?
13
          %span.btn-group
14
            = button_tag class: "btn btn-create js-merge-button merge_when_build_succeeds" do
15
              Merge When Pipeline Succeeds
16 17
            - unless @project.only_allow_merge_if_build_succeeds?
              = button_tag class: "btn btn-success dropdown-toggle", 'data-toggle' => 'dropdown' do
18
                = icon('caret-down')
19 20 21 22 23 24
                %span.sr-only
                  Select Merge Moment
              %ul.js-merge-dropdown.dropdown-menu.dropdown-menu-right{ role: 'menu' }
                %li
                  = link_to "#", class: "merge_when_build_succeeds" do
                    = icon('check fw')
25
                    Merge When Pipeline Succeeds
26 27 28 29
                %li
                  = link_to "#", class: "accept_merge_request" do
                    = icon('warning fw')
                    Merge Immediately
30
        - else
31
          = f.button class: "btn btn-create btn-grouped js-merge-button accept_merge_request #{status_class}" do
32
            Accept Merge Request
33 34 35 36
      - if @merge_request.force_remove_source_branch?
        .accept-control
          The source branch will be removed.
      - elsif @merge_request.can_remove_source_branch?(current_user)
37
        .accept-control.checkbox
38
          = label_tag :should_remove_source_branch, class: "merge-param-checkbox" do
39 40
            = check_box_tag :should_remove_source_branch
            Remove source branch
41
      .accept-control
42 43 44 45
        = link_to "#", class: "modify-merge-commit-link js-toggle-button" do
          = icon('edit')
          Modify commit message
    .js-toggle-content.hide.prepend-top-default
46
      = render 'shared/commit_message_container', params: params,
47 48
          message_with_description: @merge_request.merge_commit_message(include_description: true),
          message_without_description: @merge_request.merge_commit_message,
49 50 51
          text: @merge_request.merge_commit_message,
          rows: 14, hint: true

52
    = hidden_field_tag :merge_when_build_succeeds, "", autocomplete: "off"