Properly style the label when there is no motivation nor attestation

This commit is contained in:
gregoirenovel 2017-11-24 19:25:29 +01:00
parent e3ce5115a2
commit 5c92989fc8
2 changed files with 12 additions and 1 deletions

View file

@ -0,0 +1,11 @@
module DossierHelper
def label_class(dossier)
if dossier.closed?
'accepted'
elsif dossier.without_continuation?
'without-continuation'
elsif dossier.refused?
'refused'
end
end
end

View file

@ -73,5 +73,5 @@
%p.attestation L'acceptation du dossier a envoyé automatiquement une attestation au demandeur
= link_to "Voir l'attestation", attestation_dossier_path(dossier.procedure, dossier), target: '_blank', class: 'button'
- else
%span.label{ class: dossier.closed? ? 'accepted' : nil }
%span.label{ class: label_class(dossier) }
= dossier.statut