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

43 lines
2.6 KiB
Plaintext

.card.inbox-entry{ id: "inbox_#{i.id}", class: i.new? ? "inbox-entry--new" : "", data: { id: i.id } }
.card-header
= render QuestionComponent.new(question: i.question, context_user: i.user)
- if current_user == i.user
.card-body
%textarea.form-control.mb-3{ name: "ib-answer", placeholder: t(".placeholder"), data: { id: i.id } }
.d-flex.flex-column-reverse.flex-sm-row
%p.format-help.me-sm-auto.align-self-center.mb-0.mt-2.mt-sm-0.text-center
= render "shared/format_link"
.d-grid.gap-2.d-sm-block
%button.btn.btn-default.text-muted.me-sm-1.mb-sm-0{ name: "ib-destroy", data: { ib_id: i.id } }
%i.fa.fa-trash.fa-fw
= t("voc.delete")
%button.btn.btn-primary.grid-row-1{ name: "ib-answer", data: { ib_id: i.id } }
= t("voc.answer")
- if current_user.sharing_enabled
.inbox-entry__sharing.text-center.p-2.justify-content-center.d-none{
data: { controller: "inbox-sharing", inbox_sharing_config_value: "{}", inbox_sharing_auto_close_value: current_user.sharing_autoclose.to_s } }
%button.btn-close.inbox-entry__close{ data: { action: "inbox-sharing#close" } }
%span.visually-hidden= t("voc.close")
.align-self-center
%p.fs-3.fw-bold= t(".sharing.heading")
%p
%a.btn.btn-primary.mb-1{ href: "https://twitter.com/intent/tweet?text=", data: { inbox_sharing_target: "twitter" }, target: "_blank" }
%i.fab.fa-twitter.fa-fw
Twitter
%a.btn.btn-primary.mb-1{ href: "#", data: { inbox_sharing_target: "tumblr" }, target: "_blank" }
%i.fab.fa-tumblr.fa-fw
Tumblr
%a.btn.btn-primary.mb-1{ href: "#", data: { inbox_sharing_target: "telegram" }, target: "_blank" }
%i.fab.fa-telegram.fa-fw
Telegram
%button.btn.btn-primary.mb-1{ data: { controller: :clipboard, action: "clipboard#copy", inbox_sharing_target: "clipboard" } }
%i.fa.fa-fw.fa-solid.fa-copy
= t("actions.share.copy")
%button.btn.btn-primary.mb-1{ data: { controller: "share", action: "share#share", inbox_sharing_target: "other" } }
%i.fa.fa-fw.fa-share-alt
= t("actions.share.other")
- if current_user.sharing_custom_url.present?
%a.btn.btn-primary.mb-1{ href: current_user.sharing_custom_url, data: { inbox_sharing_target: "custom" }, target: "_blank" }
= current_user.display_sharing_custom_url
%p.text-muted= t(".sharing.hint_html", settings: link_to(t(".sharing.settings"), settings_sharing_path))