Download index.html from masterseb/mdm: direct link, hf CLI and curl.
- Browser
- Download file 32.7 kB
-
https://huggingface.co/spaces/masterseb/mdm/resolve/main/index.html
- Command line
-
hf download hf://spaces/masterseb/mdm/index.html
-
curl -L -o index.html https://huggingface.co/spaces/masterseb/mdm/resolve/main/index.html
32.7 kB
| <html lang="fr"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Gestion des Espaces - Établissement</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"> | |
| <style> | |
| .room-card { | |
| transition: all 0.3s ease; | |
| } | |
| .room-card:hover { | |
| transform: translateY(-5px); | |
| box-shadow: 0 10px 20px rgba(0,0,0,0.1); | |
| } | |
| .occupied { | |
| background-color: #fee2e2; | |
| border-left: 4px solid #ef4444; | |
| } | |
| .available { | |
| background-color: #dcfce7; | |
| border-left: 4px solid #22c55e; | |
| } | |
| .special-event { | |
| background-color: #e0e7ff; | |
| border-left: 4px solid #6366f1; | |
| } | |
| .time-slot { | |
| transition: all 0.2s ease; | |
| } | |
| .time-slot:hover { | |
| transform: scale(1.03); | |
| } | |
| .tab-active { | |
| border-bottom: 3px solid #4f46e5; | |
| font-weight: 600; | |
| color: #4f46e5; | |
| } | |
| .uape-slot { | |
| background-color: #fef3c7; | |
| border-left: 4px solid #f59e0b; | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-50 min-h-screen"> | |
| <div class="container mx-auto px-4 py-8"> | |
| <header class="mb-10 text-center"> | |
| <h1 class="text-4xl font-bold text-indigo-700 mb-2">Gestion des Espaces</h1> | |
| <p class="text-lg text-gray-600">Visualisez et gérez l'occupation de vos salles en temps réel</p> | |
| <div class="mt-6"> | |
| <div class="inline-flex rounded-md shadow-sm" role="group"> | |
| <button onclick="showDay('lundi')" class="day-tab px-4 py-2 text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 rounded-l-lg">Lundi</button> | |
| <button onclick="showDay('mardi')" class="day-tab px-4 py-2 text-sm font-medium text-gray-700 bg-white hover:bg-gray-50">Mardi</button> | |
| <button onclick="showDay('mercredi')" class="day-tab px-4 py-2 text-sm font-medium text-gray-700 bg-white hover:bg-gray-50">Mercredi</button> | |
| <button onclick="showDay('jeudi')" class="day-tab px-4 py-2 text-sm font-medium text-gray-700 bg-white hover:bg-gray-50">Jeudi</button> | |
| <button onclick="showDay('vendredi')" class="day-tab px-4 py-2 text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 rounded-r-lg">Vendredi</button> | |
| </div> | |
| </div> | |
| </header> | |
| <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6" id="rooms-container"> | |
| <!-- Les salles seront générées dynamiquement --> | |
| </div> | |
| </div> | |
| <!-- Modal de réservation --> | |
| <div id="reservation-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden z-50"> | |
| <div class="bg-white rounded-lg shadow-xl w-full max-w-md"> | |
| <div class="p-6"> | |
| <h3 class="text-xl font-semibold text-gray-800 mb-4">Nouvelle Réservation</h3> | |
| <form id="reservation-form"> | |
| <div class="mb-4"> | |
| <label class="block text-gray-700 text-sm font-bold mb-2" for="room"> | |
| Espace | |
| </label> | |
| <select id="room" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" required> | |
| <option value="">Sélectionnez un espace</option> | |
| <option value="salle1">Salle de Classe 1</option> | |
| <option value="salle2">Salle de Classe 2</option> | |
| <option value="salle3">Salle de Classe 3</option> | |
| <option value="cafeteria">Cafétéria</option> | |
| <option value="bibliotheque">Bibliothèque</option> | |
| </select> | |
| </div> | |
| <div class="mb-4"> | |
| <label class="block text-gray-700 text-sm font-bold mb-2" for="day"> | |
| Jour | |
| </label> | |
| <select id="day" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" required> | |
| <option value="">Sélectionnez un jour</option> | |
| <option value="lundi">Lundi</option> | |
| <option value="mardi">Mardi</option> | |
| <option value="mercredi">Mercredi</option> | |
| <option value="jeudi">Jeudi</option> | |
| <option value="vendredi">Vendredi</option> | |
| </select> | |
| </div> | |
| <div class="grid grid-cols-2 gap-4 mb-4"> | |
| <div> | |
| <label class="block text-gray-700 text-sm font-bold mb-2" for="start-time"> | |
| Heure de début | |
| </label> | |
| <input type="time" id="start-time" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" required> | |
| </div> | |
| <div> | |
| <label class="block text-gray-700 text-sm font-bold mb-2" for="end-time"> | |
| Heure de fin | |
| </label> | |
| <input type="time" id="end-time" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" required> | |
| </div> | |
| </div> | |
| <div class="mb-4"> | |
| <label class="block text-gray-700 text-sm font-bold mb-2" for="event"> | |
| Événement/Activité | |
| </label> | |
| <input type="text" id="event" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" placeholder="Description de l'activité" required> | |
| </div> | |
| <div class="mb-4"> | |
| <label class="block text-gray-700 text-sm font-bold mb-2" for="niveau"> | |
| Niveau (pour cours) | |
| </label> | |
| <select id="niveau" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"> | |
| <option value="">Non applicable</option> | |
| <option value="alpha">Alpha</option> | |
| <option value="a1">A1</option> | |
| <option value="a2">A2</option> | |
| <option value="b1">B1</option> | |
| </select> | |
| </div> | |
| <div class="flex justify-end space-x-3"> | |
| <button type="button" onclick="closeModal()" class="px-4 py-2 bg-gray-300 text-gray-700 rounded hover:bg-gray-400">Annuler</button> | |
| <button type="submit" class="px-4 py-2 bg-indigo-600 text-white rounded hover:bg-indigo-700">Confirmer</button> | |
| </div> | |
| </form> | |
| </div> | |
| </div> | |
| </div> | |
| <script> | |
| // Données initiales | |
| const roomsData = { | |
| salle1: { | |
| name: "Salle de Classe 1", | |
| color: "indigo", | |
| icon: "fa-chalkboard-teacher", | |
| schedule: { | |
| lundi: [ | |
| { time: "9:00 - 10:30", event: "Cours de Mathématiques", type: "occupied", niveau: "alpha" }, | |
| { time: "10:30 - 14:00", event: "Disponible", type: "available" }, | |
| { time: "14:00 - 15:30", event: "Cours de Physique", type: "occupied", niveau: "a1" }, | |
| { time: "15:30 - 18:30", event: "Disponible", type: "available" }, | |
| { time: "18:30 - 21:00", event: "Cours du soir", type: "occupied", niveau: "b1" } | |
| ], | |
| mardi: [ | |
| { time: "9:00 - 10:30", event: "Cours de Chimie", type: "occupied", niveau: "a2" }, | |
| { time: "10:30 - 14:00", event: "Disponible", type: "available" }, | |
| { time: "14:00 - 15:30", event: "Cours de Biologie", type: "occupied", niveau: "alpha" }, | |
| { time: "15:30 - 18:30", event: "Disponible", type: "available" }, | |
| { time: "18:30 - 21:00", event: "Cours du soir", type: "occupied", niveau: "a1" } | |
| ], | |
| mercredi: [ | |
| { time: "9:00 - 10:30", event: "Cours de Français", type: "occupied", niveau: "b1" }, | |
| { time: "10:30 - 14:00", event: "Disponible", type: "available" }, | |
| { time: "14:00 - 15:30", event: "Pas de cours (Mercredi après-midi)", type: "available" }, | |
| { time: "15:30 - 18:30", event: "Disponible", type: "available" }, | |
| { time: "18:30 - 21:00", event: "Cours du soir", type: "occupied", niveau: "a2" } | |
| ], | |
| jeudi: [ | |
| { time: "9:00 - 10:30", event: "Cours d'Histoire", type: "occupied", niveau: "alpha" }, | |
| { time: "10:30 - 14:00", event: "Disponible", type: "available" }, | |
| { time: "14:00 - 15:30", event: "Cours de Géographie", type: "occupied", niveau: "b1" }, | |
| { time: "15:30 - 18:30", event: "Disponible", type: "available" }, | |
| { time: "18:30 - 21:00", event: "Cours du soir", type: "occupied", niveau: "a1" } | |
| ], | |
| vendredi: [ | |
| { time: "8:00 - 10:30", event: "Disponible", type: "available" }, | |
| { time: "10:30 - 14:00", event: "Disponible", type: "available" }, | |
| { time: "14:00 - 15:30", event: "Disponible", type: "available" }, | |
| { time: "15:30 - 18:30", event: "Disponible", type: "available" }, | |
| { time: "18:30 - 21:00", event: "Disponible", type: "available" } | |
| ] | |
| } | |
| }, | |
| salle2: { | |
| name: "Salle de Classe 2", | |
| color: "indigo", | |
| icon: "fa-chalkboard-teacher", | |
| schedule: { | |
| lundi: [ | |
| { time: "9:00 - 10:30", event: "Cours d'Anglais", type: "occupied", niveau: "a1" }, | |
| { time: "10:30 - 14:00", event: "Disponible", type: "available" }, | |
| { time: "14:00 - 15:30", event: "Cours d'Espagnol", type: "occupied", niveau: "a2" }, | |
| { time: "15:30 - 18:30", event: "Disponible", type: "available" }, | |
| { time: "18:30 - 21:00", event: "Cours du soir", type: "occupied", niveau: "b1" } | |
| ], | |
| mardi: [ | |
| { time: "9:00 - 10:30", event: "Cours d'Informatique", type: "occupied", niveau: "alpha" }, | |
| { time: "10:30 - 14:00", event: "Disponible", type: "available" }, | |
| { time: "14:00 - 15:30", event: "Cours de Programmation", type: "occupied", niveau: "a1" }, | |
| { time: "15:30 - 18:30", event: "Disponible", type: "available" }, | |
| { time: "18:30 - 21:00", event: "Cours du soir", type: "occupied", niveau: "a2" } | |
| ], | |
| mercredi: [ | |
| { time: "9:00 - 10:30", event: "Cours de Philosophie", type: "occupied", niveau: "b1" }, | |
| { time: "10:30 - 14:00", event: "Disponible", type: "available" }, | |
| { time: "14:00 - 15:30", event: "Pas de cours (Mercredi après-midi)", type: "available" }, | |
| { time: "15:30 - 18:30", event: "Disponible", type: "available" }, | |
| { time: "18:30 - 21:00", event: "Cours du soir", type: "occupied", niveau: "alpha" } | |
| ], | |
| jeudi: [ | |
| { time: "9:00 - 10:30", event: "Cours d'Arts", type: "occupied", niveau: "a1" }, | |
| { time: "10:30 - 14:00", event: "Disponible", type: "available" }, | |
| { time: "14:00 - 15:30", event: "Cours de Musique", type: "occupied", niveau: "a2" }, | |
| { time: "15:30 - 18:30", event: "Disponible", type: "available" }, | |
| { time: "18:30 - 21:00", event: "Cours du soir", type: "occupied", niveau: "b1" } | |
| ], | |
| vendredi: [ | |
| { time: "8:00 - 10:30", event: "Disponible", type: "available" }, | |
| { time: "10:30 - 14:00", event: "Disponible", type: "available" }, | |
| { time: "14:00 - 15:30", event: "Disponible", type: "available" }, | |
| { time: "15:30 - 18:30", event: "Disponible", type: "available" }, | |
| { time: "18:30 - 21:00", event: "Disponible", type: "available" } | |
| ] | |
| } | |
| }, | |
| salle3: { | |
| name: "Salle de Classe 3", | |
| color: "indigo", | |
| icon: "fa-chalkboard-teacher", | |
| schedule: { | |
| lundi: [ | |
| { time: "9:00 - 10:30", event: "Cours d'Economie", type: "occupied", niveau: "a2" }, | |
| { time: "10:30 - 14:00", event: "Disponible", type: "available" }, | |
| { time: "14:00 - 15:30", event: "Cours de Droit", type: "occupied", niveau: "b1" }, | |
| { time: "15:30 - 18:30", event: "Disponible", type: "available" }, | |
| { time: "18:30 - 21:00", event: "Cours du soir", type: "occupied", niveau: "alpha" } | |
| ], | |
| mardi: [ | |
| { time: "9:00 - 10:30", event: "Cours de Marketing", type: "occupied", niveau: "a1" }, | |
| { time: "10:30 - 14:00", event: "Disponible", type: "available" }, | |
| { time: "14:00 - 15:30", event: "Cours de Gestion", type: "occupied", niveau: "a2" }, | |
| { time: "15:30 - 18:30", event: "Disponible", type: "available" }, | |
| { time: "18:30 - 21:00", event: "Cours du soir", type: "occupied", niveau: "b1" } | |
| ], | |
| mercredi: [ | |
| { time: "9:00 - 10:30", event: "Cours de Communication", type: "occupied", niveau: "alpha" }, | |
| { time: "10:30 - 14:00", event: "Disponible", type: "available" }, | |
| { time: "14:00 - 15:30", event: "Pas de cours (Mercredi après-midi)", type: "available" }, | |
| { time: "15:30 - 18:30", event: "Disponible", type: "available" }, | |
| { time: "18:30 - 21:00", event: "Cours du soir", type: "occupied", niveau: "a1" } | |
| ], | |
| jeudi: [ | |
| { time: "9:00 - 10:30", event: "Cours de Psychologie", type: "occupied", niveau: "a2" }, | |
| { time: "10:30 - 14:00", event: "Disponible", type: "available" }, | |
| { time: "14:00 - 15:30", event: "Cours de Sociologie", type: "occupied", niveau: "b1" }, | |
| { time: "15:30 - 18:30", event: "Disponible", type: "available" }, | |
| { time: "18:30 - 21:00", event: "Cours du soir", type: "occupied", niveau: "alpha" } | |
| ], | |
| vendredi: [ | |
| { time: "8:00 - 10:30", event: "Disponible", type: "available" }, | |
| { time: "10:30 - 14:00", event: "Disponible", type: "available" }, | |
| { time: "14:00 - 15:30", event: "Disponible", type: "available" }, | |
| { time: "15:30 - 18:30", event: "Disponible", type: "available" }, | |
| { time: "18:30 - 21:00", event: "Disponible", type: "available" } | |
| ] | |
| } | |
| }, | |
| cafeteria: { | |
| name: "Cafétéria", | |
| color: "amber", | |
| icon: "fa-utensils", | |
| schedule: { | |
| lundi: [ | |
| { time: "9:00 - 10:30", event: "Ouverte", type: "available" }, | |
| { time: "10:30 - 14:00", event: "Service déjeuner (UAPE)", type: "uape-slot" }, | |
| { time: "14:00 - 15:30", event: "Ouverte", type: "available" }, | |
| { time: "15:30 - 18:30", event: "Ouverte", type: "available" }, | |
| { time: "18:30 - 21:00", event: "Service dîner", type: "available" } | |
| ], | |
| mardi: [ | |
| { time: "9:00 - 10:30", event: "Ouverte", type: "available" }, | |
| { time: "10:30 - 14:00", event: "Service déjeuner (UAPE)", type: "uape-slot" }, | |
| { time: "14:00 - 15:30", event: "Ouverte", type: "available" }, | |
| { time: "15:30 - 18:30", event: "Ouverte", type: "available" }, | |
| { time: "18:30 - 21:00", event: "Service dîner", type: "available" } | |
| ], | |
| mercredi: [ | |
| { time: "9:00 - 10:30", event: "Ouverte", type: "available" }, | |
| { time: "10:30 - 14:00", event: "Service déjeuner", type: "available" }, | |
| { time: "15:00 - 17:00", event: "Mercredi-famille", type: "special-event" }, | |
| { time: "17:00 - 18:30", event: "Ouverte", type: "available" }, | |
| { time: "18:30 - 21:00", event: "Service dîner", type: "available" } | |
| ], | |
| jeudi: [ | |
| { time: "9:00 - 10:30", event: "Ouverte", type: "available" }, | |
| { time: "10:30 - 14:00", event: "Service déjeuner (UAPE)", type: "uape-slot" }, | |
| { time: "14:00 - 15:30", event: "Ouverte", type: "available" }, | |
| { time: "15:30 - 18:30", event: "Ouverte", type: "available" }, | |
| { time: "18:30 - 21:00", event: "Service dîner", type: "available" } | |
| ], | |
| vendredi: [ | |
| { time: "8:00 - 10:30", event: "Blabla café", type: "special-event" }, | |
| { time: "10:30 - 14:00", event: "Service déjeuner (UAPE)", type: "uape-slot" }, | |
| { time: "14:00 - 15:30", event: "Ouverte", type: "available" }, | |
| { time: "15:30 - 18:30", event: "Ouverte", type: "available" }, | |
| { time: "18:30 - 21:00", event: "Fermée", type: "available" } | |
| ] | |
| } | |
| }, | |
| bibliotheque: { | |
| name: "Bibliothèque", | |
| color: "emerald", | |
| icon: "fa-book", | |
| schedule: { | |
| lundi: [ | |
| { time: "9:00 - 10:30", event: "Ouverte", type: "available" }, | |
| { time: "10:30 - 14:00", event: "Ouverte", type: "available" }, | |
| { time: "14:00 - 15:30", event: "Ouverte", type: "available" }, | |
| { time: "15:30 - 18:30", event: "Ouverte", type: "available" }, | |
| { time: "18:30 - 21:00", event: "Ouverte", type: "available" } | |
| ], | |
| mardi: [ | |
| { time: "9:00 - 10:30", event: "Ouverte", type: "available" }, | |
| { time: "10:30 - 14:00", event: "Ouverte", type: "available" }, | |
| { time: "14:00 - 15:30", event: "Ouverte", type: "available" }, | |
| { time: "15:30 - 18:30", event: "Ouverte", type: "available" }, | |
| { time: "18:30 - 21:00", event: "Ouverte", type: "available" } | |
| ], | |
| mercredi: [ | |
| { time: "9:00 - 10:30", event: "Ouverte", type: "available" }, | |
| { time: "10:30 - 14:00", event: "Ouverte", type: "available" }, | |
| { time: "14:00 - 15:30", event: "Ouverte", type: "available" }, | |
| { time: "15:30 - 18:30", event: "Ouverte", type: "available" }, | |
| { time: "18:30 - 21:00", event: "Ouverte", type: "available" } | |
| ], | |
| jeudi: [ | |
| { time: "9:00 - 10:30", event: "Ouverte", type: "available" }, | |
| { time: "10:30 - 14:00", event: "Ouverte", type: "available" }, | |
| { time: "14:00 - 15:30", event: "Ouverte", type: "available" }, | |
| { time: "15:30 - 18:30", event: "Ouverte", type: "available" }, | |
| { time: "18:30 - 21:00", event: "Ouverte", type: "available" } | |
| ], | |
| vendredi: [ | |
| { time: "8:00 - 10:30", event: "Ouverte", type: "available" }, | |
| { time: "10:30 - 14:00", event: "Ouverte", type: "available" }, | |
| { time: "14:00 - 15:30", event: "Ouverte", type: "available" }, | |
| { time: "15:30 - 18:30", event: "Ouverte", type: "available" }, | |
| { time: "18:30 - 21:00", event: "Fermée", type: "available" } | |
| ] | |
| } | |
| } | |
| }; | |
| // Générer les cartes de salle | |
| function generateRoomCards() { | |
| const container = document.getElementById('rooms-container'); | |
| container.innerHTML = ''; | |
| for (const roomId in roomsData) { | |
| const room = roomsData[roomId]; | |
| let cardHTML = ` | |
| <div class="room-card bg-white rounded-lg shadow-md overflow-hidden"> | |
| <div class="bg-${room.color}-600 p-4 text-white"> | |
| <h2 class="text-xl font-semibold flex items-center"> | |
| <i class="fas ${room.icon} mr-2"></i> ${room.name} | |
| </h2> | |
| </div> | |
| <div class="p-4"> | |
| `; | |
| for (const day in room.schedule) { | |
| const isActive = day === 'lundi' ? '' : 'hidden'; | |
| cardHTML += `<div id="${day}-${roomId}" class="day-schedule ${isActive}">`; | |
| cardHTML += `<h3 class="font-medium text-gray-700 mb-2">${day.charAt(0).toUpperCase() + day.slice(1)}</h3>`; | |
| room.schedule[day].forEach(slot => { | |
| let niveauText = slot.niveau ? ` (${slot.niveau.toUpperCase()})` : ''; | |
| cardHTML += ` | |
| <div class="time-slot ${slot.type} mb-2 p-2 rounded"> | |
| <span class="font-medium">${slot.time}</span>: ${slot.event}${niveauText} | |
| </div> | |
| `; | |
| }); | |
| cardHTML += `</div>`; | |
| } | |
| cardHTML += ` | |
| </div> | |
| <div class="px-4 py-3 bg-gray-50 text-right"> | |
| <button onclick="openModal('${roomId}')" class="text-${room.color}-600 hover:text-${room.color}-800 font-medium">Réserver</button> | |
| </div> | |
| </div> | |
| `; | |
| container.innerHTML += cardHTML; | |
| } | |
| // Ajouter le résumé hebdomadaire | |
| container.innerHTML += ` | |
| <div class="room-card bg-white rounded-lg shadow-md overflow-hidden col-span-1 md:col-span-2 lg:col-span-1"> | |
| <div class="bg-purple-600 p-4 text-white"> | |
| <h2 class="text-xl font-semibold flex items-center"> | |
| <i class="fas fa-calendar-alt mr-2"></i> Résumé Hebdomadaire | |
| </h2> | |
| </div> | |
| <div class="p-4"> | |
| <div class="mb-4"> | |
| <h3 class="font-medium text-gray-700 mb-2">Événements Spéciaux</h3> | |
| <ul class="space-y-2"> | |
| <li class="flex items-start"> | |
| <span class="inline-block bg-indigo-100 text-indigo-800 text-xs px-2 py-1 rounded-full mr-2">Mercredi</span> | |
| <span>15:00 - 17:00: Mercredi-famille à la cafétéria</span> | |
| </li> | |
| <li class="flex items-start"> | |
| <span class="inline-block bg-indigo-100 text-indigo-800 text-xs px-2 py-1 rounded-full mr-2">Vendredi</span> | |
| <span>8:00 - 10:30: Blabla café à la cafétéria</span> | |
| </li> | |
| </ul> | |
| </div> | |
| <div> | |
| <h3 class="font-medium text-gray-700 mb-2">Disponibilités Générales</h3> | |
| <ul class="space-y-2"> | |
| <li class="flex items-center"> | |
| <i class="fas fa-check-circle text-green-500 mr-2"></i> | |
| <span>Bibliothèque ouverte tous les jours sauf vendredi soir</span> | |
| </li> | |
| <li class="flex items-center"> | |
| <i class="fas fa-check-circle text-green-500 mr-2"></i> | |
| <span>Cafétéria ouverte tous les jours sauf vendredi soir</span> | |
| </li> | |
| <li class="flex items-center"> | |
| <i class="fas fa-info-circle text-blue-500 mr-2"></i> | |
| <span>Pas de cours le mercredi après-midi</span> | |
| </li> | |
| <li class="flex items-center"> | |
| <i class="fas fa-utensils text-amber-500 mr-2"></i> | |
| <span>UAPE utilise la cafétéria pour les repas (Lun, Mar, Jeu, Ven)</span> | |
| </li> | |
| </ul> | |
| </div> | |
| </div> | |
| <div class="px-4 py-3 bg-gray-50 text-right"> | |
| <button onclick="exportPlanning()" class="text-purple-600 hover:text-purple-800 font-medium">Exporter le planning</button> | |
| </div> | |
| </div> | |
| `; | |
| } | |
| // Afficher le jour sélectionné | |
| function showDay(day) { | |
| // Mettre à jour les onglets | |
| document.querySelectorAll('.day-tab').forEach(tab => { | |
| tab.classList.remove('bg-indigo-100', 'text-indigo-700'); | |
| }); | |
| event.target.classList.add('bg-indigo-100', 'text-indigo-700'); | |
| // Afficher le planning correspondant au jour sélectionné pour chaque salle | |
| document.querySelectorAll('.day-schedule').forEach(schedule => { | |
| schedule.classList.add('hidden'); | |
| }); | |
| // Afficher les plannings du jour sélectionné | |
| for (const roomId in roomsData) { | |
| document.getElementById(`${day}-${roomId}`).classList.remove('hidden'); | |
| } | |
| } | |
| // Gestion de la modal de réservation | |
| let currentRoomId = null; | |
| function openModal(roomId) { | |
| currentRoomId = roomId; | |
| document.getElementById('reservation-modal').classList.remove('hidden'); | |
| document.getElementById('room').value = roomId; | |
| } | |
| function closeModal() { | |
| document.getElementById('reservation-modal').classList.add('hidden'); | |
| document.getElementById('reservation-form').reset(); | |
| currentRoomId = null; | |
| } | |
| function submitReservation(event) { | |
| event.preventDefault(); | |
| const roomId = document.getElementById('room').value; | |
| const day = document.getElementById('day').value; | |
| const startTime = document.getElementById('start-time').value; | |
| const endTime = document.getElementById('end-time').value; | |
| const eventName = document.getElementById('event').value; | |
| const niveau = document.getElementById('niveau').value; | |
| // Formatage de l'heure pour l'affichage | |
| const formattedStart = formatTime(startTime); | |
| const formattedEnd = formatTime(endTime); | |
| const timeSlot = `${formattedStart} - ${formattedEnd}`; | |
| // Création du nouveau créneau | |
| const newSlot = { | |
| time: timeSlot, | |
| event: eventName, | |
| type: "occupied" | |
| }; | |
| if (niveau) { | |
| newSlot.niveau = niveau; | |
| } | |
| // Ajout du créneau dans les données | |
| roomsData[roomId].schedule[day].push(newSlot); | |
| // Tri des créneaux par heure de début | |
| roomsData[roomId].schedule[day].sort((a, b) => { | |
| return a.time.split(' - ')[0].localeCompare(b.time.split(' - ')[0]); | |
| }); | |
| // Regénération des cartes | |
| generateRoomCards(); | |
| // Réafficher le jour actuel | |
| showDay(day); | |
| alert('Réservation confirmée!'); | |
| closeModal(); | |
| } | |
| function formatTime(timeString) { | |
| const [hours, minutes] = timeString.split(':'); | |
| return `${hours}:${minutes}`; | |
| } | |
| function exportPlanning() { | |
| alert('Export du planning en cours... (fonctionnalité à implémenter)'); | |
| } | |
| // Initialisation | |
| document.addEventListener('DOMContentLoaded', function() { | |
| generateRoomCards(); | |
| // Activer l'onglet du lundi par défaut | |
| document.querySelector('.day-tab').click(); | |
| // Gestion du formulaire | |
| document.getElementById('reservation-form').addEventListener('submit', submitReservation); | |
| }); | |
| </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=masterseb/mdm" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p><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=Masterseb/mdm" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |