messagerie: move templates to a shared location
This commit is contained in:
parent
d77e0e938f
commit
4e2a5f0b9b
9 changed files with 13 additions and 13 deletions
|
@ -2,4 +2,4 @@
|
|||
|
||||
= render partial: 'header', locals: { avis: @avis, dossier: @dossier }
|
||||
|
||||
= render partial: "new_gestionnaire/shared/messagerie", locals: { dossier: @dossier, messagerie_seen_at: nil, new_commentaire: @commentaire, form_url: commentaire_gestionnaire_avis_path(@avis) }
|
||||
= render partial: "shared/dossiers/messagerie", locals: { dossier: @dossier, messagerie_seen_at: nil, new_commentaire: @commentaire, form_url: commentaire_gestionnaire_avis_path(@avis) }
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
= render partial: "header", locals: { dossier: @dossier }
|
||||
|
||||
= render partial: "new_gestionnaire/shared/messagerie", locals: { dossier: @dossier, messagerie_seen_at: @messagerie_seen_at , new_commentaire: @commentaire, form_url: commentaire_gestionnaire_dossier_path(@dossier.procedure, @dossier) }
|
||||
= render partial: "shared/dossiers/messagerie", locals: { dossier: @dossier, messagerie_seen_at: @messagerie_seen_at , new_commentaire: @commentaire, form_url: commentaire_gestionnaire_dossier_path(@dossier.procedure, @dossier) }
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
.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/messages/message", locals: { commentaire: commentaire, messagerie_seen_at: messagerie_seen_at }
|
||||
|
||||
= render partial: "new_gestionnaire/shared/messages/form", locals: { commentaire: new_commentaire, form_url: form_url }
|
7
app/views/shared/dossiers/_messagerie.html.haml
Normal file
7
app/views/shared/dossiers/_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: "shared/dossiers/messages/message", locals: { commentaire: commentaire, messagerie_seen_at: messagerie_seen_at }
|
||||
|
||||
= render partial: "shared/dossiers/messages/form", locals: { commentaire: new_commentaire, form_url: form_url }
|
|
@ -1,9 +1,9 @@
|
|||
= render partial: 'new_gestionnaire/shared/messages/message_icon', locals: { commentaire: commentaire, current_gestionnaire: current_gestionnaire }
|
||||
= render partial: 'shared/dossiers/messages/message_icon', locals: { commentaire: commentaire, current_gestionnaire: current_gestionnaire }
|
||||
|
||||
.width-100
|
||||
%h2
|
||||
%span.mail
|
||||
= render partial: 'new_gestionnaire/shared/messages/message_issuer', locals: { commentaire: commentaire, current_gestionnaire: current_gestionnaire }
|
||||
= render partial: 'shared/dossiers/messages/message_issuer', locals: { commentaire: commentaire, current_gestionnaire: current_gestionnaire }
|
||||
- if ![current_gestionnaire.email, commentaire.dossier.user.email, OLD_CONTACT_EMAIL, CONTACT_EMAIL].include?(commentaire.email)
|
||||
%span.guest Invité
|
||||
%span.date{ class: highlight_if_unseen_class(messagerie_seen_at, commentaire.created_at) }
|
|
@ -1,7 +1,7 @@
|
|||
describe 'new_gestionnaire/shared/messages/message.html.haml', type: :view do
|
||||
describe 'shared/dossiers/messages/message.html.haml', type: :view do
|
||||
before { view.extend DossierHelper }
|
||||
|
||||
subject { render 'new_gestionnaire/shared/messages/message.html.haml', commentaire: commentaire, messagerie_seen_at: seen_at, current_gestionnaire: current_gestionnaire }
|
||||
subject { render 'shared/dossiers/messages/message.html.haml', commentaire: commentaire, messagerie_seen_at: seen_at, current_gestionnaire: current_gestionnaire }
|
||||
|
||||
let(:dossier) { create(:dossier) }
|
||||
let(:commentaire) { create(:commentaire, dossier: dossier) }
|
Loading…
Reference in a new issue