demarches-normaliennes/app/views/new_gestionnaire/dossiers/messagerie.html.haml
2017-10-30 17:24:18 +01:00

27 lines
1.3 KiB
Text

= render partial: "header", locals: { dossier: @dossier }
.messagerie.container
%ul.messages-list
- @dossier.commentaires.each do |commentaire|
%li
= render partial: 'commentaire_icon', locals: { commentaire: commentaire, current_gestionnaire: current_gestionnaire }
.width-100
%h2
%span.mail
= render partial: 'commentaire_issuer', locals: { commentaire: commentaire, current_gestionnaire: current_gestionnaire }
- if ![current_gestionnaire.email, @dossier.user.email, 'contact@tps.apientreprise.fr'].include?(commentaire.email)
%span.guest Invité
%span.date= I18n.l(commentaire.created_at.localtime, format: '%H:%M le %d/%m/%Y')
.rich-text
= sanitize(commentaire.body)
- if file = commentaire.piece_justificative
.attachment-link
= link_to file.content_url, class: "button", target: "_blank", title: "Télécharger" do
.icon.attachment
= file.original_filename
= form_for(Commentaire.new, url: commentaire_dossier_path(@dossier.procedure, @dossier), html: { class: 'form' }) do |f|
= f.text_area :body, rows: 5, placeholder: 'Répondre ici', required: true
.send-wrapper
= f.submit 'Envoyer', class: 'button send', data: { disable_with: "Envoi..." }