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

44 lines
2.3 KiB
Text
Raw Normal View History

2020-05-10 14:22:04 +02:00
- if a.comments.all.count.zero?
2022-07-30 22:45:40 +02:00
= t(".none")
- else
2020-05-02 21:23:04 +02:00
%ul.comment__container
2015-04-22 18:19:14 +02:00
- a.comments.order(:created_at).each do |comment|
2020-05-10 14:22:04 +02:00
%li.comment{ data: { comment_id: comment.id } }
2022-01-29 21:28:24 +01:00
%div{ style: "height: 0; width: 0" }= render "modal/comment_smiles", comment: comment
.d-flex
.flex-shrink-0
%a{ href: user_path(comment.user) }
%img.comment__user-avatar.avatar-sm{ src: comment.user.profile_picture.url(:small), loading: :lazy }
.flex-grow-1
%h6.comment__user
2015-05-17 05:36:23 +02: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 21:23:04 +02:00
.comment__content
= markdown comment.content
.flex-shrink-0.ms-auto
%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
%button.btn.btn-link.btn-sm.dropdown-toggle{ data: { bs_toggle: :dropdown }, aria: { expanded: false } }
%span.caret
= render "actions/comment", comment: comment, answer: a
2014-12-05 20:17:44 +01:00
- if user_signed_in?
2023-03-05 17:29:38 +01:00
%button.d-none{ name: "ab-open-and-comment", data: { a_id: a.id, selection_hotkey: "c" } }
2023-03-07 17:56:39 +01:00
.comment__compose-wrapper{
2023-01-22 11:14:24 +01:00
name: "ab-comment-new-group",
data: { a_id: a.id, controller: "character-count", character_count_max_value: 512 }
}
2023-03-07 17:56:39 +01:00
.form-group.has-feedback.comment__input-group.input-group
%textarea.form-control.comment__input{ type: :text, placeholder: t(".placeholder"), name: "ab-comment-new", data: { a_id: a.id, "character-count-target": "input" } }
.comment__submit-wrapper
2023-03-10 21:06:11 +01:00
%button.btn.btn-primary{
type: :button,
name: "ab-comment-new-submit",
title: t(".action"),
data: { a_id: a.id, "character-count-target": "action" }
}
2023-03-07 17:56:39 +01:00
%i.fa.fa-paper-plane-o
%span.text-muted.form-control-feedback.comment__character-count{ id: "ab-comment-charcount-#{a.id}", data: { "character-count-target": "counter" } } 512