_show.html.haml 2.19 KB
Newer Older
1
.merge-request
2 3 4
  = render "projects/merge_requests/show/mr_title"
  = render "projects/merge_requests/show/how_to_merge"
  = render "projects/merge_requests/show/mr_box"
5
  = render "projects/merge_requests/show/state_widget"
6
  = render "projects/merge_requests/show/commits"
7
  = render "projects/merge_requests/show/participants"
8

9
  - if @commits.present?
10
    %ul.nav.nav-pills.merge-request-tabs
11 12 13
      %li.notes-tab{data: {action: 'notes'}}
        = link_to project_merge_request_path(@project, @merge_request) do
          %i.icon-comment
14
          Discussion
15
          %span.badge= @merge_request.mr_and_commit_notes.count
16 17 18
      %li.diffs-tab{data: {action: 'diffs'}}
        = link_to diffs_project_merge_request_path(@project, @merge_request) do
          %i.icon-list-alt
19
          Changes
20
          %span.badge= @merge_request.diffs.size
21

22 23
  - content_for :note_actions do
    - if can?(current_user, :modify_merge_request, @merge_request)
24 25
      - unless @merge_request.closed? || @merge_request.merged?
        = link_to 'Close', project_merge_request_path(@project, @merge_request, merge_request: {state_event: :close }), method: :put, class: "btn btn-grouped btn-close close-mr-link", title: "Close merge request"
26 27
      - if @merge_request.closed?
        = link_to 'Reopen', project_merge_request_path(@project, @merge_request, merge_request: {state_event: :reopen }), method: :put, class: "btn btn-grouped btn-reopen reopen-mr-link", title: "Close merge request"
28

29
  .notes.tab-content.voting_notes#notes{ class: (controller.action_name == 'show') ? "" : "hide" }
30
    = render "projects/notes/notes_with_form"
31
  .diffs.tab-content
32 33
    - if current_page?(action: 'diffs')
      = render "projects/merge_requests/show/diffs"
34
  .status
35 36

:javascript
37
  var merge_request;
38

39 40 41 42
  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)}",
43
    ci_enable: #{@project.ci_service ? "true" : "false"},
44 45 46
    current_status: "#{@merge_request.merge_status_name}",
    action: "#{controller.action_name}"
  });