NewDesign: add person icon to message

This commit is contained in:
Simon Lehericey 2017-07-20 14:23:16 +02:00 committed by Mathieu Magnin
parent 3a8e84b128
commit 3ecc4f1327
5 changed files with 29 additions and 7 deletions

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g fill="none" fill-rule="evenodd"><path d="M0 0h24v24H0z"/><path stroke="#4393F3" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8.999A2.989 2.989 0 0 0 14.995 6c0-1.66-1.332-3-2.995-3a2.998 2.998 0 1 0 0 5.999zm0 4c-2.33 0-7 1.17-7 3.5v3.834h14v-3.834c0-2.33-4.67-3.5-7-3.5z"/></g></svg>

After

Width:  |  Height:  |  Size: 396 B

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g fill="none" fill-rule="evenodd"><g stroke="#4393F3" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2z"/><path d="M2.292 5.033l9.667 6.675 9.666-6.75"/></g><path d="M0 0h24v24H0z"/></g></svg>

After

Width:  |  Height:  |  Size: 383 B

View file

@ -4,9 +4,19 @@
#dossier-messagerie {
li {
display: flex;
align-items: flex-start;
margin-bottom: 2 * $default-padding;
}
.right {
width: 100%;
}
.person-icon {
margin-right: $default-spacer;
}
h2 {
margin-bottom: $default-spacer;
}

View file

@ -0,0 +1,7 @@
- case commentaire.email
- when current_gestionnaire.email
= image_tag('icons/account-circle.svg', class: 'person-icon')
- when 'contact@tps.apientreprise.fr'
= image_tag('icons/mail.svg', class: 'person-icon')
- else
= image_tag('icons/blue-person.svg', class: 'person-icon')

View file

@ -4,10 +4,13 @@
%ul
- @dossier.commentaires.each do |commentaire|
%li
%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: '%d/%m/%y')
%p= sanitize(commentaire.body)
= render partial: 'commentaire_icon', locals: { commentaire: commentaire, current_gestionnaire: current_gestionnaire }
.right
%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: '%d/%m/%y')
%p= sanitize(commentaire.body)