Download index.html from Decodeur/https-cdn-tailwindcss-com: direct link, hf CLI and curl.
- Browser
- Download file 34.5 kB
-
https://huggingface.co/spaces/Decodeur/https-cdn-tailwindcss-com/resolve/main/index.html
- Command line
-
hf download hf://spaces/Decodeur/https-cdn-tailwindcss-com/index.html
-
curl -L -o index.html https://huggingface.co/spaces/Decodeur/https-cdn-tailwindcss-com/resolve/main/index.html
34.5 kB
| <html lang="fr"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>EduManage - Gestion des Établissements Scolaires</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <script src="https://cdn.jsdelivr.net/npm/socket.io-client@4.7.2/dist/socket.io.min.js"></script> | |
| <style> | |
| .dashboard-grid { | |
| display: grid; | |
| grid-template-columns: 250px 1fr; | |
| min-height: 100vh; | |
| } | |
| .stats-grid { | |
| display: grid; | |
| grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); | |
| gap: 1rem; | |
| } | |
| .iframe-container { | |
| position: relative; | |
| overflow: hidden; | |
| padding-top: 56.25%; | |
| } | |
| .iframe-container iframe { | |
| position: absolute; | |
| top: 0; | |
| left: 0; | |
| width: 100%; | |
| height: 100%; | |
| border: 0; | |
| } | |
| @media (max-width: 768px) { | |
| .dashboard-grid { | |
| grid-template-columns: 1fr; | |
| } | |
| .sidebar { | |
| display: none; | |
| } | |
| .mobile-menu-button { | |
| display: block; | |
| } | |
| } | |
| .sidebar { | |
| transition: all 0.3s ease; | |
| } | |
| .sidebar-mobile { | |
| transform: translateX(-100%); | |
| } | |
| .sidebar-visible { | |
| transform: translateX(0); | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-100 font-sans"> | |
| <!-- Mobile Menu Button --> | |
| <div class="md:hidden bg-blue-800 p-4 flex justify-between items-center"> | |
| <h1 class="text-white font-bold text-xl">EduManage</h1> | |
| <button id="mobileMenuButton" class="text-white focus:outline-none"> | |
| <i class="fas fa-bars text-2xl"></i> | |
| </button> | |
| </div> | |
| <!-- Dashboard Layout --> | |
| <div class="dashboard-grid"> | |
| <!-- Sidebar --> | |
| <div id="sidebar" class="sidebar bg-blue-800 text-white sidebar-mobile md:sidebar-visible"> | |
| <div class="p-4 hidden md:block"> | |
| <h1 class="text-2xl font-bold">EduManage</h1> | |
| <p class="text-blue-200 text-sm">Gestion scolaire intelligente</p> | |
| </div> | |
| <nav class="mt-6"> | |
| <div class="px-4 py-2 text-blue-200 uppercase text-xs font-semibold">Navigation</div> | |
| <a href="#" class="block px-4 py-3 text-white bg-blue-700 hover:bg-blue-600 transition"> | |
| <i class="fas fa-home mr-2"></i> Tableau de bord | |
| </a> | |
| <a href="#" class="block px-4 py-3 text-white hover:bg-blue-600 transition"> | |
| <i class="fas fa-school mr-2"></i> Établissements | |
| </a> | |
| <a href="#" class="block px-4 py-3 text-white hover:bg-blue-600 transition"> | |
| <i class="fas fa-users mr-2"></i> Élèves | |
| </a> | |
| <a href="#" class="block px-4 py-3 text-white hover:bg-blue-600 transition"> | |
| <i class="fas fa-chalkboard-teacher mr-2"></i> Enseignants | |
| </a> | |
| <a href="#" class="block px-4 py-3 text-white hover:bg-blue-600 transition"> | |
| <i class="fas fa-calendar-alt mr-2"></i> Emploi du temps | |
| </a> | |
| <a href="#" class="block px-4 py-3 text-white hover:bg-blue-600 transition"> | |
| <i class="fas fa-graduation-cap mr-2"></i> Résultats | |
| </a> | |
| <div class="px-4 py-2 text-blue-200 uppercase text-xs font-semibold mt-4">Administration</div> | |
| <a href="#" class="block px-4 py-3 text-white hover:bg-blue-600 transition"> | |
| <i class="fas fa-cog mr-2"></i> Paramètres | |
| </a> | |
| <a href="#" class="block px-4 py-3 text-white hover:bg-blue-600 transition"> | |
| <i class="fas fa-globe mr-2"></i> Site Officiel | |
| </a> | |
| </nav> | |
| <div class="absolute bottom-0 left-0 right-0 p-4 bg-blue-900"> | |
| <div class="flex items-center"> | |
| <img src="https://randomuser.me/api/portraits/women/65.jpg" alt="Profile" class="w-10 h-10 rounded-full"> | |
| <div class="ml-3"> | |
| <p class="text-white font-medium">Admin User</p> | |
| <p class="text-blue-300 text-xs">Administrateur</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Main Content --> | |
| <div class="p-4 md:p-8"> | |
| <header class="mb-8"> | |
| <div class="flex justify-between items-start"> | |
| <div> | |
| <h2 class="text-2xl font-bold text-gray-800">Tableau de bord</h2> | |
| <p class="text-gray-600">Bienvenue dans le système de gestion des établissements scolaires</p> | |
| </div> | |
| <div class="flex items-center"> | |
| <div id="connectionStatus" class="flex items-center mr-4"> | |
| <span class="relative flex h-3 w-3 mr-2"> | |
| <span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-gray-400 opacity-75"></span> | |
| <span class="relative inline-flex rounded-full h-3 w-3 bg-gray-500"></span> | |
| </span> | |
| <span class="text-sm text-gray-600">Connexion...</span> | |
| </div> | |
| <div id="notificationBell" class="relative cursor-pointer text-gray-500 hover:text-blue-600"> | |
| <i class="fas fa-bell text-xl"></i> | |
| <span id="notificationCount" class="absolute -top-2 -right-2 bg-red-500 text-white text-xs rounded-full h-5 w-5 flex items-center justify-center hidden">0</span> | |
| </div> | |
| </div> | |
| </div> | |
| </header> | |
| <!-- Stats Cards --> | |
| <div class="stats-grid mb-8"> | |
| <div class="bg-white p-4 rounded-lg shadow"> | |
| <div class="flex items-center"> | |
| <div class="p-3 rounded-full bg-blue-100 text-blue-600"> | |
| <i class="fas fa-school text-xl"></i> | |
| </div> | |
| <div class="ml-4"> | |
| <p class="text-gray-500">Établissements</p> | |
| <h3 class="text-2xl font-bold">24</h3> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white p-4 rounded-lg shadow"> | |
| <div class="flex items-center"> | |
| <div class="p-3 rounded-full bg-green-100 text-green-600"> | |
| <i class="fas fa-users text-xl"></i> | |
| </div> | |
| <div class="ml-4"> | |
| <p class="text-gray-500">Élèves</p> | |
| <h3 class="text-2xl font-bold">1,245</h3> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white p-4 rounded-lg shadow"> | |
| <div class="flex items-center"> | |
| <div class="p-3 rounded-full bg-purple-100 text-purple-600"> | |
| <i class="fas fa-chalkboard-teacher text-xl"></i> | |
| </div> | |
| <div class="ml-4"> | |
| <p class="text-gray-500">Enseignants</p> | |
| <h3 class="text-2xl font-bold">98</h3> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white p-4 rounded-lg shadow"> | |
| <div class="flex items-center"> | |
| <div class="p-3 rounded-full bg-yellow-100 text-yellow-600"> | |
| <i class="fas fa-calendar-check text-xl"></i> | |
| </div> | |
| <div class="ml-4"> | |
| <p class="text-gray-500">Activités</p> | |
| <h3 class="text-2xl font-bold">15</h3> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Main Content Grid --> | |
| <div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-8"> | |
| <!-- Recent Activities --> | |
| <div class="bg-white p-6 rounded-lg shadow lg:col-span-2"> | |
| <div class="flex justify-between items-center mb-4"> | |
| <h3 class="text-lg font-semibold">Activités récentes</h3> | |
| <a href="#" class="text-blue-600 text-sm">Voir tout</a> | |
| </div> | |
| <div class="space-y-4"> | |
| <div class="flex items-start"> | |
| <div class="p-2 bg-blue-100 rounded-full text-blue-600 mr-3"> | |
| <i class="fas fa-user-plus"></i> | |
| </div> | |
| <div> | |
| <p class="font-medium">Nouvel élève inscrit</p> | |
| <p class="text-gray-500 text-sm">Jean Dupont a été inscrit en classe de 5ème</p> | |
| <p class="text-gray-400 text-xs mt-1">Il y a 2 heures</p> | |
| </div> | |
| </div> | |
| <div class="flex items-start"> | |
| <div class="p-2 bg-green-100 rounded-full text-green-600 mr-3"> | |
| <i class="fas fa-check-circle"></i> | |
| </div> | |
| <div> | |
| <p class="font-medium">Résultats publiés</p> | |
| <p class="text-gray-500 text-sm">Les résultats du 2ème trimestre ont été publiés</p> | |
| <p class="text-gray-400 text-xs mt-1">Il y a 1 jour</p> | |
| </div> | |
| </div> | |
| <div class="flex items-start"> | |
| <div class="p-2 bg-purple-100 rounded-full text-purple-600 mr-3"> | |
| <i class="fas fa-calendar-alt"></i> | |
| </div> | |
| <div> | |
| <p class="font-medium">Nouvel événement</p> | |
| <p class="text-gray-500 text-sm">Journée portes ouvertes prévue le 15 juin</p> | |
| <p class="text-gray-400 text-xs mt-1">Il y a 2 jours</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Quick Actions --> | |
| <div class="bg-white p-6 rounded-lg shadow"> | |
| <h3 class="text-lg font-semibold mb-4">Actions rapides</h3> | |
| <div class="grid grid-cols-2 gap-3"> | |
| <a href="#" class="p-4 bg-blue-50 rounded-lg text-center hover:bg-blue-100 transition"> | |
| <i class="fas fa-user-plus text-blue-600 text-xl mb-2"></i> | |
| <p class="text-sm font-medium">Ajouter élève</p> | |
| </a> | |
| <a href="#" class="p-4 bg-green-50 rounded-lg text-center hover:bg-green-100 transition"> | |
| <i class="fas fa-chalkboard-teacher text-green-600 text-xl mb-2"></i> | |
| <p class="text-sm font-medium">Ajouter enseignant</p> | |
| </a> | |
| <a href="#" class="p-4 bg-purple-50 rounded-lg text-center hover:bg-purple-100 transition"> | |
| <i class="fas fa-file-alt text-purple-600 text-xl mb-2"></i> | |
| <p class="text-sm font-medium">Générer rapport</p> | |
| </a> | |
| <a href="#" class="p-4 bg-yellow-50 rounded-lg text-center hover:bg-yellow-100 transition"> | |
| <i class="fas fa-bell text-yellow-600 text-xl mb-2"></i> | |
| <p class="text-sm font-medium">Envoyer notification</p> | |
| </a> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- School Website Section --> | |
| <div class="bg-white p-6 rounded-lg shadow mb-8"> | |
| <div class="flex justify-between items-center mb-4"> | |
| <h3 class="text-lg font-semibold">Site Officiel de l'Établissement</h3> | |
| <div class="flex space-x-2"> | |
| <button class="px-3 py-1 bg-blue-600 text-white rounded hover:bg-blue-700 transition"> | |
| <i class="fas fa-sync-alt mr-1"></i> Actualiser | |
| </button> | |
| <button class="px-3 py-1 bg-gray-200 text-gray-700 rounded hover:bg-gray-300 transition"> | |
| <i class="fas fa-expand mr-1"></i> Plein écran | |
| </button> | |
| </div> | |
| </div> | |
| <div class="iframe-container"> | |
| <iframe src="https://www.education.gouv.fr/" allowfullscreen></iframe> | |
| </div> | |
| <div class="mt-4 flex justify-between items-center"> | |
| <div class="text-sm text-gray-500"> | |
| <i class="fas fa-info-circle mr-1"></i> Site officiel du ministère de l'éducation | |
| </div> | |
| <div class="flex space-x-2"> | |
| <button class="text-blue-600 hover:text-blue-800"> | |
| <i class="fas fa-edit mr-1"></i> Modifier | |
| </button> | |
| <button class="text-blue-600 hover:text-blue-800"> | |
| <i class="fas fa-cog mr-1"></i> Paramètres | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- School List --> | |
| <div class="bg-white p-6 rounded-lg shadow"> | |
| <div class="flex flex-col md:flex-row md:justify-between md:items-center mb-4 gap-4"> | |
| <h3 class="text-lg font-semibold">Établissements secondaires</h3> | |
| <div class="flex flex-col sm:flex-row gap-3 w-full md:w-auto"> | |
| <div class="relative flex-grow"> | |
| <input type="text" id="schoolSearch" placeholder="Rechercher un établissement..." class="w-full pl-10 pr-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"> | |
| <i class="fas fa-search absolute left-3 top-3 text-gray-400"></i> | |
| </div> | |
| <select id="schoolTypeFilter" class="border rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"> | |
| <option value="all">Tous les types</option> | |
| <option value="lycee">Lycée</option> | |
| <option value="college">Collège</option> | |
| <option value="lycee_pro">Lycée Professionnel</option> | |
| </select> | |
| <button id="addSchoolBtn" class="px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition whitespace-nowrap"> | |
| <i class="fas fa-plus mr-1"></i> Ajouter | |
| </button> | |
| </div> | |
| </div> | |
| <div class="overflow-x-auto"> | |
| <table class="min-w-full divide-y divide-gray-200"> | |
| <thead class="bg-gray-50"> | |
| <tr> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Nom</th> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Type</th> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Localisation</th> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Élèves</th> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Statut</th> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th> | |
| </tr> | |
| </thead> | |
| <tbody class="bg-white divide-y divide-gray-200"> | |
| <tr> | |
| <td class="px-6 py-4 whitespace-nowrap"> | |
| <div class="flex items-center"> | |
| <div class="flex-shrink-0 h-10 w-10 bg-blue-100 rounded-full flex items-center justify-center text-blue-600"> | |
| <i class="fas fa-school"></i> | |
| </div> | |
| <div class="ml-4"> | |
| <div class="text-sm font-medium text-gray-900">Lycée Victor Hugo</div> | |
| <div class="text-sm text-gray-500">Code: LVH123</div> | |
| </div> | |
| </div> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap"> | |
| <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-blue-100 text-blue-800"> | |
| Lycée | |
| </span> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Paris, 75016</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">856</td> | |
| <td class="px-6 py-4 whitespace-nowrap"> | |
| <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800"> | |
| Actif | |
| </span> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm font-medium"> | |
| <a href="#" class="text-blue-600 hover:text-blue-900 mr-3"><i class="fas fa-eye"></i></a> | |
| <a href="#" class="text-yellow-600 hover:text-yellow-900 mr-3"><i class="fas fa-edit"></i></a> | |
| <a href="#" class="text-red-600 hover:text-red-900"><i class="fas fa-trash"></i></a> | |
| </td> | |
| </tr> | |
| <tr> | |
| <td class="px-6 py-4 whitespace-nowrap"> | |
| <div class="flex items-center"> | |
| <div class="flex-shrink-0 h-10 w-10 bg-green-100 rounded-full flex items-center justify-center text-green-600"> | |
| <i class="fas fa-school"></i> | |
| </div> | |
| <div class="ml-4"> | |
| <div class="text-sm font-medium text-gray-900">Collège Marie Curie</div> | |
| <div class="text-sm text-gray-500">Code: CMC456</div> | |
| </div> | |
| </div> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap"> | |
| <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800"> | |
| Collège | |
| </span> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Lyon, 69002</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">623</td> | |
| <td class="px-6 py-4 whitespace-nowrap"> | |
| <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800"> | |
| Actif | |
| </span> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm font-medium"> | |
| <a href="#" class="text-blue-600 hover:text-blue-900 mr-3"><i class="fas fa-eye"></i></a> | |
| <a href="#" class="text-yellow-600 hover:text-yellow-900 mr-3"><i class="fas fa-edit"></i></a> | |
| <a href="#" class="text-red-600 hover:text-red-900"><i class="fas fa-trash"></i></a> | |
| </td> | |
| </tr> | |
| <tr> | |
| <td class="px-6 py-4 whitespace-nowrap"> | |
| <div class="flex items-center"> | |
| <div class="flex-shrink-0 h-10 w-10 bg-purple-100 rounded-full flex items-center justify-center text-purple-600"> | |
| <i class="fas fa-school"></i> | |
| </div> | |
| <div class="ml-4"> | |
| <div class="text-sm font-medium text-gray-900">École Primaire Jules Ferry</div> | |
| <div class="text-sm text-gray-500">Code: EPJF789</div> | |
| </div> | |
| </div> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap"> | |
| <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-purple-100 text-purple-800"> | |
| Primaire | |
| </span> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Marseille, 13001</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">312</td> | |
| <td class="px-6 py-4 whitespace-nowrap"> | |
| <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-yellow-100 text-yellow-800"> | |
| Maintenance | |
| </span> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm font-medium"> | |
| <a href="#" class="text-blue-600 hover:text-blue-900 mr-3"><i class="fas fa-eye"></i></a> | |
| <a href="#" class="text-yellow-600 hover:text-yellow-900 mr-3"><i class="fas fa-edit"></i></a> | |
| <a href="#" class="text-red-600 hover:text-red-900"><i class="fas fa-trash"></i></a> | |
| </td> | |
| </tr> | |
| </tbody> | |
| </table> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <script> | |
| // Connexion WebSocket | |
| const socket = io('https://votre-serveur-socket.io', { | |
| reconnectionAttempts: 5, | |
| reconnectionDelay: 1000, | |
| transports: ['websocket'] | |
| }); | |
| // Gestion de la connexion temps réel | |
| socket.on('connect', () => { | |
| updateConnectionStatus('connected', 'Connecté en temps réel'); | |
| }); | |
| socket.on('disconnect', () => { | |
| updateConnectionStatus('disconnected', 'Déconnecté - Tentative de reconnexion...'); | |
| }); | |
| socket.on('connect_error', () => { | |
| updateConnectionStatus('error', 'Erreur de connexion'); | |
| }); | |
| function updateConnectionStatus(status, message) { | |
| const statusElement = document.getElementById('connectionStatus'); | |
| const dot = statusElement.querySelector('span:first-child span:last-child'); | |
| statusElement.querySelector('span:last-child').textContent = message; | |
| dot.className = 'relative inline-flex rounded-full h-3 w-3 ' + | |
| (status === 'connected' ? 'bg-green-500' : | |
| status === 'disconnected' ? 'bg-yellow-500' : 'bg-red-500'); | |
| } | |
| // Écoute des mises à jour des établissements | |
| socket.on('schoolUpdate', (data) => { | |
| showNotification(`Mise à jour: ${data.message}`, 'info'); | |
| refreshSchoolList(); | |
| }); | |
| // Mobile menu toggle | |
| const mobileMenuButton = document.getElementById('mobileMenuButton'); | |
| const sidebar = document.getElementById('sidebar'); | |
| mobileMenuButton.addEventListener('click', () => { | |
| sidebar.classList.toggle('sidebar-visible'); | |
| }); | |
| // Simulate loading data | |
| document.addEventListener('DOMContentLoaded', () => { | |
| // You could add AJAX calls here to load real data | |
| console.log('Dashboard loaded'); | |
| }); | |
| // Gestion des établissements | |
| async function refreshSchoolList() { | |
| try { | |
| const response = await fetch('/api/schools'); | |
| const schools = await response.json(); | |
| renderSchoolList(schools); | |
| } catch (error) { | |
| console.error('Erreur lors du chargement des établissements:', error); | |
| showNotification('Erreur de chargement des établissements', 'error'); | |
| } | |
| } | |
| function renderSchoolList(schools) { | |
| const tableBody = document.querySelector('tbody'); | |
| tableBody.innerHTML = schools.map(school => ` | |
| <tr data-school-id="${school.id}" data-type="${school.type}"> | |
| <td class="px-6 py-4 whitespace-nowrap"> | |
| <div class="flex items-center"> | |
| <div class="flex-shrink-0 h-10 w-10 ${getSchoolColorClass(school.type)} rounded-full flex items-center justify-center"> | |
| <i class="fas fa-school"></i> | |
| </div> | |
| <div class="ml-4"> | |
| <div class="text-sm font-medium text-gray-900">${school.name}</div> | |
| <div class="text-sm text-gray-500">Code: ${school.code}</div> | |
| </div> | |
| </div> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap"> | |
| <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${getSchoolBadgeClass(school.type)}"> | |
| ${getSchoolTypeLabel(school.type)} | |
| </span> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${school.location}</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${school.studentsCount}</td> | |
| <td class="px-6 py-4 whitespace-nowrap"> | |
| <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${getStatusClass(school.status)}"> | |
| ${school.status} | |
| </span> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm font-medium"> | |
| <button onclick="viewSchool('${school.id}')" class="text-blue-600 hover:text-blue-900 mr-3"><i class="fas fa-eye"></i></button> | |
| <button onclick="editSchool('${school.id}')" class="text-yellow-600 hover:text-yellow-900 mr-3"><i class="fas fa-edit"></i></button> | |
| <button onclick="deleteSchool('${school.id}')" class="text-red-600 hover:text-red-900"><i class="fas fa-trash"></i></button> | |
| </td> | |
| </tr> | |
| `).join(''); | |
| } | |
| function getSchoolColorClass(type) { | |
| return { | |
| 'lycee': 'bg-blue-100 text-blue-600', | |
| 'college': 'bg-green-100 text-green-600', | |
| 'lycee_pro': 'bg-purple-100 text-purple-600' | |
| }[type] || 'bg-gray-100 text-gray-600'; | |
| } | |
| function getSchoolBadgeClass(type) { | |
| return { | |
| 'lycee': 'bg-blue-100 text-blue-800', | |
| 'college': 'bg-green-100 text-green-800', | |
| 'lycee_pro': 'bg-purple-100 text-purple-800' | |
| }[type] || 'bg-gray-100 text-gray-800'; | |
| } | |
| function getSchoolTypeLabel(type) { | |
| return { | |
| 'lycee': 'Lycée', | |
| 'college': 'Collège', | |
| 'lycee_pro': 'Lycée Pro' | |
| }[type] || type; | |
| } | |
| function getStatusClass(status) { | |
| return { | |
| 'Actif': 'bg-green-100 text-green-800', | |
| 'Maintenance': 'bg-yellow-100 text-yellow-800', | |
| 'Inactif': 'bg-red-100 text-red-800' | |
| }[status] || 'bg-gray-100 text-gray-800'; | |
| } | |
| // Fonctions de gestion | |
| function viewSchool(id) { | |
| console.log('Voir établissement:', id); | |
| // Implémentez la logique d'affichage | |
| } | |
| function editSchool(id) { | |
| console.log('Modifier établissement:', id); | |
| // Implémentez la logique d'édition | |
| } | |
| async function deleteSchool(id) { | |
| if (confirm('Êtes-vous sûr de vouloir supprimer cet établissement ?')) { | |
| try { | |
| const response = await fetch(`/api/schools/${id}`, { method: 'DELETE' }); | |
| if (response.ok) { | |
| showNotification('Établissement supprimé avec succès', 'success'); | |
| refreshSchoolList(); | |
| } | |
| } catch (error) { | |
| console.error('Erreur lors de la suppression:', error); | |
| showNotification('Erreur lors de la suppression', 'error'); | |
| } | |
| } | |
| } | |
| // Initialisation | |
| document.addEventListener('DOMContentLoaded', () => { | |
| refreshSchoolList(); | |
| // Filtre de recherche | |
| document.getElementById('schoolSearch').addEventListener('input', (e) => { | |
| const searchTerm = e.target.value.toLowerCase(); | |
| document.querySelectorAll('tbody tr').forEach(row => { | |
| const schoolName = row.querySelector('td:first-child div:first-child div:first-child').textContent.toLowerCase(); | |
| row.style.display = schoolName.includes(searchTerm) ? '' : 'none'; | |
| }); | |
| }); | |
| // Filtre par type | |
| document.getElementById('schoolTypeFilter').addEventListener('change', (e) => { | |
| const type = e.target.value; | |
| document.querySelectorAll('tbody tr').forEach(row => { | |
| if (type === 'all') { | |
| row.style.display = ''; | |
| } else { | |
| row.style.display = row.dataset.type === type ? '' : 'none'; | |
| } | |
| }); | |
| }); | |
| }); | |
| // Sample function to show a notification | |
| function showNotification(message, type = 'info') { | |
| const colors = { | |
| info: 'blue', | |
| success: 'green', | |
| warning: 'yellow', | |
| error: 'red' | |
| }; | |
| const notification = document.createElement('div'); | |
| notification.className = `fixed bottom-4 right-4 p-4 rounded-lg shadow-lg bg-${colors[type]}-100 border-l-4 border-${colors[type]}-500 text-${colors[type]}-700`; | |
| notification.innerHTML = ` | |
| <div class="flex items-center"> | |
| <i class="fas fa-info-circle mr-2"></i> | |
| <span>${message}</span> | |
| </div> | |
| `; | |
| document.body.appendChild(notification); | |
| setTimeout(() => { | |
| notification.remove(); | |
| }, 3000); | |
| } | |
| // Example usage: | |
| // showNotification('Bienvenue dans EduManage!', 'success'); | |
| </script> | |
| <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Decodeur/https-cdn-tailwindcss-com" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |