show.html.haml 4.76 KB
Newer Older
1
- @content_class = "limit-container-width" unless fluid_layout
2 3
- add_to_breadcrumbs "Merge Requests", project_merge_requests_path(@project)
- breadcrumb_title @merge_request.to_reference
4 5 6 7
- page_title "#{@merge_request.title} (#{@merge_request.to_reference})", "Merge Requests"
- page_description @merge_request.description
- page_card_attributes @merge_request.card_attributes
- content_for :page_specific_javascripts do
8 9
  = webpack_bundle_tag('common_vue')
  = webpack_bundle_tag('diff_notes')
10

11
.merge-request{ 'data-mr-action': "#{j params[:tab].presence || 'show'}", 'data-url' => merge_request_path(@merge_request, format: :json), 'data-project-path' => project_path(@merge_request.project) }
12 13 14 15 16 17 18 19
  = render "projects/merge_requests/mr_title"

  .merge-request-details.issuable-details{ data: { id: @merge_request.project.id } }
    = render "projects/merge_requests/mr_box"

    - if @merge_request.source_branch_exists?
      = render "projects/merge_requests/how_to_merge"

20
    -# haml-lint:disable InlineJavaScript
21
    :javascript
22
      window.gl = window.gl || {};
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
      window.gl.mrWidgetData = #{serialize_issuable(@merge_request)}

    #js-vue-mr-widget.mr-widget

    - content_for :page_specific_javascripts do
      = webpack_bundle_tag 'vue_merge_request_widget'

    .content-block.content-block-small.emoji-list-container
      = render 'award_emoji/awards_block', awardable: @merge_request, inline: true

    .merge-request-tabs-holder{ class: ("js-tabs-affix" unless ENV['RAILS_ENV'] == 'test') }
      .merge-request-tabs-container
        .scrolling-tabs-container.inner-page-scroll-tabs.is-smaller
          .fade-left= icon('angle-left')
          .fade-right= icon('angle-right')
          .nav-links.scrolling-tabs
            %ul.merge-request-tabs
              %li.notes-tab
41
                = link_to project_merge_request_path(@project, @merge_request), data: { target: 'div#notes', action: 'show', toggle: 'tab' } do
42 43 44 45
                  Discussion
                  %span.badge= @merge_request.related_notes.user.count
              - if @merge_request.source_project
                %li.commits-tab
46
                  = link_to commits_project_merge_request_path(@project, @merge_request), data: { target: 'div#commits', action: 'commits', toggle: 'tab' } do
47 48 49 50
                    Commits
                    %span.badge= @commits_count
              - if @pipelines.any?
                %li.pipelines-tab
51
                  = link_to pipelines_project_merge_request_path(@project, @merge_request), data: { target: '#pipelines', action: 'pipelines', toggle: 'tab' } do
52
                    Pipelines
53
                    %span.badge.js-pipelines-mr-count= @pipelines.size
54
              %li.diffs-tab
55
                = link_to diffs_project_merge_request_path(@project, @merge_request), data: { target: 'div#diffs', action: 'diffs', toggle: 'tab' } do
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
                  Changes
                  %span.badge= @merge_request.diff_size
        #resolve-count-app.line-resolve-all-container.prepend-top-10{ "v-cloak" => true }
          %resolve-count{ "inline-template" => true, ":logged-out" => "#{current_user.nil?}" }
            %div
              .line-resolve-all{ "v-show" => "discussionCount > 0",
                ":class" => "{ 'has-next-btn': !loggedOut && resolvedDiscussionCount !== discussionCount }" }
                %span.line-resolve-btn.is-disabled{ type: "button",
                    ":class" => "{ 'is-active': resolvedDiscussionCount === discussionCount }" }
                  = render "shared/icons/icon_status_success.svg"
                %span.line-resolve-text
                  {{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
              = render "discussions/new_issue_for_all_discussions", merge_request: @merge_request
              = render "discussions/jump_to_next"

    .tab-content#diff-notes-app
      #notes.notes.tab-pane.voting_notes
        .row
          %section.col-md-12
            .issuable-discussion
              = render "projects/merge_requests/discussion"

      #commits.commits.tab-pane
        -# This tab is always loaded via AJAX
      #pipelines.pipelines.tab-pane
        - if @pipelines.any?
82
          = render 'projects/commit/pipelines_list', disable_initialization: true, endpoint: pipelines_project_merge_request_path(@project, @merge_request)
83 84 85 86 87 88 89 90 91 92 93
      #diffs.diffs.tab-pane
        -# This tab is always loaded via AJAX

    .mr-loading-status
      = spinner

= render 'shared/issuable/sidebar', issuable: @merge_request
- if @merge_request.can_be_reverted?(current_user)
  = render "projects/commit/change", type: 'revert', commit: @merge_request.merge_commit, title: @merge_request.title
- if @merge_request.can_be_cherry_picked?
  = render "projects/commit/change", type: 'cherry-pick', commit: @merge_request.merge_commit, title: @merge_request.title