Dossier: add statut method
This commit is contained in:
parent
f9c2da7a5d
commit
e28b18d978
2 changed files with 12 additions and 12 deletions
|
@ -363,6 +363,16 @@ class Dossier < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
def statut
|
||||
if closed?
|
||||
'accepté'
|
||||
elsif without_continuation?
|
||||
'classé sans suite'
|
||||
elsif refused?
|
||||
'refusé'
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def build_attestation
|
||||
|
|
|
@ -61,20 +61,10 @@
|
|||
|
||||
- else
|
||||
%span.button.dropdown{ class: dossier.closed? ? 'success' : nil }
|
||||
- if dossier.closed?
|
||||
accepté
|
||||
- elsif dossier.without_continuation?
|
||||
classé sans suite
|
||||
- elsif dossier.refused?
|
||||
refusé
|
||||
= dossier.statut
|
||||
.dropdown-content.fade-in-down.terminated
|
||||
%h4
|
||||
- if dossier.closed?
|
||||
Dossier nº #{dossier.id} accepté
|
||||
- elsif dossier.without_continuation?
|
||||
Dossier nº #{dossier.id} classé sans suite
|
||||
- elsif dossier.refused?
|
||||
Dossier nº #{dossier.id} refusé
|
||||
= "Dossier nº #{dossier.id} #{dossier.statut}"
|
||||
|
||||
%p.dossier-motivation= dossier.motivation.present? ? dossier.motivation : "aucune motivation n'a été fournie"
|
||||
|
||||
|
|
Loading…
Reference in a new issue