BigW Consortium Gitlab

_show.html.haml 3.25 KB
Newer Older
1
- page_title "#{@merge_request.title} (##{@merge_request.iid})", "Merge Requests"
2
.merge-request{'data-url' => merge_request_path(@merge_request)}
3 4 5 6 7 8 9 10 11 12 13
  .merge-request-details
    = render "projects/merge_requests/show/mr_title"
    %hr
    = 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
14
              = link_to @merge_request.source_project_namespace, namespace_project_path(@merge_request.source_project.namespace, @merge_request.source_project)
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
            - else
              \ #{@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
32 33
                %li= link_to "Email Patches", merge_request_path(@merge_request, format: :patch)
                %li= link_to "Plain Diff",    merge_request_path(@merge_request, format: :diff)
34

35 36
    = render "projects/merge_requests/show/how_to_merge"
    = render "projects/merge_requests/show/state_widget"
37

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

56 57 58 59
  .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"
60 61 62
  .diffs.tab-content
    - if current_page?(action: 'diffs')
      = render "projects/merge_requests/show/diffs"
63

64 65
  .mr-loading-status
    = spinner
66

67 68

:javascript
69
  var merge_request;
70

71
  merge_request = new MergeRequest({
Vinnie Okada committed
72
    url_to_automerge_check: "#{automerge_check_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}",
73
    check_enable: #{@merge_request.unchecked? ? "true" : "false"},
Vinnie Okada committed
74
    url_to_ci_check: "#{ci_status_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}",
75
    ci_enable: #{@project.ci_service ? "true" : "false"},
76
    current_status: "#{@merge_request.automerge_status}",
77 78
    action: "#{controller.action_name}"
  });