Retrospring/app/views/inbox/_entry.html.haml

52 lines
2.9 KiB
Plaintext

.card.inbox-entry{ id: "inbox_#{i.id}", class: i.new? ? "inbox-entry--new" : "", data: { id: i.id } }
.card-header
.d-flex
- unless i.question.author_is_anonymous
.flex-shrink-0
%a.pull-left{ href: user_path(i.question.user) }
%img.answerbox__question-user-avatar.avatar-md{ src: i.question.user.profile_picture.url(:small), loading: :lazy }
.flex-grow-1
%h6.text-muted.answerbox__question-user
- if i.question.author_is_anonymous
%i.fas.fa-user-secret{ title: t('.anon_hint') }
= t(".asked_html", user: user_screen_name(i.question.user, context_user: i.user, author_identifier: i.question.author_is_anonymous ? i.question.author_identifier : nil), time: time_tooltip(i.question))
- if !i.question.author_is_anonymous && i.question.answer_count.positive?
·
%a{ href: question_path(i.question.user.screen_name, i.question.id) }
= t(".answers", count: i.question.answer_count)
.answerbox__question-body{ data: { controller: i.question.long? ? "collapse" : nil } }
.answerbox__question-text{ class: i.question.long? ? "collapsed" : "", data: { collapse_target: "content" } }
= question_markdown i.question.content
- if i.question.long?
= render "shared/collapse", type: "question"
- if i.question.user_id != current_user.id || current_user.has_cached_role?(:administrator)
.flex-shrink-0.ms-auto
.btn-group
%button.btn.btn-default.btn-sm.dropdown-toggle{ data: { bs_toggle: :dropdown }, aria: { expanded: false } }
%span.caret
= render "actions/question", question: i.question
- if current_user == i.user
.card-body
%textarea.form-control.mb-3{ name: "ib-answer", placeholder: t(".placeholder"), data: { id: i.id } }
.d-sm-flex
%button.btn.btn-success.me-sm-1{ name: "ib-answer", data: { ib_id: i.id } }
= t("voc.answer")
%button.btn.btn-danger.me-sm-1{ name: "ib-destroy", data: { ib_id: i.id } }
= t("voc.delete")
%button.btn.btn-default.px-1{ name: "ib-options", data: { ib_id: i.id, state: :hidden } }
%i.fa.fa-chevron-down
%span.pe-none= t(".options")
%p.format-help.ms-auto.align-self-center.mt-2.mt-sm-0.text-center
= render "shared/format_link"
.card-footer.d-none{ id: "ib-options-#{i.id}" }
%h4= t(".sharing.heading")
- if current_user.services.count.positive?
.row
- current_user.services.each do |service|
.col-md-3.col-sm-4.col-xs-6
%label
%input{ type: "checkbox", name: "ib-share", checked: :checked, data: { ib_id: i.id, service: service.provider } }
= raw t(".sharing.post_to", service: service.provider.capitalize)
- else
%p= t(".sharing.none_html", settings: link_to(t(".sharing.settings"), services_path))