diff --git a/app/helpers/commentaire_helper.rb b/app/helpers/commentaire_helper.rb index f22163a07..7a8973dcc 100644 --- a/app/helpers/commentaire_helper.rb +++ b/app/helpers/commentaire_helper.rb @@ -1,6 +1,6 @@ module CommentaireHelper - def commentaire_is_from_me_class(commentaire, email) - if commentaire.email == email + def commentaire_is_from_me_class(commentaire, connected_user) + if commentaire.email == connected_user.email "from-me" end end diff --git a/app/views/shared/dossiers/_messagerie.html.haml b/app/views/shared/dossiers/_messagerie.html.haml index c67d4a174..5d589fa5b 100644 --- a/app/views/shared/dossiers/_messagerie.html.haml +++ b/app/views/shared/dossiers/_messagerie.html.haml @@ -1,7 +1,7 @@ .messagerie.container %ul.messages-list - dossier.commentaires.each do |commentaire| - %li.message{ class: commentaire_is_from_me_class(commentaire, connected_user.email) } + %li.message{ class: commentaire_is_from_me_class(commentaire, connected_user) } = render partial: "shared/dossiers/messages/message", locals: { commentaire: commentaire, connected_user: connected_user, messagerie_seen_at: messagerie_seen_at } = render partial: "shared/dossiers/messages/form", locals: { commentaire: new_commentaire, form_url: form_url }