dossier: show latest message only when dossier is pending

This commit is contained in:
Pierre de La Morinerie 2018-09-17 12:43:21 +00:00
parent c12ed49df4
commit 2de480d6e9
2 changed files with 11 additions and 9 deletions

View file

@ -9,12 +9,5 @@
.container
= render partial: 'new_user/dossiers/show/status_overview', locals: { dossier: @dossier }
- latest_message = @dossier.commentaires.last
- if latest_message.present?
.latest-message-section
%h3.tab-title Dernier message
.message.inverted-background
= render partial: "shared/dossiers/messages/message", locals: { commentaire: latest_message, connected_user: current_user, messagerie_seen_at: nil }
= link_to commentaire_answer_action(latest_message, current_user), messagerie_dossier_url(@dossier, anchor: 'new_commentaire'), class: 'button send'
- if !@dossier.termine?
= render partial: 'new_user/dossiers/show/latest_message', locals: { dossier: @dossier }

View file

@ -0,0 +1,9 @@
- latest_message = dossier.commentaires.last
- if latest_message.present?
.latest-message-section
%h3.tab-title Dernier message
.message.inverted-background
= render partial: "shared/dossiers/messages/message", locals: { commentaire: latest_message, connected_user: current_user, messagerie_seen_at: nil }
= link_to commentaire_answer_action(latest_message, current_user), messagerie_dossier_url(dossier, anchor: 'new_commentaire'), class: 'button send'