[#10799] Add warning badges when token is expiring

This commit is contained in:
Mathieu Magnin 2024-09-26 11:27:29 +02:00
parent ec2c913ab4
commit 2bf773b0b7
No known key found for this signature in database
GPG key ID: 8DCAFC82D7BA654E
4 changed files with 11 additions and 0 deletions

View file

@ -28,6 +28,11 @@
- elsif @procedure.locked?
= link_to commencer_url(@procedure.path), commencer_url(@procedure.path), class: "fr-link"
.flex.fr-mt-1w
- if @procedure.api_entreprise_token_expired_or_expires_soon?
%span.fr-badge.fr-badge--warning.fr-mr-1w
= t('to_modify', scope: [:layouts, :breadcrumb])
%span.fr-badge.fr-badge--success.fr-mr-1w
= t('published', scope: [:layouts, :breadcrumb])
= t('since', scope: [:layouts, :breadcrumb], number: @procedure.id, date: l(@procedure.published_at.to_date))

View file

@ -54,11 +54,15 @@
.text-right
%p.fr-mb-0.width-max-content N° #{number_with_html_delimiter(procedure.id)}
- if procedure.close? || procedure.depubliee?
%span.fr-badge.fr-badge--sm.fr-badge--warning
= t('closed', scope: [:layouts, :breadcrumb])
- elsif procedure.publiee?
- if procedure.api_entreprise_token_expired_or_expires_soon?
%span.fr-badge.fr-badge--sm.fr-badge--warning
= t('to_modify', scope: [:layouts, :breadcrumb])
%span.fr-badge.fr-badge--sm.fr-badge--success
= t('published', scope: [:layouts, :breadcrumb])