Retrospring/app/views/answerbox/_comments.html.haml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
1.2 KiB
Plaintext
Raw Normal View History

2023-03-11 10:48:04 -08:00
- if comments.all.count.zero?
2022-07-30 13:45:40 -07:00
= t(".none")
- 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 } }
.d-flex
.flex-shrink-0
%a{ href: user_path(comment.user) }
= render AvatarComponent.new(user: comment.user, size: "sm", classes: ["comment__user-avatar"])
.flex-grow-1
%h6.comment__user
2015-05-16 20:36:23 -07:00
= user_screen_name comment.user
%span.text-muted{ title: comment.created_at, data: { bs_toggle: :tooltip, bs_placement: :right } }
= 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
.flex-shrink-0.ms-auto
- if current_user&.smiled?(comment)
= render "reactions/destroy", type: "Comment", target: comment
- else
= render "reactions/create", type: "Comment", target: comment
.btn-group
%button.btn.btn-link.btn-sm.dropdown-toggle{ data: { bs_toggle: :dropdown }, aria: { expanded: false } }
%span.caret
= render "actions/comment", comment: comment, answer: a