BigW Consortium Gitlab

_merge_request.html.haml 2.73 KB
Newer Older
1
%li{ class: mr_css_classes(merge_request) }
2
  .merge-request-title.title
3
    %span.merge-request-title-text
4 5
      = link_to_gfm merge_request.title, merge_request_path(merge_request)
    %ul.controls
6
      - if merge_request.merged?
7
        %li
8
          MERGED
9
      - elsif merge_request.closed?
10
        %li
11
          = icon('ban')
12
          CLOSED
13

14
      - if merge_request.ci_commit
15
        %li
16
          = render_ci_status(merge_request.ci_commit)
17 18 19

      - if merge_request.open? && merge_request.broken?
        %li
20
          = link_to merge_request_path(merge_request), class: "has-tooltip", title: "Cannot be merged automatically", data: { container: 'body' } do
21 22
            = icon('exclamation-triangle')

23
      - if merge_request.assignee
24 25 26
        %li
          = link_to_member(merge_request.source_project, merge_request.assignee, name: false, title: "Assigned to :name")

27
      - upvotes, downvotes = merge_request.upvotes, merge_request.downvotes
28
      - if upvotes > 0
29 30 31 32
        %li
          = icon('thumbs-up')
          = upvotes

33
      - if downvotes > 0
34 35 36 37
        %li
          = icon('thumbs-down')
          = downvotes

38
      - note_count = merge_request.mr_and_commit_notes.user.nonawards.count
39
      - if note_count > 0
40 41 42 43
        %li
          = link_to merge_request_path(merge_request) + "#notes" do
            = icon('comments')
            = note_count
44
      - else
45 46 47 48
        %li
          = link_to merge_request_path(merge_request) + "#notes", class: "merge-request-no-comments" do
            = icon('comments')
            = note_count
49

50
  .merge-request-info
51
    #{merge_request.to_reference} ·
52 53
    opened #{time_ago_with_tooltip(merge_request.created_at, placement: 'bottom')}
    by #{link_to_member(@project, merge_request.author, avatar: false)}
54 55
    - if merge_request.target_project.default_branch != merge_request.target_branch
       
56 57
      = link_to namespace_project_commits_path(merge_request.project.namespace, merge_request.project, merge_request.target_branch) do
        = icon('code-fork')
58
        = merge_request.target_branch
59
    - if merge_request.milestone
60
       
61 62
      = link_to namespace_project_merge_requests_path(merge_request.project.namespace, merge_request.project, milestone_title: merge_request.milestone.title) do
        = icon('clock-o')
63
        = merge_request.milestone.title
64 65 66
    - if merge_request.labels.any?
       
      - merge_request.labels.each do |label|
67
        = link_to_label(label, project: merge_request.project, type: 'merge_request')
68
    - if merge_request.tasks?
69
       
70 71
      %span.task-status
        = merge_request.task_status
72

73
    .pull-right.hidden-xs
74
      %span updated #{time_ago_with_tooltip(merge_request.updated_at, placement: 'bottom', html_class: 'merge_request_updated_ago')}