2020-05-10 05:22:04 -07:00
|
|
|
- if a.comments.all.count.zero?
|
2022-07-30 13:45:40 -07:00
|
|
|
= t(".none")
|
2014-12-09 06:32:29 -08:00
|
|
|
- else
|
2020-05-02 12:23:04 -07:00
|
|
|
%ul.comment__container
|
2015-04-22 09:19:14 -07:00
|
|
|
- a.comments.order(:created_at).each do |comment|
|
2020-05-10 05:22:04 -07:00
|
|
|
%li.comment{ data: { comment_id: comment.id } }
|
2022-01-29 12:28:24 -08:00
|
|
|
%div{ style: "height: 0; width: 0" }= render "modal/comment_smiles", comment: comment
|
2023-01-04 07:12:43 -08:00
|
|
|
.d-flex
|
|
|
|
.flex-shrink-0
|
2022-07-23 03:06:05 -07:00
|
|
|
%a{ href: user_path(comment.user) }
|
2022-10-10 14:14:07 -07:00
|
|
|
%img.comment__user-avatar.avatar-sm{ src: comment.user.profile_picture.url(:small), loading: :lazy }
|
2023-01-04 07:12:43 -08:00
|
|
|
.flex-grow-1
|
|
|
|
%h6.comment__user
|
2015-05-16 20:36:23 -07:00
|
|
|
= user_screen_name comment.user
|
2023-01-04 03:23:47 -08:00
|
|
|
%span.text-muted{ title: comment.created_at, data: { bs_toggle: :tooltip, bs_placement: :right } }
|
2022-07-31 04:52:51 -07:00
|
|
|
= t("time.distance_ago", time: time_ago_in_words(comment.created_at))
|
2020-05-02 12:23:04 -07:00
|
|
|
.comment__content
|
|
|
|
= markdown comment.content
|
2023-01-04 07:12:43 -08:00
|
|
|
.flex-shrink-0.ms-auto
|
2022-08-31 11:16:16 -07:00
|
|
|
%button.btn.btn-link.answerbox__action{ type: :button, name: "ab-smile-comment", data: { c_id: comment.id, action: current_user&.smiled?(comment) ? :unsmile : :smile }, disabled: !user_signed_in? }
|
|
|
|
%i.fa.fa-fw.fa-smile-o
|
|
|
|
%span{ id: "ab-comment-smile-count-#{comment.id}" }= comment.smile_count
|
|
|
|
.btn-group
|
2023-01-04 03:23:47 -08:00
|
|
|
%button.btn.btn-link.btn-sm.dropdown-toggle{ data: { bs_toggle: :dropdown }, aria: { expanded: false } }
|
2022-08-31 11:16:16 -07:00
|
|
|
%span.caret
|
|
|
|
= render "actions/comment", comment: comment, answer: a
|
2014-12-05 11:17:44 -08:00
|
|
|
- if user_signed_in?
|
2023-01-22 02:14:24 -08:00
|
|
|
.form-group.has-feedback.comment__input-group.input-group{
|
|
|
|
name: "ab-comment-new-group",
|
|
|
|
data: { a_id: a.id, controller: "character-count", character_count_max_value: 512 }
|
|
|
|
}
|
2022-10-02 13:10:04 -07:00
|
|
|
%input.form-control.comment__input{ type: :text, placeholder: t(".placeholder"), name: "ab-comment-new", data: { a_id: a.id, "character-count-target": "input" } }
|
2023-01-22 01:36:23 -08:00
|
|
|
%span.text-muted.form-control-feedback.comment__character-count{ id: "ab-comment-charcount-#{a.id}", data: { "character-count-target": "counter" } } 512
|
2022-10-13 13:29:25 -07:00
|
|
|
%button.btn.btn-primary.d-none{ type: :button, name: "ab-comment-new-submit", data: { a_id: a.id, "character-count-target": "action" } }= t(".action")
|