From eae99cd9a58f8449b2ae7d9c7e266bb443e55b06 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 15 Jan 2023 13:06:54 +0100 Subject: [PATCH] Add collapse to profile questions --- app/views/shared/_question.html.haml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/shared/_question.html.haml b/app/views/shared/_question.html.haml index 9f6e31b2..354f8a6b 100644 --- a/app/views/shared/_question.html.haml +++ b/app/views/shared/_question.html.haml @@ -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