2023-03-11 10:48:04 -08:00
|
|
|
- if 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
|
2023-03-11 10:48:04 -08:00
|
|
|
- comments.order(:created_at).each do |comment|
|
2020-05-10 05:22:04 -07:00
|
|
|
%li.comment{ data: { comment_id: comment.id } }
|
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) }
|
2023-10-20 02:45:53 -07:00
|
|
|
= render AvatarComponent.new(user: comment.user, size: "sm", classes: ["comment__user-avatar"])
|
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
|