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

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

11
  .merge-request-details.issuable-details{ data: { id: @merge_request.project.id } }
12 13 14 15 16
    = 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?
17 18 19
            - if koding_enabled? && @repository.koding_yml
              = link_to koding_project_url(@merge_request.source_project, @merge_request.source_branch, @merge_request.commits.first.short_id), class: "btn inline btn-grouped btn-sm", target: '_blank' do
                Run in IDE (Koding)
20
            = link_to "#modal_merge_info", class: "btn inline btn-grouped btn-sm", "data-toggle" => "modal" do
21
              Check out branch
22

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

39 40 41
    - if @merge_request.source_branch_exists?
      = render "projects/merge_requests/show/how_to_merge"

42
    = render "projects/merge_requests/widget/show.html.haml"
43

44
    - if @merge_request.source_branch_exists? && @merge_request.mergeable? && @merge_request.can_be_merged_by?(current_user)
45
      .merge-manually.light.prepend-top-default
46 47 48
        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"
49

50 51 52
    .content-block.content-block-small
      = render 'award_emoji/awards_block', awardable: @merge_request, inline: true

53 54 55 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 82 83 84
    .merge-request-tabs-holder{ class: ("js-tabs-affix" unless ENV['RAILS_ENV'] == 'test') }
      %div{ class: container_class }
        %ul.merge-request-tabs.nav-links.no-top.no-bottom
          %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
              %span.badge= @merge_request.related_notes.user.count
          - if @merge_request.source_project
            %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
                %span.badge= @commits_count
          - if @pipelines.any?
            %li.pipelines-tab
              = link_to pipelines_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), data: { target: '#pipelines', action: 'pipelines', toggle: 'tab' } do
                Pipelines
                %span.badge= @pipelines.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
              %span.badge= @merge_request.diff_size
          %li#resolve-count-app.line-resolve-all-container.pull-right.prepend-top-10.hidden-xs{ "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/jump_to_next"
85

86 87 88 89 90 91
    .tab-content#diff-notes-app
      #notes.notes.tab-pane.voting_notes
        .row
          %section.col-md-12
            .issuable-discussion
              = render "projects/merge_requests/discussion"
92

93 94 95 96 97 98
      #commits.commits.tab-pane
        - # This tab is always loaded via AJAX
      #pipelines.pipelines.tab-pane
        - # This tab is always loaded via AJAX
      #diffs.diffs.tab-pane
        - # This tab is always loaded via AJAX
99

100 101
    .mr-loading-status
      = spinner
102

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

109
:javascript
110
  var merge_request;
111

112 113 114
  merge_request = new MergeRequest({
    action: "#{controller.action_name}"
  });