Add collapse to answerboxes and questions
This commit is contained in:
parent
46830f50cd
commit
a3b902b747
|
@ -13,8 +13,11 @@
|
|||
·
|
||||
%a{ href: question_path(a.question.user.screen_name, a.question.id) }
|
||||
= t(".answers", count: a.question.answer_count)
|
||||
.answerbox__question-text
|
||||
= question_markdown a.question.content
|
||||
.answerbox__question-body{ data: { controller: "collapse" } }
|
||||
.answerbox__question-text{ class: a.question.long? ? "collapsed" : "", data: { collapse_target: "content" } }
|
||||
= question_markdown a.question.content
|
||||
- if a.question.long?
|
||||
= render "shared/collapse", type: "question"
|
||||
- if user_signed_in?
|
||||
.flex-shrink-0.ms-auto
|
||||
.btn-group
|
||||
|
|
|
@ -3,16 +3,11 @@
|
|||
- if @question.nil?
|
||||
= render "answerbox/header", a: a
|
||||
.card-body
|
||||
- if display_all.nil?
|
||||
.answerbox__answer-text
|
||||
= markdown a.content.truncate(640, omission: " [...]", separator: /\s/)
|
||||
- if a.content.length > 640
|
||||
%p
|
||||
%a.btn.btn-primary{ href: answer_path(a.user.screen_name, a.id) }
|
||||
= t(".read")
|
||||
- else
|
||||
.answerbox__answer-text
|
||||
.answerbox__answer-body{ data: { controller: "collapse" } }
|
||||
.answerbox__answer-text{ class: a.long? ? "collapsed" : "", data: { collapse_target: "content" } }
|
||||
= markdown a.content
|
||||
- if a.long?
|
||||
= render "shared/collapse", type: "answer"
|
||||
- if @user.nil?
|
||||
.row
|
||||
.col-sm-6.text-start.text-muted
|
||||
|
|
|
@ -14,7 +14,11 @@
|
|||
·
|
||||
%a{ href: question_path(i.question.user.screen_name, i.question.id) }
|
||||
= t(".answers", count: i.question.answer_count)
|
||||
.answerbox__question-text= question_markdown i.question.content
|
||||
.answerbox__question-body{ data: { controller: "collapse" } }
|
||||
.answerbox__question-text{ class: i.question.long? ? "collapsed" : "", data: { collapse_target: "content" } }
|
||||
= question_markdown i.question.content
|
||||
- if i.question.long?
|
||||
= render "shared/collapse", type: "question"
|
||||
- if i.question.user_id != current_user.id || current_user.has_cached_role?(:administrator)
|
||||
.flex-shrink-0.ms-auto
|
||||
.btn-group
|
||||
|
|
|
@ -13,7 +13,11 @@
|
|||
= user_screen_name question.user, author_identifier: identifier, url: false
|
||||
- else
|
||||
= t("answerbox.header.asked_html", user: user_screen_name(question.user, author_identifier: identifier), time: time_tooltip(question))
|
||||
.answerbox__question-text= question_markdown question.content
|
||||
.answerbox__question-body{ data: { controller: "collapse" } }
|
||||
.answerbox__question-text{ class: question.long? ? "collapsed" : "", data: { collapse_target: "content" } }
|
||||
= question_markdown question.content
|
||||
- if question.long?
|
||||
= render "shared/collapse", type: "question"
|
||||
- if user_signed_in?
|
||||
.flex-shrink-0.ms-auto
|
||||
.btn-group
|
||||
|
|
Loading…
Reference in New Issue