feat: refonte du design global (messages flash, navbar, pied-de-page) et simplification du code Twig

This commit is contained in:
2026-04-09 19:46:01 +02:00
parent 1bb651b7e4
commit 4f7dc49f13

View File

@@ -12,11 +12,11 @@
{% endblock %} {% endblock %}
{% block javascripts %} {% block javascripts %}
{% block importmap %}{{ importmap('app') }}{% endblock %} {{ importmap('app') }}
{% endblock %} {% endblock %}
</head> </head>
<body> <body class="min-h-screen flex flex-col font-sora antialiased text-text">
{% block navbar %} {% block navbar %}
{{ include('_navbar.html.twig') }} {{ include('_navbar.html.twig') }}
@@ -28,67 +28,58 @@
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mt-4"> <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mt-4">
{% for label, messages in app.flashes %} {% for label, messages in app.flashes %}
{% for message in messages %} {% for message in messages %}
<div class="flex items-center p-4 mb-4 rounded-lg border shadow-sm {% set colorClasses = {
{{ label == 'success' ? 'bg-green-50 border-green-200 text-green-800' : 'success': 'bg-green-50 border-green-200 text-green-800',
label == 'error' ? 'bg-red-50 border-red-200 text-red-800' : 'error': 'bg-red-50 border-red-200 text-red-800',
label == 'warning' ? 'bg-yellow-50 border-yellow-200 text-yellow-800' : 'warning': 'bg-yellow-50 border-yellow-200 text-yellow-800',
'bg-blue-50 border-blue-200 text-blue-800' }}" 'info': 'bg-blue-50 border-blue-200 text-blue-800'
} %}
<div
class="flex items-center p-4 mb-4 rounded-lg border shadow-sm {{ colorClasses[label] ?? colorClasses['info'] }}"
role="alert"> role="alert">
<div class="text-sm font-semibold flex-grow">
{# Icône dynamique #}
<svg class="flex-shrink-0 w-5 h-5 mr-3" fill="currentColor" viewBox="0 0 20 20">
{% if label == 'success' %}
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"></path>
{% else %}
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd"></path>
{% endif %}
</svg>
<div class="text-sm font-bold">
{{ message }} {{ message }}
</div> </div>
{# Bouton Fermer #}
<button type="button" <button type="button"
onclick="this.parentElement.remove()" onclick="this.parentElement.remove()"
class="text-lg font-bold hover:opacity-70 transition-opacity ml-4"> class="ml-4 hover:opacity-50 transition-opacity"
&times; aria-label="Fermer">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M6 18L18 6M6 6l12 12"></path>
</svg>
</button> </button>
</div> </div>
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
</div> </div>
{# Contenu principal de chaque page #}
{% block body %}{% endblock %} {% block body %}{% endblock %}
</main> </main>
{# Gestion du pied-de-page du site #}
<footer class="bg-white border-t border-gris-clair py-6 sm:py-8 mt-auto w-full font-sora">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 flex flex-col md:flex-row justify-between items-center gap-4">
<div class="text-sm text-gris-fonce flex items-center gap-2 justify-center md:justify-start">
{# Logo de l'association #}
<img src="{{ asset('img/logo.svg') }}"
alt="Logo de l'association"
class="h-6 w-auto object-contain opacity-80 hover:opacity-100 transition-opacity">
{# Gestion du pied-de-page du site #}
<footer class="bg-white border-t border-gris-clair py-8 w-full">
<div
class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 flex flex-col md:flex-row justify-between items-center gap-6">
<div class="flex items-center gap-3 text-sm text-gris-fonce text-center md:text-left">
{# Logo de l'association #}
<img src="{{ asset('img/logo.svg') }}" alt="Logo" class="h-6 w-auto opacity-80">
{# Le texte et les liens #} {# Le texte et les liens #}
<span> <p>&copy; {{ 'now'|date('Y') }} — Kaz. Le numérique sobre, libre, éthique et local.</p>
&copy; {{ 'now'|date('Y') }} | Kaz, le numérique sobre, libre, éthique et local.
</span>
</div> </div>
<ul class="flex flex-wrap justify-center gap-4 sm:gap-6 text-sm text-gris-fonce"> <nav>
<li> <ul class="flex flex-wrap justify-center gap-6 text-sm text-gris-fonce">
<a href="https://kaz.bzh/mentions-legales/" target="_blank" class="hover:text-bouton transition-colors">Mentions légales et statuts</a> <li><a href="https://kaz.bzh/mentions-legales/" target="_blank"
</li> class="hover:text-bouton transition-colors">Mentions légales</a></li>
<li> <li><a href="https://status.kaz.bzh/status/kaz" target="_blank"
<a href="https://status.kaz.bzh/status/kaz" target="_blank" class="hover:text-bouton transition-colors">Santé des services Kaz</a> class="hover:text-bouton transition-colors">État des services</a></li>
</li> <li><a href="https://kaz.bzh/contact/" target="_blank" class="hover:text-bouton transition-colors">Contact</a>
<li>
<a href="https://kaz.bzh/contact/" target="_blank" class="hover:text-bouton transition-colors">Contact</a>
</li> </li>
</ul> </ul>
</nav>
</div> </div>
</footer> </footer>
</body> </body>