templates/etablissement/list.html.twig line 1
{% extends 'base.html.twig' %}{% block title %}Tous les établissements | DAIP{% endblock %}{% block body %}<section class="min-h-screen bg-gradient-to-br from-indigo-700 via-purple-700 to-blue-700 py-12 sm:py-20"><div class="container mx-auto px-4 w-full max-w-full">{#<a href="{{ path('app_home') }}" class="inline-flex items-center text-white/70 hover:text-white transition text-sm">#}{# <i class="fas fa-arrow-left mr-2"></i> Retour à l'accueil#}{#</a>#}{# En-tête #}<div class="text-center mb-8 sm:mb-12"><div class="inline-flex items-center rounded-full border border-white bg-white px-3 sm:px-4 py-1.5 text-xs sm:text-sm font-semibold text-purple-500 mb-4 shadow-lg"><i class="fas fa-building mr-2"></i>ÉTABLISSEMENTS DE FORMATION</div><h1 class="text-2xl sm:text-3xl md:text-4xl font-bold text-white mb-4">{{ total }} établissements disponibles</h1></div>{# Filtres #}<div class="max-w-4xl mx-auto mb-8 px-2"><div class="flex flex-col sm:flex-row gap-3 sm:gap-4"><div class="flex-1"><div class="relative"><i class="fas fa-search absolute left-3 top-1/2 transform -translate-y-1/2 text-slate-400"></i><input type="text"id="recherche-input"placeholder="Rechercher un établissement..."value="{{ recherche }}"class="w-full pl-10 pr-4 py-2 sm:py-3 rounded-lg border border-white/30 bg-white/10 backdrop-blur-sm text-white placeholder-white/70 text-sm sm:text-base focus:outline-none focus:ring-2 focus:ring-white"></div></div><div class="sm:w-64"><select id="direction-filter" class="w-full px-4 py-2 sm:py-3 rounded-lg border border-white/30 bg-white/10 backdrop-blur-sm text-white text-sm sm:text-base focus:outline-none focus:ring-2 focus:ring-white"><option value="">Toutes les directions</option>{% for direction in directions %}<option value="{{ direction.id }}" {{ directionSelectionnee == direction.id ? 'selected' : '' }}>{{ direction.nom }}</option>{% endfor %}</select></div></div></div>{# Grille #}<div id="etablissements-grid" class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 sm:gap-6">{% include 'partials/_etablissements_cards.html.twig' with {'etablissements': etablissements} %}</div>{# Chargement #}<div id="loading" class="hidden text-center py-8"><div class="inline-block w-8 h-8 border-4 border-white/30 border-t-white rounded-full animate-spin"></div></div></div></section><script>document.addEventListener('DOMContentLoaded', function() {const recherche = document.getElementById('recherche-input');const direction = document.getElementById('direction-filter');function recharger() {const url = new URL(window.location.href);url.searchParams.set('page', '1');url.searchParams.set('recherche', recherche.value);url.searchParams.set('direction', direction.value);window.location.href = url.toString();}let timer;recherche.addEventListener('input', () => {clearTimeout(timer);timer = setTimeout(recharger, 500);});direction.addEventListener('change', recharger);});</script>{% endblock %}