_show.html.haml 4.88 KB
Newer Older
Phil Hughes's avatar
Phil Hughes committed
1
- page_title           "#{@merge_request.title} (#{@merge_request.to_reference})", "Merge Requests"
2 3
- page_description     @merge_request.description
- page_card_attributes @merge_request.card_attributes
Phil Hughes's avatar
Phil Hughes committed
4
- content_for :page_specific_javascripts do
5
  = page_specific_javascript_tag('diff_notes/diff_notes_bundle.js')
6

7
- if diff_view == 'parallel'
8 9
  - fluid_layout true

10
.merge-request{'data-url' => merge_request_path(@merge_request)}
11
  = render "projects/merge_requests/show/mr_title"
12

13
  .merge-request-details.issuable-details{data: {id: @merge_request.project.id}}
14 15 16 17 18
    = render "projects/merge_requests/show/mr_box"
    .append-bottom-default.mr-source-target.prepend-top-default
      - if @merge_request.open?
        .pull-right
          - if @merge_request.source_branch_exists?
19
            = link_to "#modal_merge_info", class: "btn inline btn-grouped btn-sm", "data-toggle" => "modal" do
20
              Check out branch
21

22
          %span.dropdown.inline.prepend-left-5
23 24 25
            %a.btn.btn-sm.dropdown-toggle{ data: {toggle: :dropdown} }
              Download as
              %span.caret
26
            %ul.dropdown-menu.dropdown-menu-align-right
27 28 29 30 31 32
              %li= link_to "Email Patches", merge_request_path(@merge_request, format: :patch)
              %li= link_to "Plain Diff",    merge_request_path(@merge_request, format: :diff)
      .normal
        %span Request to merge
        %span.label-branch= source_branch_with_namespace(@merge_request)
        %span into
33 34
        %span.label-branch
          = link_to @merge_request.target_branch, namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch)
35 36
        - if @merge_request.open? && @merge_request.diverged_from_target_branch?
          %span (#{pluralize(@merge_request.diverged_commits_count, 'commit')} behind)
37

38 39
    = render "projects/merge_requests/show/how_to_merge"
    = render "projects/merge_requests/widget/show.html.haml"
40

41
    - if @merge_request.source_branch_exists? && @merge_request.mergeable? && @merge_request.can_be_merged_by?(current_user)
42
      .light.prepend-top-default.append-bottom-default
43 44 45
        You can also accept this merge request manually using the
        = succeed '.' do
          = link_to "command line", "#modal_merge_info", class: "how_to_merge_link vlink", title: "How To Merge", "data-toggle" => "modal"
46

Phil Hughes's avatar
Phil Hughes committed
47
    - if current_user
48 49
      #resolve-count-app{ "v-cloak" => true }
        %resolve-count{ "inline-template" => true }
Phil Hughes's avatar
Phil Hughes committed
50 51
          .line-resolve-all{ "v-show" => "commentsCount > 0" }
            %span.line-resolve-text
52
              {{ resolved }}/{{ commentsCount }} discussions resolved
Phil Hughes's avatar
Phil Hughes committed
53

Phil Hughes's avatar
Phil Hughes committed
54
    - if @commits_count.nonzero?
55
      %ul.merge-request-tabs.nav-links.no-top.no-bottom
56 57 58
        %li.notes-tab
          = link_to namespace_project_merge_request_path(@project.namespace, @project, @merge_request), data: {target: 'div#notes', action: 'notes', toggle: 'tab'} do
            Discussion
59
            %span.badge= @merge_request.mr_and_commit_notes.user.count
60 61 62
        %li.commits-tab
          = link_to commits_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), data: {target: 'div#commits', action: 'commits', toggle: 'tab'} do
            Commits
63
            %span.badge= @commits_count
64
        - if @pipeline
65 66 67 68 69 70 71
          %li.builds-tab
            = link_to builds_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), data: {target: '#builds', action: 'builds', toggle: 'tab'} do
              Builds
              %span.badge= @statuses.size
        %li.diffs-tab
          = link_to diffs_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), data: {target: 'div#diffs', action: 'diffs', toggle: 'tab'} do
            Changes
72
            %span.badge= @merge_request.diff_size
73

74
      .tab-content#diff-notes-app
75
        #notes.notes.tab-pane.voting_notes
Phil Hughes's avatar
Phil Hughes committed
76
          .content-block.content-block-small.oneline-block
77
            = render 'award_emoji/awards_block', awardable: @merge_request, inline: true
78

79
          .row
80
            %section.col-md-12
81 82
              .issuable-discussion
                = render "projects/merge_requests/discussion"
83

84 85 86 87 88 89
        #commits.commits.tab-pane
          - # This tab is always loaded via AJAX
        #builds.builds.tab-pane
          - # This tab is always loaded via AJAX
        #diffs.diffs.tab-pane
          - # This tab is always loaded via AJAX
90

91 92
      .mr-loading-status
        = spinner
93

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

100
:javascript
101
  var merge_request;
102

103 104 105
  merge_request = new MergeRequest({
    action: "#{controller.action_name}"
  });