Merge pull request #5465 from betagouv/corrige-mise-en-forme-commentaire
corrige mise en forme commentaire
This commit is contained in:
commit
10fe9020ea
2 changed files with 6 additions and 1 deletions
|
@ -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
|
||||||
|
|
|
@ -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?
|
||||||
|
|
Loading…
Reference in a new issue