summaryrefslogtreecommitdiff
path: root/app/views/notes/_note.html.haml
blob: b355e2a0bd4ef4f8cdf8c7c29b9befc1c124bff5 (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
%li{ id: dom_id(note), class: dom_class(note), data: { discussion: note.discussion_id } }
  .note-header
    .note-actions
      = link_to "##{dom_id(note)}", name: dom_id(note) do
        %i.icon-link
        Link here
       
      - if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project)
        = link_to project_note_path(@project, note), title: "Remove comment", method: :delete, confirm: 'Are you sure you want to remove comment?', remote: true, class: "danger js-note-delete" do
          %i.icon-trash.cred
    = image_tag gravatar_icon(note.author.email), class: "avatar s32"
    = link_to_member(@project, note.author, avatar: false)
    %span.note-last-update
      = time_ago_in_words(note.updated_at)
      ago

    - if note.upvote?
      %span.vote.upvote.label.label-success
        %i.icon-thumbs-up
        \+1
    - if note.downvote?
      %span.vote.downvote.label.label-error
        %i.icon-thumbs-down
        \-1


  .note-body
    = preserve do
      = markdown(note.note)
  - if note.attachment.url
    - if note.attachment.image?
      = image_tag note.attachment.url, class: 'note-image-attach'
    .attachment.pull-right
      = link_to note.attachment.secure_url, target: "_blank" do
        %i.icon-paper-clip
        = note.attachment_identifier
  .clear