2014-12-05 11:17:44 -08:00
|
|
|
- if a.comments.all.count == 0
|
2014-12-05 10:50:21 -08:00
|
|
|
There are no comments yet.
|
2014-12-09 06:32:29 -08:00
|
|
|
- else
|
2014-12-07 06:36:08 -08:00
|
|
|
%ul.comments
|
2015-04-22 09:19:14 -07:00
|
|
|
- a.comments.order(:created_at).each do |comment|
|
2014-12-08 07:01:27 -08:00
|
|
|
%li{data: { comment_id: comment.id }}
|
2015-05-03 18:39:41 -07:00
|
|
|
%div{class: "ab-comment-smile-list", style: "height: 0; width: 0"}= render "shared/comment_smiles", comment: comment
|
2014-12-27 07:03:09 -08:00
|
|
|
.media.comments--media
|
2014-12-27 06:12:57 -08:00
|
|
|
.pull-left
|
|
|
|
%img.img-rounded.answerbox--img{src: gravatar_url(comment.user)}
|
2014-12-27 06:50:36 -08:00
|
|
|
.media-body.comments--body
|
2014-12-27 06:12:57 -08:00
|
|
|
%h6.media-heading.answerbox--question-user= user_screen_name comment.user
|
2015-05-03 18:39:41 -07:00
|
|
|
.pull-right
|
|
|
|
%span.hidden-xs.text-muted
|
|
|
|
- unless user_signed_in?
|
|
|
|
- if comment.smile_count > 0
|
|
|
|
%button.btn.btn-info.btn-sm{name: 'ab-smile-comment', disabled: true}
|
|
|
|
%i.fa.fa-smile-o
|
|
|
|
%span{id: "ab-comment-smile-count-#{comment.id}"}= comment.smile_count
|
|
|
|
- if user_signed_in?
|
|
|
|
- if current_user.smiled_comment? comment
|
|
|
|
%button.btn.btn-info.btn-sm{type: :button, name: 'ab-smile-comment', data: { c_id: comment.id, action: :unsmile }}
|
|
|
|
%i.fa.fa-frown-o
|
|
|
|
%span{id: "ab-comment-smile-count-#{comment.id}"}= comment.smile_count
|
|
|
|
- else
|
|
|
|
%button.btn.btn-info.btn-sm{type: :button, name: 'ab-smile-comment', data: { c_id: comment.id, action: :smile }}
|
|
|
|
%i.fa.fa-smile-o
|
|
|
|
%span{id: "ab-comment-smile-count-#{comment.id}"}= comment.smile_count
|
2014-12-27 06:39:45 -08:00
|
|
|
.btn-group
|
2014-12-27 06:22:30 -08:00
|
|
|
%button.btn.btn-link.btn-sm.dropdown-toggle{data: { toggle: :dropdown }, aria: { expanded: :false }}
|
|
|
|
%span.caret
|
|
|
|
%ul.dropdown-menu.dropdown-menu-right{role: :menu}
|
2015-05-03 18:39:41 -07:00
|
|
|
%li
|
|
|
|
%a{href: '#', type: :button, data: { target: "#modal-view-comment#{comment.id}-smiles", toggle: :modal}}
|
|
|
|
%i.fa.fa-smile-o
|
|
|
|
View comment smiles
|
2014-12-28 12:14:01 -08:00
|
|
|
- if privileged?(comment.user) or privileged?(a.user)
|
2014-12-27 06:22:30 -08:00
|
|
|
%li.text-danger
|
2014-12-28 12:14:01 -08:00
|
|
|
%a{href: '#', data: { action: 'ab-comment-destroy', c_id: comment.id }}
|
2014-12-27 06:22:30 -08:00
|
|
|
%i.fa.fa-trash-o
|
|
|
|
Delete
|
2015-01-01 15:41:26 -08:00
|
|
|
- unless comment.user == current_user
|
|
|
|
%li
|
|
|
|
%a{href: '#', data: { action: 'ab-comment-report', c_id: comment.id }}
|
|
|
|
%i.fa.fa-exclamation-triangle
|
|
|
|
Report
|
2015-01-07 04:59:04 -08:00
|
|
|
.comments--content
|
2015-01-06 22:02:07 -08:00
|
|
|
= markdown comment.content
|
2014-12-05 11:17:44 -08:00
|
|
|
- if user_signed_in?
|
2014-12-28 12:14:01 -08:00
|
|
|
.form-group.has-feedback{name: 'ab-comment-new-group', data: { a_id: a.id }}
|
2014-12-10 12:16:18 -08:00
|
|
|
%input.form-control.comments--box{type: :text, placeholder: 'Comment...', name: 'ab-comment-new', data: {a_id: a.id }}
|
2015-04-22 09:19:14 -07:00
|
|
|
%span.text-muted.form-control-feedback.comments--count{id: "ab-comment-charcount-#{a.id}"} 160
|