_note.html.haml 2.9 KB
Newer Older
1
%li.timeline-entry{ id: dom_id(note), class: [dom_class(note), "note-row-#{note.id}", ('system-note' if note.system)], data: { discussion: note.discussion_id } }
2 3
  .timeline-entry-inner
    .timeline-icon
Drew Blessing's avatar
Drew Blessing committed
4 5 6
      - if note.system
        %span.fa.fa-circle
      - else
Douwe Maan's avatar
Douwe Maan committed
7 8
        = link_to user_path(note.author) do
          = image_tag avatar_icon(note.author_email), class: "avatar s40"
9 10 11 12
    .timeline-content
      .note-header
        .note-actions
          = link_to "##{dom_id(note)}", name: dom_id(note) do
13
            %i.fa.fa-link
14 15
            Link here
           
16
          - if can?(current_user, :admin_note, note) && note.editable?
17
            = link_to "#", title: "Edit comment", class: "js-note-edit" do
18
              %i.fa.fa-pencil-square-o
19 20
              Edit
             
Vinnie Okada's avatar
Vinnie Okada committed
21
            = link_to namespace_project_note_path(@project.namespace, @project, note), title: "Remove comment", method: :delete, data: { confirm: 'Are you sure you want to remove this comment?' }, remote: true, class: "danger js-note-delete" do
22
              %i.fa.fa-trash-o.cred
23
              Remove
Drew Blessing's avatar
Drew Blessing committed
24
        - if note.system
Douwe Maan's avatar
Douwe Maan committed
25 26
          = link_to user_path(note.author) do
            = image_tag avatar_icon(note.author_email), class: "avatar s16"
27
        = link_to_member(@project, note.author, avatar: false)
28 29
        %span.author-username
          = '@' + note.author.username
30 31
        %span.note-last-update
          = note_timestamp(note)
32

33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
        - if note.superceded?(@notes)
          - if note.upvote?
            %span.vote.upvote.label.label-gray.strikethrough
              %i.fa.fa-thumbs-up
              \+1
          - if note.downvote?
            %span.vote.downvote.label.label-gray.strikethrough
              %i.fa.fa-thumbs-down
              \-1
        - else
          - if note.upvote?
            %span.vote.upvote.label.label-success
              %i.fa.fa-thumbs-up
              \+1
          - if note.downvote?
            %span.vote.downvote.label.label-danger
              %i.fa.fa-thumbs-down
              \-1
51

52

53 54 55 56
      .note-body
        .note-text
          = preserve do
            = markdown(note.note, {no_header_anchors: true})
57
        = render 'projects/notes/edit_form', note: note
Jack Weeden's avatar
Jack Weeden committed
58

59 60 61
      - if note.attachment.url
        .note-attachment
          - if note.attachment.image?
Douwe Maan's avatar
Douwe Maan committed
62 63
            = link_to note.attachment.url, target: '_blank' do
              = image_tag note.attachment.url, class: 'note-image-attach'
64
          .attachment
Douwe Maan's avatar
Douwe Maan committed
65
            = link_to note.attachment.url, target: "_blank" do
66
              %i.fa.fa-paperclip
67
              = note.attachment_identifier
Vinnie Okada's avatar
Vinnie Okada committed
68
              = link_to delete_attachment_namespace_project_note_path(@project.namespace, @project, note),
69
                title: "Delete this attachment", method: :delete, remote: true, data: { confirm: 'Are you sure you want to remove the attachment?' }, class: "danger js-note-attachment-delete" do
70
                %i.fa.fa-trash-o.cred
71
      .clear