Use dossier_display_state helper

This commit is contained in:
Paul Chavard 2018-11-06 18:45:29 +01:00
parent f09a7a01c8
commit a524c72add
3 changed files with 7 additions and 5 deletions

View file

@ -1,4 +1,6 @@
class DossierSerializer < ActiveModel::Serializer
include DossierHelper
attributes :id,
:created_at,
:updated_at,
@ -46,7 +48,7 @@ class DossierSerializer < ActiveModel::Serializer
end
def simplified_state
object.decorate.display_state
dossier_display_state(object)
end
def initiated_at

View file

@ -46,4 +46,4 @@
.print-header
= dossier.procedure.libelle.truncate_words(10)
>
= "Dossier nº #{dossier.id} (#{dossier.statut})"
= "Dossier nº #{dossier.id} (#{dossier_display_state(dossier, lower: true)})"

View file

@ -1,7 +1,7 @@
- if dossier.en_construction? || dossier.en_instruction?
%span.dropdown
%button.button.primary.dropdown-button
= dossier.decorate.display_state
= dossier_display_state dossier
.dropdown-content.fade-in-down
%ul.dropdown-items
- if dossier.en_construction?
@ -55,7 +55,7 @@
- if dossier.motivation.present? || dossier.attestation.present?
%span.dropdown
%button.button.dropdown-button{ class: button_or_label_class(dossier) }
= dossier.statut
= dossier_display_state(dossier, lower: true)
.dropdown-content.fade-in-down.terminated
- if dossier.motivation.present?
%h4 Motivation
@ -67,4 +67,4 @@
= link_to "Voir l'attestation", attestation_gestionnaire_dossier_path(dossier.procedure, dossier), target: '_blank', class: 'button'
- else
%span.label{ class: button_or_label_class(dossier) }
= dossier.statut
= dossier_display_state(dossier, lower: true)