Send a mail to usager if somebody else wrote a new commentaire on his dossier
This commit is contained in:
parent
4880101202
commit
c7934b2f97
9 changed files with 87 additions and 18 deletions
|
@ -10,23 +10,19 @@
|
|||
- elsif gestionnaire_signed_in?
|
||||
Usager
|
||||
%div.col-lg-2.col-md-2.col-sm-2.col-xs-2.count
|
||||
- message_count = @facade.commentaires.count
|
||||
= (message_count == 1) ? "1 message" : "#{message_count} messages"
|
||||
= pluralize(@facade.commentaires.count, "message")
|
||||
%div.body
|
||||
- unless @facade.commentaires.empty?
|
||||
%div.commentaires
|
||||
- @facade.commentaires.object.sort.each do |commentaire|
|
||||
= render partial: 'dossiers/commentaire', locals: {commentaire: commentaire}
|
||||
= render partial: 'dossiers/commentaires/commentaire', locals: {commentaire: commentaire}
|
||||
.row
|
||||
.col-lg-12.col-md-12.col-sm-12.col-xs-12
|
||||
%div.split-hr
|
||||
.row
|
||||
%div.col-lg-12.col-md-12.col-sm-12.col-xs-12#new-commentaire
|
||||
= form_tag(url_for({ controller: 'commentaires', action: :create, dossier_id: @facade.dossier.id, champ_id: @facade.champ_id }), class: 'form-inline', method: 'POST', multipart: true) do
|
||||
%textarea.form-control{id: 'texte_commentaire', class: 'wysihtml5', name: 'texte_commentaire', style: 'width: 100%; margin-bottom:2%', rows: '5', placeholder:"Commentaire"}
|
||||
%h4.text-primary{style: 'margin-top: 0px'} Ajouter un fichier
|
||||
= file_field_tag "piece_justificative[content]", accept: PieceJustificative.accept_format, style: 'float: left; margin-left: 20px'
|
||||
%input#save-message.form-control.btn.btn-send{ type: 'submit', value: 'ENVOYER' }
|
||||
= render partial: 'dossiers/commentaires/form', locals: { facade: @facade }
|
||||
|
||||
- if last_comment = @facade.commentaires.first
|
||||
%div.last-commentaire
|
||||
.row
|
||||
|
@ -118,4 +114,3 @@
|
|||
= (private_fields_count == 1) ? "1 champ" : "#{private_fields_count} champs"
|
||||
%div.body
|
||||
= render partial: '/dossiers/infos_private_fields'
|
||||
|
||||
|
|
5
app/views/dossiers/commentaires/_form.html.haml
Normal file
5
app/views/dossiers/commentaires/_form.html.haml
Normal file
|
@ -0,0 +1,5 @@
|
|||
= form_tag(url_for({ controller: 'commentaires', action: :create, dossier_id: facade.dossier.id, champ_id: facade.champ_id }), class: 'form-inline', method: 'POST', multipart: true) do
|
||||
%textarea.form-control{id: 'texte_commentaire', class: 'wysihtml5', name: 'texte_commentaire', style: 'width: 100%; margin-bottom:2%', rows: '5', placeholder:"Commentaire"}
|
||||
%h4.text-primary{style: 'margin-top: 0px'} Ajouter un fichier
|
||||
= file_field_tag "piece_justificative[content]", accept: PieceJustificative.accept_format, style: 'float: left; margin-left: 20px'
|
||||
%input#save-message.form-control.btn.btn-send{ type: 'submit', value: 'ENVOYER' }
|
Loading…
Add table
Add a link
Reference in a new issue