Retrospring/app/views/application/_answerbox.html.haml

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

56 lines
2.8 KiB
Plaintext
Raw Normal View History

2020-05-10 05:22:33 -07:00
- display_all ||= nil
.card.answerbox{ data: { id: a.id, q_id: a.question.id, navigation_target: "traversable" } }
2020-04-26 08:13:31 -07:00
- if @question.nil?
.card-header
= render QuestionComponent.new(question: a.question, context_user: a.user, collapse: !display_all)
2020-04-26 08:13:31 -07:00
.card-body
.answerbox__answer-body{ data: { controller: a.long? ? "collapse" : nil } }
.answerbox__answer-text{ class: a.long? && !display_all ? "collapsed" : "", data: { collapse_target: "content" } }
2020-04-26 08:13:31 -07:00
= markdown a.content
- if a.long? && !display_all
= render "shared/collapse", type: "answer"
.d-md-flex
.text-muted
.d-flex.align-items-center
.flex-shrink-0
%a{ href: user_path(a.user) }
= render AvatarComponent.new(user: a.user, size: "sm", classes: ["answerbox__answer-user-avatar"])
.flex-grow-1
%h6.answerbox__answer-user
= user_screen_name(a.user)
2023-02-07 14:12:13 -08:00
·
= link_to(time_tooltip(a), answer_path(a.user.screen_name, a.id), data: { selection_hotkey: "l" })
2024-03-02 12:57:39 -08:00
- if a.pinned_at.present?
%span.answerbox__pinned
·
%i.fa.fa-thumbtack
= t(".pinned")
.d-flex.d-md-block.answerbox__actions.ms-auto
= render "answerbox/actions", a:, display_all:
2022-07-30 13:47:18 -07:00
.card-footer{ id: "ab-comments-section-#{a.id}", class: display_all.nil? ? "d-none" : nil }
= turbo_frame_tag("ab-reactions-list-#{a.id}", src: reactions_path(a.question, a), loading: :lazy) do
.d-flex.smiles
.flex-shrink-0.me-1
%i.fa.fa-smile-o
2023-03-11 10:48:04 -08:00
= turbo_frame_tag("ab-comments-list-#{a.id}", src: comments_path(a.question, a), loading: :lazy) do
.d-flex.justify-content-center
.spinner-border{ role: :status }
.visually-hidden= t("voc.loading")
- if user_signed_in?
%button.d-none{ name: "ab-open-and-comment", data: { a_id: a.id, selection_hotkey: "c" } }
.comment__compose-wrapper{
name: "ab-comment-new-group",
data: { a_id: a.id, controller: "character-count", character_count_max_value: 512 }
}
.form-group.has-feedback.comment__input-group.input-group
%textarea.form-control.comment__input{ type: :text, placeholder: t(".comments.placeholder"), name: "ab-comment-new", data: { a_id: a.id, "character-count-target": "input" } }
.comment__submit-wrapper
%button.btn.btn-primary{
type: :button,
name: "ab-comment-new-submit",
title: t(".comments.action"),
data: { a_id: a.id, "character-count-target": "action" }
}
%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