Merge pull request #1122 from sgmap/messagerie

Commentaire -> message
This commit is contained in:
gregoirenovel 2017-12-19 13:12:40 +01:00 committed by GitHub
commit bab4b4711a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 8 additions and 8 deletions

View file

@ -53,7 +53,7 @@
margin-top: $default-spacer;
}
.commentaire-textarea {
.message-textarea {
margin-bottom: $default-spacer;
}
}

View file

@ -2,6 +2,6 @@
%ul.messages-list
- dossier.commentaires.each do |commentaire|
%li{ class: commentaire_is_from_me_class(commentaire, current_gestionnaire.email) }
= render partial: "new_gestionnaire/shared/commentaires/commentaire", locals: { commentaire: commentaire, messagerie_seen_at: messagerie_seen_at }
= render partial: "new_gestionnaire/shared/messages/message", locals: { commentaire: commentaire, messagerie_seen_at: messagerie_seen_at }
= render partial: "new_gestionnaire/shared/commentaires/form", locals: { commentaire: new_commentaire, form_url: form_url }
= render partial: "new_gestionnaire/shared/messages/form", locals: { commentaire: new_commentaire, form_url: form_url }

View file

@ -1,5 +1,5 @@
= form_for(commentaire, url: form_url, html: { class: 'form' }) do |f|
= f.text_area :body, rows: 5, placeholder: 'Répondre ici', required: true, class: 'commentaire-textarea'
= 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

View file

@ -1,9 +1,9 @@
= render partial: 'new_gestionnaire/shared/commentaires/commentaire_icon', locals: { commentaire: commentaire, current_gestionnaire: current_gestionnaire }
= render partial: 'new_gestionnaire/shared/messages/message_icon', locals: { commentaire: commentaire, current_gestionnaire: current_gestionnaire }
.width-100
%h2
%span.mail
= render partial: 'new_gestionnaire/shared/commentaires/commentaire_issuer', locals: { commentaire: commentaire, current_gestionnaire: current_gestionnaire }
= render partial: 'new_gestionnaire/shared/messages/message_issuer', locals: { commentaire: commentaire, current_gestionnaire: current_gestionnaire }
- if ![current_gestionnaire.email, commentaire.dossier.user.email, 'contact@tps.apientreprise.fr'].include?(commentaire.email)
%span.guest Invité
%span.date{ class: highlight_if_unseen_class(messagerie_seen_at, commentaire.created_at) }

View file

@ -1,7 +1,7 @@
describe 'new_gestionnaire/shared/commentaires/commentaire.html.haml', type: :view do
describe 'new_gestionnaire/shared/messages/message.html.haml', type: :view do
before { view.extend DossierHelper }
subject { render 'new_gestionnaire/shared/commentaires/commentaire.html.haml', commentaire: commentaire, messagerie_seen_at: seen_at, current_gestionnaire: current_gestionnaire }
subject { render 'new_gestionnaire/shared/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) }