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