style(demande): modification date as badge
This commit is contained in:
parent
9811d666b2
commit
25015a8b8b
3 changed files with 11 additions and 4 deletions
|
@ -11,7 +11,7 @@
|
|||
|
||||
- if updated_after_deposer?(champ)
|
||||
%p.fr-mb-0.fr-text--sm
|
||||
%span{ class: highlight_if_unseen_class(@demande_seen_at, champ.updated_at) }
|
||||
%span.fr-badge.fr-badge--sm{ class: badge_class_if_unseen(@demande_seen_at, champ.updated_at) }
|
||||
= t(:updated_at, scope: [:views, :shared, :dossiers, :form], datetime: try_format_datetime(champ.updated_at))
|
||||
|
||||
- if champ.blank?
|
||||
|
|
|
@ -17,6 +17,13 @@ module DossierHelper
|
|||
end
|
||||
end
|
||||
|
||||
def badge_class_if_unseen(seen_at, updated_at)
|
||||
return if updated_at.blank? || seen_at.blank?
|
||||
return if seen_at > updated_at
|
||||
|
||||
"fr-badge--new"
|
||||
end
|
||||
|
||||
def url_for_dossier(dossier)
|
||||
if dossier.brouillon?
|
||||
brouillon_dossier_path(dossier)
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
%p.champ-label.flex-grow= dossier.procedure.routing_criteria_name
|
||||
%p.fr-mb-0.fr-text--xs
|
||||
- if demande_seen_at&.<(dossier.groupe_instructeur_updated_at)
|
||||
%span{ class: highlight_if_unseen_class(demande_seen_at, dossier.groupe_instructeur_updated_at) }
|
||||
= t(:updated_at, scope: [:views, :shared, :dossiers, :form], datetime: try_format_datetime(dossier.updated_at))
|
||||
- if demande_seen_at && dossier.groupe_instructeur_updated_at && dossier.groupe_instructeur_updated_at > dossier.depose_at
|
||||
%span.fr-badge.fr-badge--sm{ class: badge_class_if_unseen(demande_seen_at, dossier.groupe_instructeur_updated_at) }
|
||||
= t(:updated_at, scope: [:views, :shared, :dossiers, :form], datetime: try_format_datetime(dossier.groupe_instructeur_updated_at))
|
||||
|
||||
.champ-content{ class: highlight_if_unseen_class(demande_seen_at, dossier.groupe_instructeur_updated_at) }
|
||||
%p= dossier.groupe_instructeur.label
|
||||
|
|
Loading…
Reference in a new issue