Dossier: add statut method

This commit is contained in:
Simon Lehericey 2017-11-22 15:40:53 +01:00 committed by gregoirenovel
parent f9c2da7a5d
commit e28b18d978
2 changed files with 12 additions and 12 deletions

View file

@ -363,6 +363,16 @@ class Dossier < ActiveRecord::Base
end end
end end
def statut
if closed?
'accepté'
elsif without_continuation?
'classé sans suite'
elsif refused?
'refusé'
end
end
private private
def build_attestation def build_attestation

View file

@ -61,20 +61,10 @@
- else - else
%span.button.dropdown{ class: dossier.closed? ? 'success' : nil } %span.button.dropdown{ class: dossier.closed? ? 'success' : nil }
- if dossier.closed? = dossier.statut
accepté
- elsif dossier.without_continuation?
classé sans suite
- elsif dossier.refused?
refusé
.dropdown-content.fade-in-down.terminated .dropdown-content.fade-in-down.terminated
%h4 %h4
- if dossier.closed? = "Dossier nº #{dossier.id} #{dossier.statut}"
Dossier nº #{dossier.id} accepté
- elsif dossier.without_continuation?
Dossier nº #{dossier.id} classé sans suite
- elsif dossier.refused?
Dossier nº #{dossier.id} refusé
%p.dossier-motivation= dossier.motivation.present? ? dossier.motivation : "aucune motivation n'a été fournie" %p.dossier-motivation= dossier.motivation.present? ? dossier.motivation : "aucune motivation n'a été fournie"