Add French translations and implement UI for audit trail download statuses

- Added new French translations for audit trail download states in `messages.fr.yml`.
- Updated `waitForDump` endpoint to render a Twig template with download status.
- Created `download.html.twig` to display the download status with dynamic messages for different states.
This commit is contained in:
2026-02-23 13:48:40 +01:00
parent c5ed93eebd
commit 1099302ab2
3 changed files with 43 additions and 2 deletions

View File

@@ -92,10 +92,14 @@ final readonly class AuditTrailSearchController
}
#[Route('/{_locale°/main/audit-trail/wait/{uuid}', name: 'chill_main_audit_trail_wait')]
#[Route('/{_locale}/main/audit-trail/wait/{uuid}', name: 'chill_main_audit_trail_wait')]
public function waitForDump(StoredObject $storedObject): Response
{
return new Response($storedObject->getStatus());
return new Response(
$this->twig->render('@ChillMain/AuditTrail/download.html.twig', [
'storedObject' => $storedObject,
])
);
}
private function buildFilter(): FilterOrderHelper

View File

@@ -0,0 +1,31 @@
{% extends "@ChillMain/layout.html.twig" %}
{% block title "audit_trail.download.title"|trans %}
{% block js %}
{{ encore_entry_link_tags('page_wait_download_stored_object') }}
{% endblock %}
{% block css %}
{{ encore_entry_script_tags('page_wait_download_stored_object') }}
{% endblock %}
{% block content %}
<h1>{{ block('title') }}</h1>
<div data-wait-download-stored-object="1"
data-stored-object-uuid="{{ storedObject.uuid }}"
data-waiting-text="{{ 'audit_trail.download.waiting'|trans }}"
data-stopped-text="{{ 'audit_trail.download.stopped'|trans }}"
data-failure-text="{{ 'audit_trail.download.failure'|trans }}"
data-ready-text="{{ 'audit_trail.download.ready'|trans }}"
></div>
<ul class="sticky-form-buttons record_actions">
<li class="cancel">
<a href="{{ chill_return_path_or('chill_main_audit_trail_list') }}" class="btn btn-cancel">
{{ 'Cancel'|trans|chill_return_path_label }}
</a>
</li>
</ul>
{% endblock content %}

View File

@@ -1026,3 +1026,9 @@ audit_trail:
person_number: Identifiant usager
by_users: Utilisateurs
download: Télécharger
download:
title: Téléchargement de la liste des accès
ready: Liste prête
waiting: En cours de préparation
failure: Erreur lors de la préparation du document
stopped: La préparation a nécessité une attente trop longue, veuillez recharger la page