Extract the conditional in a partial to its caller

This commit is contained in:
gregoirenovel 2018-10-04 15:50:21 +02:00
parent 458e3e37f8
commit fffbbb5d73
3 changed files with 33 additions and 32 deletions

View file

@ -23,4 +23,5 @@
= render partial: "new_gestionnaire/shared/avis/form", locals: { url: avis_gestionnaire_avis_path(@avis), must_be_confidentiel: @avis.confidentiel?, avis: @new_avis }
- if @dossier.avis_for(current_gestionnaire).present?
= render partial: 'new_gestionnaire/shared/avis/list', locals: { avis: @dossier.avis_for(current_gestionnaire), avis_seen_at: nil }

View file

@ -5,4 +5,5 @@
.container
= render partial: "new_gestionnaire/shared/avis/form", locals: { url: avis_gestionnaire_dossier_path(@dossier.procedure, @dossier), must_be_confidentiel: false, avis: @avis }
- if @dossier.avis.present?
= render partial: 'new_gestionnaire/shared/avis/list', locals: { avis: @dossier.avis, avis_seen_at: @avis_seen_at }

View file

@ -1,5 +1,4 @@
- if avis.present?
%section.list-avis
%section.list-avis
%h1.tab-title
Avis des invités
%span.count= avis.count