BigW Consortium Gitlab

_show.html.haml 2.99 KB
Newer Older
1
.merge-request{'data-url' => project_merge_request_path(@project, @merge_request)}
2
  = render "projects/merge_requests/show/mr_title"
3
  %hr
4 5 6 7 8 9 10 11 12
  = render "projects/merge_requests/show/mr_box"
  %hr
  .append-bottom-20
    .slead
      %span From
      - if @merge_request.for_fork?
        %strong.label-branch<
          - if @merge_request.source_project
            = link_to @merge_request.source_project_namespace, project_path(@merge_request.source_project)
13
          - else
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
            \ #{@merge_request.source_project_namespace}
          \:#{@merge_request.source_branch}
        %span into
        %strong.label-branch #{@merge_request.target_project_namespace}:#{@merge_request.target_branch}
      - else
        %strong.label-branch #{@merge_request.source_branch}
        %span into
        %strong.label-branch #{@merge_request.target_branch}
      - if @merge_request.open?
        %span.pull-right
          .btn-group
            %a.btn.dropdown-toggle{ data: {toggle: :dropdown} }
              %i.fa.fa-download
              Download as
              %span.caret
            %ul.dropdown-menu
              %li= link_to "Email Patches", project_merge_request_path(@project, @merge_request, format: :patch)
              %li= link_to "Plain Diff",    project_merge_request_path(@project, @merge_request, format: :diff)
32

33 34
  = render "projects/merge_requests/show/how_to_merge"
  = render "projects/merge_requests/show/state_widget"
35

36 37 38 39
  - if @commits.present?
    %ul.nav.nav-tabs.merge-request-tabs
      %li.notes-tab{data: {action: 'notes'}}
        = link_to project_merge_request_path(@project, @merge_request) do
40
          %i.fa.fa-comments
41 42
          Discussion
          %span.badge= @merge_request.mr_and_commit_notes.count
43
      %li.commits-tab{data: {action: 'commits'}}
Dmitriy Zaporozhets committed
44
        = link_to project_merge_request_path(@project, @merge_request), title: 'Commits' do
45
          %i.fa.fa-history
46 47
          Commits
          %span.badge= @commits.size
48 49 50 51 52 53
      %li.diffs-tab{data: {action: 'diffs'}}
        = link_to diffs_project_merge_request_path(@project, @merge_request) do
          %i.fa.fa-list-alt
          Changes
          %span.badge= @merge_request.diffs.size

54 55 56 57
  .notes.tab-content.voting_notes#notes{ class: (controller.action_name == 'show') ? "" : "hide" }
    = render "projects/merge_requests/discussion"
  .commits.tab-content
    = render "projects/merge_requests/show/commits"
58 59 60
  .diffs.tab-content
    - if current_page?(action: 'diffs')
      = render "projects/merge_requests/show/diffs"
61

62 63
  .mr-loading-status
    = spinner
64

65 66

:javascript
67
  var merge_request;
68

69 70 71 72
  merge_request = new MergeRequest({
    url_to_automerge_check: "#{automerge_check_project_merge_request_path(@project, @merge_request)}",
    check_enable: #{@merge_request.unchecked? ? "true" : "false"},
    url_to_ci_check: "#{ci_status_project_merge_request_path(@project, @merge_request)}",
73
    ci_enable: #{@project.ci_service ? "true" : "false"},
74 75 76
    current_status: "#{@merge_request.merge_status_name}",
    action: "#{controller.action_name}"
  });