retrospring/app/views/inbox/_entry.haml

57 lines
3 KiB
Text
Raw Normal View History

2022-04-19 22:32:46 +02:00
.card.inbox-entry{ class: i.new? ? "inbox-entry--new" : "", data: { id: i.id } }
2020-04-19 23:09:41 +02:00
.card-header
2014-12-09 23:21:41 +01:00
.media
- unless i.question.author_is_anonymous
2020-05-10 13:21:41 +02:00
%a.pull-left{ href: show_user_profile_path(i.question.user.screen_name) }
%img.answerbox__question-user-avatar.avatar-md{ src: i.question.user.profile_picture.url(:medium) }
2014-12-09 23:21:41 +01:00
.media-body
2020-05-07 15:01:35 +02:00
%h6.text-muted.media-heading.answerbox__question-user
2022-06-21 18:18:09 +02:00
- if i.question.author_is_anonymous
%i.fa.fa-user-secret{ title: t('.anon_hint') }
= t(".asked_html", user: user_screen_name(i.question.user, context_user: i.user, anonymous: i.question.author_is_anonymous), time: time_tooltip(i.question))
- if !i.question.author_is_anonymous && i.question.answer_count.positive?
·
%a{ href: show_user_question_path(i.question.user.screen_name, i.question.id) }
2022-04-19 22:32:46 +02:00
= t(".answers", count: i.question.answer_count)
2022-01-01 01:50:46 +01:00
.answerbox__question-text= question_markdown i.question.content
- if i.question.user_id != current_user.id || current_user.has_role?(:administrator)
.pull-right
.btn-group
%button.btn.btn-default.btn-sm.dropdown-toggle{ data: { toggle: :dropdown }, aria: { expanded: false } }
%span.caret
.dropdown-menu.dropdown-menu-right{ role: :menu }
- if i.question.user_id != current_user.id
2022-04-19 22:32:46 +02:00
%a.dropdown-item{ name: "ib-report", data: { q_id: i.question.id } }
%i.fa.fa-warning
2022-04-19 22:32:46 +02:00
= t("voc.report")
- if i.question.author_is_anonymous && i.question.author_identifier.present?
%a.dropdown-item{ name: "ib-block-anon", data: { q_id: i.question.id } }
%i.fa.fa-minus-circle
= t("views.actions.block")
- if current_user.has_role? :administrator
%a.dropdown-item{ href: rails_admin_path_for_resource(i) }
%i.fa.fa-gears
2022-04-19 22:32:46 +02:00
= t("voc.view_in_rails_admin")
2020-04-19 23:09:41 +02:00
.card-body
2022-04-19 22:32:46 +02:00
%textarea.form-control{ name: "ib-answer", placeholder: t(".placeholder"), data: { id: i.id } }
2014-12-09 23:21:41 +01:00
%br/
2022-04-19 22:32:46 +02:00
%button.btn.btn-success{ name: "ib-answer", data: { ib_id: i.id } }
= t("voc.answer")
%button.btn.btn-danger{ name: "ib-destroy", data: { ib_id: i.id } }
= t("voc.delete")
%button.btn.btn-default{ name: "ib-options", data: { ib_id: i.id, state: :hidden } }
2015-01-28 06:49:17 +01:00
%i.fa.fa-cog
2022-04-19 22:32:46 +02:00
%span.sr-only= t(".options")
.card-footer.d-none{ id: "ib-options-#{i.id}" }
2022-04-19 22:32:46 +02:00
%h4= t(".sharing.heading")
2020-05-10 13:21:41 +02:00
- if current_user.services.count.positive?
2015-01-27 18:13:24 +01:00
.row
2015-01-30 20:32:10 +01:00
- current_user.services.each do |service|
2015-01-30 20:34:28 +01:00
.col-md-3.col-sm-4.col-xs-6
2015-01-30 20:32:10 +01:00
%label
2022-04-19 22:32:46 +02:00
%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)
2015-01-27 18:13:24 +01:00
- else
2022-04-19 22:32:46 +02:00
%p= t(".sharing.none_html", settings: link_to(t(".sharing.settings"), services_path))