diff --git a/app/views/new_user/dossiers/show.html.haml b/app/views/new_user/dossiers/show.html.haml index d87e4dd0c..57b944251 100644 --- a/app/views/new_user/dossiers/show.html.haml +++ b/app/views/new_user/dossiers/show.html.haml @@ -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 } diff --git a/app/views/new_user/dossiers/show/_latest_message.html.haml b/app/views/new_user/dossiers/show/_latest_message.html.haml new file mode 100644 index 000000000..255e79696 --- /dev/null +++ b/app/views/new_user/dossiers/show/_latest_message.html.haml @@ -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'