NewDesign: add dossier messagerie show

This commit is contained in:
Simon Lehericey 2017-07-19 11:08:53 +02:00 committed by Mathieu Magnin
parent d5535aaaaa
commit 497f898e1b
5 changed files with 46 additions and 0 deletions

View file

@ -0,0 +1,23 @@
@import "colors";
@import "common";
@import "constants";
#dossier-messagerie {
li {
margin-bottom: 2 * $default-padding;
}
h2 {
margin-bottom: $default-spacer;
}
.mail {
font-weight: bold;
}
.date {
font-size: 12px;
color: $grey;
float: right;
}
}

View file

@ -8,6 +8,10 @@ module NewGestionnaire
@dossier = dossier
end
def messagerie
@dossier = dossier
end
def follow
current_gestionnaire.follow(dossier)
dossier.next_step!('gestionnaire', 'follow')

View file

@ -0,0 +1,7 @@
- case commentaire.email
- when current_gestionnaire.email
Vous
- when 'contact@tps.apientreprise.fr'
Mail automatique
- else
commentaire.email

View file

@ -0,0 +1,11 @@
= render partial: "header", locals: { dossier: @dossier }
#dossier-messagerie.container
%ul
- @dossier.commentaires.each do |commentaire|
%li
%h2
%span.mail
= render partial: 'commentaire_issuer', locals: { commentaire: commentaire, current_gestionnaire: current_gestionnaire }
%span.date= I18n.l(commentaire.created_at.localtime, format: '%d/%m/%y')
%p= sanitize(commentaire.body)

View file

@ -242,6 +242,7 @@ Rails.application.routes.draw do
resources :dossiers, only: [:show], param: :dossier_id do
member do
get 'attestation'
get 'messagerie'
patch 'follow'
patch 'unfollow'
patch 'archive'