2020-05-10 13:27:39 -07:00
|
|
|
.card.question--fixed{ class: hidden ? 'question--hidden' : '', tabindex: hidden ? -1 : '', aria: { hidden: hidden } }
|
2015-05-12 11:48:06 -07:00
|
|
|
.container
|
2020-04-19 14:09:41 -07:00
|
|
|
.card-body
|
2020-05-08 19:10:40 -07:00
|
|
|
.media
|
2015-05-12 11:48:06 -07:00
|
|
|
- unless question.author_is_anonymous
|
2022-07-23 03:06:05 -07:00
|
|
|
%a.pull-left{ href: unless hidden then user_path(question.user) end }
|
2020-05-10 02:00:35 -07:00
|
|
|
%img.answerbox__question-user-avatar.avatar-md{ src: question.user.profile_picture.url(:medium) }
|
2020-05-08 19:10:40 -07:00
|
|
|
.media-body
|
2015-05-12 11:48:06 -07:00
|
|
|
- if user_signed_in?
|
|
|
|
.pull-right
|
|
|
|
.btn-group
|
2020-05-10 02:00:35 -07:00
|
|
|
%button.btn.btn-link.btn-sm.dropdown-toggle{ data: { toggle: :dropdown }, aria: { expanded: false } }
|
2015-05-12 11:48:06 -07:00
|
|
|
%span.caret
|
|
|
|
- unless hidden
|
2020-05-10 02:00:35 -07:00
|
|
|
.dropdown-menu.dropdown-menu-right{ role: :menu }
|
|
|
|
- if current_user.mod? || question.user == current_user
|
|
|
|
%a.dropdown-item.text-danger{ href: '#',
|
|
|
|
tabindex: -1,
|
|
|
|
data: { action: 'ab-question-destroy',
|
|
|
|
q_id: question.id,
|
|
|
|
redirect: question.author_is_anonymous? ? '/' : show_user_questions_path(question.user.screen_name) } }
|
2020-05-08 20:39:01 -07:00
|
|
|
%i.fa.fa-trash-o
|
2022-07-30 09:50:46 -07:00
|
|
|
= t("voc.delete")
|
2015-05-12 11:48:06 -07:00
|
|
|
- unless question.user == current_user
|
2020-05-10 02:00:35 -07:00
|
|
|
%a.dropdown-item{ href: '#', tabindex: -1, data: { action: 'ab-question-report', q_id: question.id } }
|
2020-05-08 20:39:01 -07:00
|
|
|
%i.fa.fa-exclamation-triangle
|
2022-07-30 09:50:46 -07:00
|
|
|
= t("voc.report")
|
2022-07-24 12:44:46 -07:00
|
|
|
- if current_user.has_role? :administrator
|
|
|
|
%a.dropdown-item{ href: rails_admin_path_for_resource(question) }
|
|
|
|
%i.fa.fa-gears
|
|
|
|
= t("voc.view_in_rails_admin")
|
2020-05-08 19:10:40 -07:00
|
|
|
%h6.text-muted.media-heading.answerbox__question-user
|
2022-06-26 15:36:00 -07:00
|
|
|
- identifier = question.author_is_anonymous ? question.author_identifier : nil
|
2015-05-26 19:40:11 -07:00
|
|
|
- if hidden
|
2022-06-26 15:36:00 -07:00
|
|
|
= user_screen_name question.user, author_identifier: identifier, url: false
|
2015-05-26 19:40:11 -07:00
|
|
|
- else
|
2022-07-31 13:55:03 -07:00
|
|
|
= raw t("answerbox.header.asked", user: user_screen_name(question.user, author_identifier: identifier), time: time_tooltip(question))
|
2021-12-31 17:04:49 -08:00
|
|
|
.answerbox__question-text= question_markdown question.content
|