demarches-normaliennes/app/components/dossiers/message_component/message_component.html.haml

35 lines
1.5 KiB
Text
Raw Normal View History

2023-11-28 14:45:15 +01:00
= icon
.width-100
%h2.fr-h6
%span.mail
= commentaire_issuer
- if commentaire_from_guest?
%span.fr-text--xs.fr-text-mention--grey.font-weight-normal= t('.guest')
= correction_badge
%span.date{ class: ["fr-text--xs", "fr-text-mention--grey", "font-weight-normal", highlight_if_unseen_class], data: scroll_to_target }
= commentaire_date
.rich-text
- if commentaire.discarded?
%p= "(#{t('.deleted_body')})"
- elsif commentaire.sent_by_system?
= sanitize(commentaire.body, scrubber: Sanitizers::MailScrubber.new)
- else
= render SimpleFormatComponent.new(commentaire.body, allow_a: false, allow_autolink: commentaire.sent_by_instructeur?)
.message-extras.flex.justify-start
- if soft_deletable?
= button_to instructeur_commentaire_path(commentaire.dossier.procedure, commentaire.dossier, commentaire), method: :delete, class: 'fr-btn fr-btn--sm fr-btn--tertiary fr-icon-delete-line fr-btn--icon-left fr-text-default--warning', form: { data: { turbo: true, turbo_confirm: t('.confirm') } } do
= delete_button_text
2021-11-15 13:53:32 +01:00
- if commentaire.piece_jointe.attached?
.fr-ml-2w
= render Attachment::ShowComponent.new(attachment: commentaire.piece_jointe.attachment, new_tab: true)
- if show_reply_button?
= button_tag type: 'button', class: 'fr-btn fr-btn--sm fr-btn--secondary fr-icon-arrow-go-back-line fr-btn--icon-left', onclick: 'document.querySelector("#commentaire_body").focus()' do
= t('.reply')