Add collapse to profile questions

This commit is contained in:
Andreas Nedbal 2023-01-15 13:06:54 +01:00 committed by Andreas Nedbal
parent 16bba0b7f0
commit eae99cd9a5
1 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,6 @@
- type ||= nil
.card.questionbox{ data: { id: q.id } }
.card-body
.card-body{ data: { controller: q.long? ? "collapse" : nil } }
.d-flex
- if type == 'discover'
.flex-shrink-0
@ -13,8 +13,10 @@
·
%a{ href: question_path(q.user.screen_name, q.id) }
= pluralize(q.answer_count, t("voc.answer"))
.answerbox__question-text
.answerbox__question-text{ class: q.long? ? 'collapsed' : '', data: { collapse_target: "content" } }
= question_markdown q.content
- if q.long?
= render "shared/collapse", type: "question"
- if user_signed_in?
.flex-shrink-0.ms-auto
.btn-group