2012-12-02 14:53:50 -05:00
%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)
2013-06-30 12:44:59 -04:00
= link_to "#", title: "Edit comment", class: "js-note-edit" do
2013-06-26 10:32:34 -04:00
%i.icon-edit
= link_to project_note_path(@project, note), title: "Remove comment", method: :delete, confirm: 'Are you sure you want to remove this comment?', remote: true, class: "danger js-note-delete" do
2013-01-15 04:12:17 -05:00
%i.icon-trash.cred
2013-06-22 09:00:39 -04:00
= image_tag gravatar_icon(note.author_email), class: "avatar s32"
2013-01-17 15:35:45 -05:00
= link_to_member(@project, note.author, avatar: false)
2012-12-02 14:53:50 -05:00
%span.note-last-update
2013-06-26 10:32:34 -04:00
= note_timestamp(note)
2012-10-10 06:14:48 -04:00
2012-10-29 22:27:36 -04:00
- 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
2012-10-10 06:09:45 -04:00
2011-11-15 03:34:30 -05:00
2012-12-02 14:53:50 -05:00
.note-body
2013-06-26 10:32:34 -04:00
.note-text
= preserve do
= markdown(note.note)
.note-edit-form
= form_for note, url: project_note_path(@project, note), method: :put, remote: true do |f|
= f.text_area :note, class: 'note_text js-note-text js-gfm-input turn-on'
.form-actions
= f.submit 'Save changes', class: "btn btn-primary btn-save"
.note-form-option
%a.choose-btn.btn.btn-small.js-choose-note-attachment-button
%i.icon-paper-clip
%span Choose File ...
%span.file_name.js-attachment-filename File name...
= f.file_field :attachment, class: "js-note-attachment-input hide"
2013-06-30 12:44:59 -04:00
= link_to 'Cancel', "#", class: "btn btn-cancel note-edit-cancel"
2013-06-26 10:32:34 -04:00
2012-11-21 21:20:41 -05:00
- if note.attachment.url
2013-06-26 10:32:34 -04:00
.note-attachment
- if note.attachment.image?
2013-07-11 02:19:19 -04:00
= link_to note.attachment.url, target: '_blank' do
= image_tag note.attachment.url, class: 'note-image-attach'
2013-06-26 10:32:34 -04:00
.attachment.pull-right
= link_to note.attachment.secure_url, target: "_blank" do
%i.icon-paper-clip
= note.attachment_identifier
= link_to delete_attachment_project_note_path(@project, note),
title: "Delete this attachment", method: :delete, remote: true, confirm: 'Are you sure you want to remove the attachment?', class: "danger js-note-attachment-delete" do
%i.icon-trash.cred
2011-10-08 17:36:38 -04:00
.clear