Mutualize some code code into a messagerie partial
This commit is contained in:
parent
0c995b63cf
commit
ec9758a946
3 changed files with 9 additions and 14 deletions
|
@ -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) }
|
|
||||||
|
|
|
@ -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) }
|
|
||||||
|
|
7
app/views/new_gestionnaire/shared/_messagerie.html.haml
Normal file
7
app/views/new_gestionnaire/shared/_messagerie.html.haml
Normal 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 }
|
Loading…
Reference in a new issue