_note.html.haml 2.77 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 7
      - if note.system
        %span.fa.fa-circle
      - else
        = image_tag avatar_icon(note.author_email), class: "avatar s40"
8 9 10 11
    .timeline-content
      .note-header
        .note-actions
          = link_to "##{dom_id(note)}", name: dom_id(note) do
12
            %i.fa.fa-link
13 14
            Link here
           
15
          - if can?(current_user, :admin_note, note) && note.editable?
16
            = link_to "#", title: "Edit comment", class: "js-note-edit" do
17
              %i.fa.fa-pencil-square-o
18 19 20
              Edit
             
            = link_to project_note_path(@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
21
              %i.fa.fa-trash-o.cred
22
              Remove
Drew Blessing's avatar
Drew Blessing committed
23 24
        - if note.system
          = image_tag avatar_icon(note.author_email), class: "avatar s16"
25
        = link_to_member(@project, note.author, avatar: false)
26 27
        %span.author-username
          = '@' + note.author.username
28 29
        %span.note-last-update
          = note_timestamp(note)
30

31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
        - 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
49

50

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

57 58 59 60 61
      - if note.attachment.url
        .note-attachment
          - if note.attachment.image?
            = link_to note.attachment.secure_url, target: '_blank' do
              = image_tag note.attachment.secure_url, class: 'note-image-attach'
62
          .attachment
63
            = link_to note.attachment.secure_url, target: "_blank" do
64
              %i.fa.fa-paperclip
65 66 67
              = note.attachment_identifier
              = link_to delete_attachment_project_note_path(@project, note),
                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
68
                %i.fa.fa-trash-o.cred
69
      .clear