Retrospring/app/views/question/_question.haml

32 lines
1.9 KiB
Plaintext

.card.question--fixed{class: if hidden then 'question--hidden' end, tabindex: if hidden then '-1' end, aria: { hidden: if hidden then :true end }}
.container
.card-body
.media.question-media
- unless question.author_is_anonymous
%a.pull-left{href: unless hidden then show_user_profile_path(question.user.screen_name) end}
%img.img-rounded.answerbox--img{src: question.user.profile_picture.url(:medium)}
.media-body.question-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
- unless hidden
%ul.dropdown-menu.dropdown-menu-right{role: :menu}
- if current_user.mod? or question.user == current_user
%li.text-danger
%a{href: '#', tabindex: -1, data: { action: 'ab-question-destroy', q_id: question.id, redirect: if question.author_is_anonymous? then "/" else show_user_questions_path(question.user.screen_name) end }}
%i.fa.fa-trash-o
= t 'views.actions.delete'
- unless question.user == current_user
%li
%a{href: '#', tabindex: -1, data: { action: 'ab-question-report', q_id: question.id }}
%i.fa.fa-exclamation-triangle
= t 'views.actions.report'
%h6.text-muted.media-heading.answerbox--question-user
- if hidden
= user_screen_name question.user, anonymous: question.author_is_anonymous, url: false
- else
= raw t('views.answerbox.asked', user: user_screen_name(question.user, anonymous: question.author_is_anonymous), time: time_tooltip(question))
%p.answerbox--question-text= question.content