_note.html.haml 1.29 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
%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), method: :delete, confirm: 'Are you sure?', remote: true, class: "danger js-note-delete" do
          %i.icon-remove-circle
    = image_tag gravatar_icon(note.author.email), class: "avatar s32"
    = link_to note.author_name, project_team_member_path(@project, @project.team_member_by_id(note.author)), class: "note-author"
    %span.note-last-update
      = time_ago_in_words(note.updated_at)
      ago
16

17 18 19 20 21 22 23 24 25 26 27
    -# only show vote if it's a note for the main target
    - if note_for_main_target?(note)
      - 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

28

29
  .note-body
30 31
    = preserve do
      = markdown(note.note)
gitlabhq's avatar
gitlabhq committed
32
    - if note.attachment.url
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
33
      .right
34
        %div.file
35
          = link_to note.attachment_identifier, note.attachment.url, target: "_blank"
gitlabhq's avatar
gitlabhq committed
36
  .clear