change badge color for dossier status and add icons for succes and instruction

This commit is contained in:
Lisa Durand 2023-06-08 10:43:24 +02:00
parent f6811e6ef6
commit c9bb4dc38e

View file

@ -62,14 +62,14 @@ module DossierHelper
def class_badge_state(state)
case state
when Dossier.states.fetch(:en_construction), Dossier.states.fetch(:en_instruction)
'fr-badge--info'
when Dossier.states.fetch(:en_construction)
'fr-badge--purple-glycine'
when Dossier.states.fetch(:en_instruction)
'fr-badge--new'
when Dossier.states.fetch(:accepte)
'fr-badge--success'
when Dossier.states.fetch(:refuse)
when Dossier.states.fetch(:refuse), Dossier.states.fetch(:sans_suite)
'fr-badge--warning'
when Dossier.states.fetch(:sans_suite)
'fr-badge--new'
when Dossier.states.fetch(:brouillon)
''
else
@ -79,7 +79,11 @@ module DossierHelper
def status_badge(state, alignment_class = '')
status_text = dossier_display_state(state, lower: true)
tag.span(status_text, class: "fr-badge fr-badge--sm #{class_badge_state(state)} fr-badge--no-icon #{alignment_class}", role: 'status')
if [Dossier.states.fetch(:en_instruction), Dossier.states.fetch(:accepte)].include?(state)
tag.span(status_text, class: "fr-badge fr-badge--sm #{class_badge_state(state)} #{alignment_class}", role: 'status')
else
tag.span(status_text, class: "fr-badge fr-badge--sm #{class_badge_state(state)} fr-badge--no-icon #{alignment_class}", role: 'status')
end
end
def deletion_reason_badge(reason)