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
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 }
|
11
app/views/shared/dossiers/messages/_form.html.haml
Normal file
11
app/views/shared/dossiers/messages/_form.html.haml
Normal file
|
@ -0,0 +1,11 @@
|
|||
= form_for(commentaire, url: form_url, html: { class: 'form' }) do |f|
|
||||
= f.text_area :body, rows: 5, placeholder: 'Répondre ici', required: true, class: 'message-textarea'
|
||||
.flex.justify-between
|
||||
%div
|
||||
= f.file_field :file, id: :file, accept: commentaire.file.accept_extension_list
|
||||
%label{ for: :file }
|
||||
.notice
|
||||
(taille max : 20 Mo)
|
||||
|
||||
.send-wrapper
|
||||
= f.submit 'Envoyer', class: 'button send', data: { disable: true }
|
22
app/views/shared/dossiers/messages/_message.html.haml
Normal file
22
app/views/shared/dossiers/messages/_message.html.haml
Normal file
|
@ -0,0 +1,22 @@
|
|||
= render partial: 'shared/dossiers/messages/message_icon', locals: { commentaire: commentaire, current_gestionnaire: current_gestionnaire }
|
||||
|
||||
.width-100
|
||||
%h2
|
||||
%span.mail
|
||||
= 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) }
|
||||
= I18n.l(commentaire.created_at.localtime, format: '%d/%m/%Y à %H:%M ')
|
||||
.rich-text= sanitize(commentaire.body)
|
||||
|
||||
- if commentaire.piece_justificative
|
||||
.attachment-link
|
||||
= link_to commentaire.piece_justificative.content_url, class: "button", target: "_blank", title: "Télécharger" do
|
||||
%span.icon.attachment
|
||||
= commentaire.piece_justificative.original_filename
|
||||
- elsif commentaire.file.present?
|
||||
.attachment-link
|
||||
= link_to commentaire.file_url, class: "button", target: "_blank", title: "Télécharger" do
|
||||
%span.icon.attachment
|
||||
= commentaire.file_identifier
|
|
@ -0,0 +1,8 @@
|
|||
- case commentaire.email
|
||||
- when current_gestionnaire.email
|
||||
= image_tag('icons/account-circle.svg', class: 'person-icon')
|
||||
- when OLD_CONTACT_EMAIL
|
||||
- when CONTACT_EMAIL
|
||||
= image_tag('icons/mail.svg', class: 'person-icon')
|
||||
- else
|
||||
= image_tag('icons/blue-person.svg', class: 'person-icon')
|
|
@ -0,0 +1,8 @@
|
|||
- case commentaire.email
|
||||
- when current_gestionnaire.email
|
||||
Vous
|
||||
- when OLD_CONTACT_EMAIL
|
||||
- when CONTACT_EMAIL
|
||||
Email automatique
|
||||
- else
|
||||
= commentaire.email
|
Loading…
Add table
Add a link
Reference in a new issue