Use dossier_display_state helper
This commit is contained in:
parent
f09a7a01c8
commit
a524c72add
3 changed files with 7 additions and 5 deletions
|
@ -1,4 +1,6 @@
|
||||||
class DossierSerializer < ActiveModel::Serializer
|
class DossierSerializer < ActiveModel::Serializer
|
||||||
|
include DossierHelper
|
||||||
|
|
||||||
attributes :id,
|
attributes :id,
|
||||||
:created_at,
|
:created_at,
|
||||||
:updated_at,
|
:updated_at,
|
||||||
|
@ -46,7 +48,7 @@ class DossierSerializer < ActiveModel::Serializer
|
||||||
end
|
end
|
||||||
|
|
||||||
def simplified_state
|
def simplified_state
|
||||||
object.decorate.display_state
|
dossier_display_state(object)
|
||||||
end
|
end
|
||||||
|
|
||||||
def initiated_at
|
def initiated_at
|
||||||
|
|
|
@ -46,4 +46,4 @@
|
||||||
.print-header
|
.print-header
|
||||||
= dossier.procedure.libelle.truncate_words(10)
|
= dossier.procedure.libelle.truncate_words(10)
|
||||||
>
|
>
|
||||||
= "Dossier nº #{dossier.id} (#{dossier.statut})"
|
= "Dossier nº #{dossier.id} (#{dossier_display_state(dossier, lower: true)})"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
- if dossier.en_construction? || dossier.en_instruction?
|
- if dossier.en_construction? || dossier.en_instruction?
|
||||||
%span.dropdown
|
%span.dropdown
|
||||||
%button.button.primary.dropdown-button
|
%button.button.primary.dropdown-button
|
||||||
= dossier.decorate.display_state
|
= dossier_display_state dossier
|
||||||
.dropdown-content.fade-in-down
|
.dropdown-content.fade-in-down
|
||||||
%ul.dropdown-items
|
%ul.dropdown-items
|
||||||
- if dossier.en_construction?
|
- if dossier.en_construction?
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
- if dossier.motivation.present? || dossier.attestation.present?
|
- if dossier.motivation.present? || dossier.attestation.present?
|
||||||
%span.dropdown
|
%span.dropdown
|
||||||
%button.button.dropdown-button{ class: button_or_label_class(dossier) }
|
%button.button.dropdown-button{ class: button_or_label_class(dossier) }
|
||||||
= dossier.statut
|
= dossier_display_state(dossier, lower: true)
|
||||||
.dropdown-content.fade-in-down.terminated
|
.dropdown-content.fade-in-down.terminated
|
||||||
- if dossier.motivation.present?
|
- if dossier.motivation.present?
|
||||||
%h4 Motivation
|
%h4 Motivation
|
||||||
|
@ -67,4 +67,4 @@
|
||||||
= link_to "Voir l'attestation", attestation_gestionnaire_dossier_path(dossier.procedure, dossier), target: '_blank', class: 'button'
|
= link_to "Voir l'attestation", attestation_gestionnaire_dossier_path(dossier.procedure, dossier), target: '_blank', class: 'button'
|
||||||
- else
|
- else
|
||||||
%span.label{ class: button_or_label_class(dossier) }
|
%span.label{ class: button_or_label_class(dossier) }
|
||||||
= dossier.statut
|
= dossier_display_state(dossier, lower: true)
|
||||||
|
|
Loading…
Add table
Reference in a new issue