Merge pull request #5465 from betagouv/corrige-mise-en-forme-commentaire

corrige mise en forme commentaire
This commit is contained in:
krichtof 2020-08-10 17:53:24 +02:00 committed by GitHub
commit 10fe9020ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -22,4 +22,9 @@ module CommentaireHelper
template = is_current_year ? :message_date : :message_date_with_year template = is_current_year ? :message_date : :message_date_with_year
I18n.l(commentaire.created_at, format: template) I18n.l(commentaire.created_at, format: template)
end end
def pretty_commentaire(commentaire)
body_formatted = commentaire.sent_by_system? ? commentaire.body : simple_format(commentaire.body)
sanitize(body_formatted)
end
end end

View file

@ -8,7 +8,7 @@
%span.guest Invité %span.guest Invité
%span.date{ class: highlight_if_unseen_class(messagerie_seen_at, commentaire.created_at) } %span.date{ class: highlight_if_unseen_class(messagerie_seen_at, commentaire.created_at) }
= commentaire_date(commentaire) = commentaire_date(commentaire)
.rich-text= sanitize(simple_format(commentaire.body)) .rich-text= pretty_commentaire(commentaire)
.message-extras.flex.justify-start .message-extras.flex.justify-start
- if commentaire.piece_jointe.attached? - if commentaire.piece_jointe.attached?