Mutualize some code code into a messagerie partial

This commit is contained in:
gregoirenovel 2017-12-15 12:13:32 +01:00
parent 0c995b63cf
commit ec9758a946
3 changed files with 9 additions and 14 deletions

View file

@ -2,10 +2,4 @@
= render partial: 'header', locals: { avis: @avis, dossier: @dossier } = render partial: 'header', locals: { avis: @avis, dossier: @dossier }
.messagerie.container = render partial: "new_gestionnaire/shared/messagerie", locals: { dossier: @dossier, messagerie_seen_at: nil, new_commentaire: @commentaire, form_url: commentaire_avis_path(@avis) }
%ul.messages-list
- @dossier.commentaires.each do |commentaire|
%li{ class: commentaire_is_from_me_class(commentaire, current_gestionnaire.email) }
= render partial: "new_gestionnaire/shared/commentaires/commentaire", locals: { commentaire: commentaire, messagerie_seen_at: nil }
= render partial: "new_gestionnaire/shared/commentaires/form", locals: { commentaire: @commentaire, form_url: commentaire_avis_path(@avis) }

View file

@ -2,10 +2,4 @@
= render partial: "header", locals: { dossier: @dossier } = render partial: "header", locals: { dossier: @dossier }
.messagerie.container = render partial: "new_gestionnaire/shared/messagerie", locals: { dossier: @dossier, messagerie_seen_at: @messagerie_seen_at , new_commentaire: @commentaire, form_url: commentaire_dossier_path(@dossier.procedure, @dossier) }
%ul.messages-list
- @dossier.commentaires.each do |commentaire|
%li{ class: commentaire_is_from_me_class(commentaire, current_gestionnaire.email) }
= render partial: "new_gestionnaire/shared/commentaires/commentaire", locals: { commentaire: commentaire, messagerie_seen_at: @messagerie_seen_at }
= render partial: "new_gestionnaire/shared/commentaires/form", locals: { commentaire: @commentaire, form_url: commentaire_dossier_path(@dossier.procedure, @dossier) }

View file

@ -0,0 +1,7 @@
.messagerie.container
%ul.messages-list
- dossier.commentaires.each do |commentaire|
%li{ class: commentaire_is_from_me_class(commentaire, current_gestionnaire.email) }
= render partial: "new_gestionnaire/shared/commentaires/commentaire", locals: { commentaire: commentaire, messagerie_seen_at: messagerie_seen_at }
= render partial: "new_gestionnaire/shared/commentaires/form", locals: { commentaire: new_commentaire, form_url: form_url }