summaryrefslogtreecommitdiff
path: root/app/views/projects/issues/_issue.html.haml
blob: 5b0edcfa978e70eecb524a029f7744100620df88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
%li{ id: dom_id(issue), class: issue_css_classes(issue), url: issue_path(issue) }
  - if controller.controller_name == 'issues' && can?(current_user, :admin_issue, @project)
    .issue-check
      = check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, class: "selected_issue"

  .issue-title
    %span.issue-title-text
      = link_to_gfm issue.title, issue_path(issue), class: "row_title"
    %ul.controls.light
      - if issue.closed?
        %li
          CLOSED

      - if issue.assignee
        %li
          = link_to_member(@project, issue.assignee, name: false, title: "Assigned to :name")

      - upvotes, downvotes = issue.upvotes, issue.downvotes
      - if upvotes > 0 || downvotes > 0
        %li
          = icon('thumbs-up')
          = upvotes
      - else
        %li{ class: 'issue-no-votes' }
          = icon('thumbs-up')
          = upvotes

      - if upvotes > 0 || downvotes > 0
        %li
          = icon('thumbs-down')
          = downvotes
      - else
        %li{ class: 'issue-no-votes' }
          = icon('thumbs-down')
          = downvotes

      - note_count = issue.notes.user.count
      - if note_count > 0
        %li
          = link_to issue_path(issue) + "#notes" do
            = icon('comments')
            = note_count
      - else
        %li
          = link_to issue_path(issue) + "#notes", class: "issue-no-comments" do
            = icon('comments')
            = note_count

  .issue-info
    #{issue.to_reference} ·
    opened #{time_ago_with_tooltip(issue.created_at, placement: 'bottom')}
    by #{link_to_member(@project, issue.author, avatar: false)}
    - if issue.milestone
       
      = link_to namespace_project_issues_path(issue.project.namespace, issue.project, milestone_title: issue.milestone.title) do
        = icon('clock-o')
        = issue.milestone.title
    - if issue.labels.any?
       
      - issue.labels.each do |label|
        = link_to_label(label, project: issue.project)
    - if issue.tasks?
       
      %span.task-status
        = issue.task_status

    .pull-right.issue-updated-at
      %span updated #{time_ago_with_tooltip(issue.updated_at, placement: 'bottom', html_class: 'issue_update_ago')}