2020-05-10 01:02:04 -07:00
|
|
|
- type ||= nil
|
2022-01-03 13:23:21 -08:00
|
|
|
.card.questionbox{ data: { id: q.id } }
|
2023-01-15 04:06:54 -08:00
|
|
|
.card-body{ data: { controller: q.long? ? "collapse" : nil } }
|
2023-01-04 07:12:43 -08:00
|
|
|
.d-flex
|
2023-02-06 06:35:57 -08:00
|
|
|
- if type == "discover"
|
2023-01-04 07:12:43 -08:00
|
|
|
.flex-shrink-0
|
2020-05-10 01:02:04 -07:00
|
|
|
%a{ href: user_screen_name(q.user, link_only: true) }
|
2023-01-04 02:00:45 -08:00
|
|
|
%img.avatar-md.me-2{ src: q.user&.profile_picture&.url(:small), loading: :lazy }
|
2023-01-04 07:12:43 -08:00
|
|
|
.flex-grow-1
|
|
|
|
%h6.text-muted.answerbox__question-user
|
2023-02-11 12:23:07 -08:00
|
|
|
- if type.nil? && q.direct
|
|
|
|
- if user_signed_in? && q.user == current_user
|
|
|
|
%i.fa.fa-eye-slash{ data: { bs_toggle: "tooltip", bs_title: t(".visible_to_you") } }
|
|
|
|
- elsif moderation_view?
|
|
|
|
%i.fa.fa-eye-slash{ data: { bs_toggle: "tooltip", bs_title: t(".visible_mod_mode") } }
|
2022-08-17 13:18:37 -07:00
|
|
|
= t("answerbox.header.asked_html", user: user_screen_name(q.user), time: time_tooltip(q))
|
2020-05-10 01:02:04 -07:00
|
|
|
- if q.answer_count > 1
|
|
|
|
·
|
2022-07-23 03:06:05 -07:00
|
|
|
%a{ href: question_path(q.user.screen_name, q.id) }
|
2022-07-30 09:50:46 -07:00
|
|
|
= pluralize(q.answer_count, t("voc.answer"))
|
2023-02-06 06:35:57 -08:00
|
|
|
.answerbox__question-text{ class: q.long? ? "collapsed" : "", data: { collapse_target: "content" } }
|
2022-07-24 12:55:31 -07:00
|
|
|
= question_markdown q.content
|
2023-01-15 04:06:54 -08:00
|
|
|
- if q.long?
|
|
|
|
= render "shared/collapse", type: "question"
|
2023-01-04 07:12:43 -08:00
|
|
|
- if user_signed_in?
|
|
|
|
.flex-shrink-0.ms-auto
|
|
|
|
.btn-group
|
|
|
|
%button.btn.btn-link.btn-sm.dropdown-toggle{ data: { bs_toggle: :dropdown }, aria: { expanded: false } }
|
|
|
|
%span.caret
|
|
|
|
= render "actions/question", question: q
|