Retrospring/app/components/question_component/question_component.html.haml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
1.6 KiB
Plaintext
Raw Normal View History

2023-10-20 15:25:08 -07:00
.d-flex
- unless hide_avatar?
.flex-shrink-0
%a{ href: user_path(@question.user) }
= render AvatarComponent.new(user: @question.user, size: "md", classes: ["question__avatar"])
.flex-grow-1
%h6.text-muted.question__user
- if @question.author_is_anonymous
%i.fas.fa-user-secret{ title: t(".anon_hint") }
- if @profile_question && @question.direct
- if user_signed_in? && @question.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") } }
2024-03-02 12:37:07 -08:00
= user_screen_name(@question.user, context_user: @context_user, author_identifier: author_identifier)
2023-10-20 15:25:08 -07:00
- if follower_question?
·
%a{ href: question_path(@question.user.screen_name, @question.id), data: { selection_hotkey: "a" } }
= t(".answers", count: @question.answer_count)
·
= time_tooltip(@question)
2024-03-02 12:37:07 -08:00
- if user_signed_in?
.dropdown.d-inline
%button.btn.btn-link.btn-sm.p-0{ data: { bs_toggle: :dropdown }, aria: { expanded: false } }
%i.fa.fa-fw.fa-ellipsis
= render "actions/question", question: @question
2023-10-20 15:25:08 -07:00
.question__body{ data: { controller: @question.long? ? "collapse" : nil } }
.question__text{ class: @question.long? && @collapse ? "collapsed" : "", data: { collapse_target: "content" } }
= question_markdown @question.content
- if @question.long? && @collapse
= render "shared/collapse", type: "question"