2020-05-10 01:02:04 -07:00
|
|
|
- type ||= nil
|
2022-01-03 13:23:21 -08:00
|
|
|
.card.questionbox{ data: { id: q.id } }
|
2020-05-10 01:02:04 -07:00
|
|
|
.card-body
|
|
|
|
.media
|
|
|
|
- if type == 'discover'
|
|
|
|
.pull-left
|
|
|
|
%a{ href: user_screen_name(q.user, link_only: true) }
|
|
|
|
%img.avatar-md.mr-2{ src: q.user&.profile_picture&.url(:medium) }
|
|
|
|
.media-body
|
|
|
|
- if user_signed_in?
|
|
|
|
.pull-right
|
|
|
|
.btn-group
|
|
|
|
%button.btn.btn-link.btn-sm.dropdown-toggle{ data: { toggle: :dropdown }, aria: { expanded: false } }
|
|
|
|
%span.caret
|
|
|
|
.dropdown-menu.dropdown-menu-right{ role: :menu }
|
|
|
|
- if current_user.mod? || q.user == current_user
|
|
|
|
%a.dropdown-item.text-danger{ href: '#', tabindex: -1, data: { action: 'ab-question-destroy', q_id: q.id } }
|
|
|
|
%i.fa.fa-trash-o
|
2022-07-30 09:50:46 -07:00
|
|
|
= t("voc.delete")
|
2020-05-10 01:02:04 -07:00
|
|
|
- unless q.user == current_user
|
|
|
|
%a.dropdown-item{ href: '#', tabindex: -1, data: { action: 'ab-question-report', q_id: q.id } }
|
|
|
|
%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(q) }
|
|
|
|
%i.fa.fa-gears
|
|
|
|
= t("voc.view_in_rails_admin")
|
2020-05-10 01:02:04 -07:00
|
|
|
%h6.media-heading.text-muted.answerbox__question-user
|
2022-07-31 13:55:03 -07:00
|
|
|
= raw t('answerbox.header.asked', 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"))
|
2022-07-24 12:55:31 -07:00
|
|
|
.answerbox__question-text
|
|
|
|
= question_markdown q.content
|