Spaces:
Running

evaluteo-3 / index.html
LoicUX's picture
au clic sur le champs de recherche, ouvrir une pop up de recherche qui aura toutes les fonctionnalités précédemment décvrite (auto complétion, suggestions pertinentes, etc) - Follow Up Deployment
09b8537 verified
Raw History Blame Contribute Delete
60.8 kB
<!DOCTYPE html> <html lang="fr"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Tableau de gestion des risques</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> /* Responsive table styles */ @media (max-width: 767px) { table { display: block; width: 100%; } thead { display: none; } tbody { display: block; width: 100%; } tr { display: block; margin-bottom: 1rem; border: 1px solid #e5e7eb; border-radius: 0.75rem; padding: 1.25rem; background-color: white; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); } td { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 0; border: none; border-bottom: 1px solid #f3f4f6; } td { padding: 0.75rem 0; border-bottom: 1px solid #f3f4f6; } td:before { content: attr(data-label); font-weight: 600; color: #4b5563; margin-right: 1rem; flex: 1; font-size: 0.875rem; } td > * { flex: 2; text-align: right; font-size: 0.875rem; } } /* Search styles */ #searchResults { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); } #searchResultsContent::-webkit-scrollbar, #searchSuggestions::-webkit-scrollbar { width: 6px; } #searchResultsContent::-webkit-scrollbar-thumb, #searchSuggestions::-webkit-scrollbar-thumb { background-color: rgba(0, 0, 0, 0.2); border-radius: 3px; } /* Custom scrollbar */ ::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-track { background: #f1f1f1; } ::-webkit-scrollbar-thumb { background: #888; border-radius: 4px; } ::-webkit-scrollbar-thumb:hover { background: #555; } /* Slide panel animation */ .slide-panel { transition: transform 0.3s ease-in-out; } .slide-panel.hidden { transform: translateX(100%); } /* Highlight clicked row */ tr.active { background-color: #ebf8ff; } /* Modal animation */ .modal-enter { opacity: 0; } .modal-enter-active { opacity: 1; transition: opacity 200ms; } .modal-exit { opacity: 1; } .modal-exit-active { opacity: 0; transition: opacity 200ms; } </style> </head> <body class="bg-gray-50 font-sans"> <!-- Header --> <header class="sticky top-0 z-50 bg-white shadow-md"> <div class="container mx-auto px-4 py-3 flex items-center justify-between"> <div class="flex items-center space-x-4"> <div class="text-blue-600 font-bold text-xl">Evaluteo</div> <nav class="hidden md:flex space-x-6"> <a href="#" class="text-gray-700 hover:text-blue-600">Tableau de bord</a> <a href="#" class="text-gray-700 hover:text-blue-600">Risques</a> <a href="#" class="text-gray-700 hover:text-blue-600">Rapports</a> <a href="#" class="text-gray-700 hover:text-blue-600">Paramètres</a> </nav> </div> <div class="flex items-center space-x-4"> <div class="relative w-96"> <div class="flex items-center"> <input type="text" id="globalSearch" placeholder="Rechercher des clients, des risques, des tâches, etc." class="pl-10 pr-4 py-2 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent w-full" autocomplete="off" onclick="openSearchPopup()" readonly> <i class="fas fa-search absolute left-3 text-gray-400"></i> <button id="clearSearch" class="absolute right-10 text-gray-400 hover:text-gray-600 hidden" onclick="clearSearch()"> <i class="fas fa-times"></i> </button> </div> <div id="searchResults" class="absolute z-50 mt-1 w-full bg-white shadow-lg rounded-md border border-gray-200 hidden"> <div class="max-h-96 overflow-y-auto"> <div class="p-3 border-b border-gray-200"> <h3 class="font-medium text-gray-700">Suggestions</h3> <div id="searchSuggestions" class="mt-2 space-y-1"> <!-- Suggestions will be populated here --> </div> </div> <div id="searchResultsContent" class="p-2"> <!-- Results will be populated here --> </div> <div id="noResults" class="p-4 text-center text-gray-500 hidden"> <p>Aucun résultat trouvé pour "<span id="searchTerm"></span>"</p> <p class="text-sm mt-1">Essayez avec une orthographe différente ou des termes similaires.</p> <div id="alternativeSuggestions" class="mt-2"></div> </div> </div> </div> </div> <div class="flex items-center space-x-2"> <div class="w-8 h-8 rounded-full bg-blue-500 flex items-center justify-center text-white font-bold">JD</div> <span class="hidden md:inline text-sm font-medium">John Doe</span> </div> </div> </div> </header> <!-- Main Content --> <main class="container mx-auto px-4 py-6"> <!-- Breadcrumb --> <nav class="flex mb-6" aria-label="Breadcrumb"> <ol class="inline-flex items-center space-x-1 md:space-x-3"> <li class="inline-flex items-center"> <a href="#" class="inline-flex items-center text-sm font-medium text-gray-700 hover:text-blue-600"> <i class="fas fa-home mr-2"></i> Accueil </a> </li> <li> <div class="flex items-center"> <i class="fas fa-chevron-right text-gray-400 mx-2"></i> <a href="#" class="ml-1 text-sm font-medium text-gray-700 hover:text-blue-600 md:ml-2">Gestion des risques</a> </div> </li> <li aria-current="page"> <div class="flex items-center"> <i class="fas fa-chevron-right text-gray-400 mx-2"></i> <span class="ml-1 text-sm font-medium text-blue-600 md:ml-2">Tableau des risques</span> </div> </li> </ol> </nav> <!-- Filters and Actions --> <div class="bg-white p-4 rounded-lg shadow mb-6"> <div class="flex flex-col md:flex-row md:items-center md:justify-between"> <div class="mb-4 md:mb-0"> <h1 class="text-xl font-bold text-gray-800">Tableau des risques</h1> <p class="text-sm text-gray-600">Gérez et suivez l'évolution des risques identifiés</p> </div> <div class="flex space-x-2"> <button class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500"> <i class="fas fa-plus mr-2"></i> Ajouter un risque </button> <button class="px-4 py-2 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500" onclick="document.getElementById('filtersModal').classList.remove('hidden')"> <i class="fas fa-filter mr-2"></i> Filtres </button> <button class="px-4 py-2 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500"> <i class="fas fa-download mr-2"></i> Exporter </button> </div> </div> </div> <!-- Contextual Actions --> <div class="flex justify-end items-center mb-4"> <div id="contextualActions" class="hidden items-center space-x-4"> <span id="selectedCount" class="font-medium">0 sélectionnés</span> <div class="flex space-x-2"> <button class="px-3 py-1 bg-blue-600 text-white rounded hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500"> <i class="fas fa-edit mr-1"></i> Modifier </button> <button class="px-3 py-1 bg-white border border-gray-300 rounded hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500"> <i class="fas fa-archive mr-1"></i> Archiver </button> <button class="px-3 py-1 bg-white border border-gray-300 rounded hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500"> <i class="fas fa-trash-alt mr-1"></i> Supprimer </button> </div> </div> </div> <!-- Table --> <div class="bg-white rounded-lg shadow overflow-hidden"> <div class="overflow-x-auto"> <table class="min-w-full divide-y divide-gray-200"> <thead class="bg-gray-50"> <tr> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> <input type="checkbox" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded" onclick="toggleAllCheckboxes(this)"> </th> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100"> <div class="flex items-center"> Tâche <i class="fas fa-sort ml-2 text-gray-400"></i> </div> </th> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100"> <div class="flex items-center"> Danger <i class="fas fa-sort ml-2 text-gray-400"></i> </div> </th> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100"> <div class="flex items-center"> Situation <i class="fas fa-sort ml-2 text-gray-400"></i> </div> </th> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100"> <div class="flex items-center"> Risque <i class="fas fa-sort ml-2 text-gray-400"></i> </div> </th> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100"> <div class="flex items-center"> Cotation brute <i class="fas fa-sort ml-2 text-gray-400"></i> </div> </th> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100"> <div class="flex items-center"> Mesure <i class="fas fa-sort ml-2 text-gray-400"></i> </div> </th> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100"> <div class="flex items-center"> Cotation réelle <i class="fas fa-sort ml-2 text-gray-400"></i> </div> </th> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100"> <div class="flex items-center"> Action <i class="fas fa-sort ml-2 text-gray-400"></i> </div> </th> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100"> <div class="flex items-center"> Statut <i class="fas fa-sort ml-2 text-gray-400"></i> </div> </th> </tr> </thead> <tbody class="bg-white divide-y divide-gray-200"> <!-- Sample rows - in a real app these would come from a database --> <tr class="hover:bg-gray-50 cursor-pointer" onclick="openPanel(1)"> <td class="px-6 py-4 whitespace-nowrap" data-label="Sélection" onclick="event.stopPropagation()"> <input type="checkbox" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded" onchange="updateContextualActions()"> </td> <td class="px-6 py-4 whitespace-nowrap" data-label="Tâche"> <div class="text-sm font-medium text-gray-900">Manipulation de produits chimiques</div> </td> <td class="px-6 py-4 whitespace-nowrap" data-label="Danger"> <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800">Élevé</span> </td> <td class="px-6 py-4 whitespace-nowrap" data-label="Situation"> <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-yellow-100 text-yellow-800">À surveiller</span> </td> <td class="px-6 py-4 whitespace-nowrap" data-label="Risque"> <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800">Inacceptable</span> </td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500" data-label="Cotation brute">8</td> <td class="px-6 py-4 whitespace-nowrap" data-label="Mesure"> <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-blue-100 text-blue-800">Préventive</span> </td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500" data-label="Cotation réelle">4</td> <td class="px-6 py-4 whitespace-nowrap" data-label="Action"> <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-orange-100 text-orange-800">En cours</span> </td> <td class="px-6 py-4 whitespace-nowrap" data-label="Statut"> <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Actif</span> </td> </tr> <tr class="hover:bg-gray-50"> <td class="px-6 py-4 whitespace-nowrap" data-label="Sélection"> <input type="checkbox" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded" onchange="updateContextualActions()"> </td> <td class="px-6 py-4 whitespace-nowrap cursor-pointer" onclick="openPanel(2)"> <div class="text-sm font-medium text-gray-900">Travail en hauteur</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-orange-100 text-orange-800">Moyen</span> </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">Sous contrôle</span> </td> <td class="px-6 py-4 whitespace-nowrap"> <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-orange-100 text-orange-800">Acceptable</span> </td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">6</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">Corrective</span> </td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">3</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">À faire</span> </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> </tr> <tr class="hover:bg-gray-50"> <td class="px-6 py-4 whitespace-nowrap"> <input type="checkbox" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded" onchange="updateContextualActions()"> </td> <td class="px-6 py-4 whitespace-nowrap cursor-pointer" onclick="openPanel(3)"> <div class="text-sm font-medium text-gray-900">Exposition au bruit</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-yellow-100 text-yellow-800">Faible</span> </td> <td class="px-6 py-4 whitespace-nowrap"> <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800">Urgent</span> </td> <td class="px-6 py-4 whitespace-nowrap"> <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800">Inacceptable</span> </td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">7</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">Préventive</span> </td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">5</td> <td class="px-6 py-4 whitespace-nowrap"> <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-orange-100 text-orange-800">En cours</span> </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> </tr> <tr class="hover:bg-gray-50"> <td class="px-6 py-4 whitespace-nowrap"> <input type="checkbox" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded" onchange="updateContextualActions()"> </td> <td class="px-6 py-4 whitespace-nowrap cursor-pointer" onclick="openPanel(4)"> <div class="text-sm font-medium text-gray-900">Manutention de charges</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-orange-100 text-orange-800">Moyen</span> </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">Sous contrôle</span> </td> <td class="px-6 py-4 whitespace-nowrap"> <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-orange-100 text-orange-800">Acceptable</span> </td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">5</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">Corrective</span> </td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2</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">Terminé</span> </td> <td class="px-6 py-4 whitespace-nowrap"> <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100 text-gray-800">Archivé</span> </td> </tr> <tr class="hover:bg-gray-50"> <td class="px-6 py-4 whitespace-nowrap"> <input type="checkbox" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded" onchange="updateContextualActions()"> </td> <td class="px-6 py-4 whitespace-nowrap cursor-pointer" onclick="openPanel(5)"> <div class="text-sm font-medium text-gray-900">Exposition aux agents biologiques</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-red-100 text-red-800">Élevé</span> </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">À surveiller</span> </td> <td class="px-6 py-4 whitespace-nowrap"> <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800">Inacceptable</span> </td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">9</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">Préventive</span> </td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">6</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">À faire</span> </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> </tr> </tbody> </table> </div> <!-- Pagination --> <div class="bg-white px-4 py-3 flex items-center justify-between border-t border-gray-200 sm:px-6"> <div class="flex-1 flex justify-between sm:hidden"> <a href="#" class="relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50">Précédent</a> <a href="#" class="ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50">Suivant</a> </div> <div class="hidden sm:flex-1 sm:flex sm:items-center sm:justify-between"> <div> <p class="text-sm text-gray-700"> Affichage de <span class="font-medium">1</span> à <span class="font-medium">30</span> sur <span class="font-medium">30</span> résultats </p> </div> <div> <nav class="relative z-0 inline-flex rounded-md shadow-sm -space-x-px" aria-label="Pagination"> <a href="#" class="relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50"> <span class="sr-only">Précédent</span> <i class="fas fa-chevron-left"></i> </a> <a href="#" aria-current="page" class="z-10 bg-blue-50 border-blue-500 text-blue-600 relative inline-flex items-center px-4 py-2 border text-sm font-medium">1</a> <a href="#" class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium">2</a> <a href="#" class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium">3</a> <a href="#" class="relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50"> <span class="sr-only">Suivant</span> <i class="fas fa-chevron-right"></i> </a> </nav> </div> </div> </div> </div> </main> <!-- Search Popup Modal --> <div id="searchModal" class="hidden fixed inset-0 z-50 overflow-y-auto"> <div class="flex items-center justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0"> <!-- Background overlay --> <div class="fixed inset-0 transition-opacity" aria-hidden="true" onclick="closeSearchPopup()"> <div class="absolute inset-0 bg-gray-500 opacity-75"></div> </div> <!-- Modal content --> <div class="inline-block align-bottom bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-2xl sm:w-full sm:p-6"> <div> <div class="flex justify-between items-center mb-4"> <h3 class="text-lg font-medium text-gray-900">Recherche avancée</h3> <button type="button" class="text-gray-400 hover:text-gray-500" onclick="closeSearchPopup()"> <i class="fas fa-times"></i> </button> </div> <div class="relative"> <input type="text" id="searchModalInput" placeholder="Rechercher des clients, des risques, des tâches, etc." class="pl-10 pr-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent w-full" autocomplete="off" oninput="showSearchResults(this.value)"> <i class="fas fa-search absolute left-3 top-3.5 text-gray-400"></i> <button id="clearSearchModal" class="absolute right-10 top-3.5 text-gray-400 hover:text-gray-600 hidden" onclick="clearSearchModal()"> <i class="fas fa-times"></i> </button> </div> <div id="searchResultsModal" class="mt-4 bg-white shadow-lg rounded-md border border-gray-200"> <div class="max-h-96 overflow-y-auto"> <div class="p-3 border-b border-gray-200"> <h3 class="font-medium text-gray-700">Suggestions</h3> <div id="searchSuggestionsModal" class="mt-2 space-y-1"> <!-- Suggestions will be populated here --> </div> </div> <div id="searchResultsContentModal" class="p-2"> <!-- Results will be populated here --> </div> <div id="noResultsModal" class="p-4 text-center text-gray-500 hidden"> <p>Aucun résultat trouvé pour "<span id="searchTermModal"></span>"</p> <p class="text-sm mt-1">Essayez avec une orthographe différente ou des termes similaires.</p> <div id="alternativeSuggestionsModal" class="mt-2"></div> </div> </div> </div> </div> </div> </div> </div> <!-- Filters Modal (Mobile) --> <div id="filtersModal" class="hidden fixed inset-0 z-50 overflow-y-auto"> <div class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0"> <!-- Background overlay --> <div class="fixed inset-0 transition-opacity" aria-hidden="true" onclick="document.getElementById('filtersModal').classList.add('hidden')"> <div class="absolute inset-0 bg-gray-500 opacity-75"></div> </div> <!-- Modal content --> <div class="inline-block align-bottom bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full sm:p-6"> <div> <div class="flex justify-between items-center mb-4"> <h3 class="text-lg font-medium text-gray-900">Filtrer les risques</h3> <button type="button" class="text-gray-400 hover:text-gray-500" onclick="document.getElementById('filtersModal').classList.add('hidden')"> <i class="fas fa-times"></i> </button> </div> <div class="grid grid-cols-1 gap-4"> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Tâche</label> <input type="text" placeholder="Rechercher une tâche..." class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Danger</label> <select class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"> <option>Tous</option> <option>Élevé</option> <option>Moyen</option> <option>Faible</option> </select> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Situation</label> <select class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"> <option>Tous</option> <option>Urgent</option> <option>À surveiller</option> <option>Sous contrôle</option> </select> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Risque</label> <select class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"> <option>Tous</option> <option>Inacceptable</option> <option>Acceptable</option> </select> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Statut</label> <select class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"> <option>Tous</option> <option>Actif</option> <option>Archivé</option> </select> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Action</label> <select class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"> <option>Tous</option> <option>À faire</option> <option>En cours</option> <option>Terminé</option> </select> </div> </div> </div> <div class="mt-5 sm:mt-6 grid grid-cols-2 gap-3"> <button type="button" onclick="resetFilters()" class="w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:text-sm"> Réinitialiser </button> <button type="button" onclick="applyFilters()" class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:text-sm"> Appliquer </button> </div> </div> </div> </div> <!-- Slide Panel Overlay --> <div id="slidePanelOverlay" class="fixed inset-0 bg-black bg-opacity-50 z-40 hidden"></div> <!-- Slide Panel --> <div id="slidePanel" class="fixed inset-y-0 right-0 w-full max-w-md bg-white shadow-xl slide-panel hidden z-50 flex flex-col"> <!-- Sticky Header with date/time --> <div class="sticky top-0 bg-white p-6 border-b border-gray-200 z-10"> <div class="flex justify-between items-center"> <div> <h2 class="text-xl font-bold text-gray-800">Modifier le risque</h2> <p class="text-xs text-gray-500 mt-1">Dernière modification: <span id="lastModified">01/01/2023 à 14:30</span></p> </div> <button onclick="closePanel()" class="text-gray-400 hover:text-gray-500"> <i class="fas fa-times text-xl"></i> </button> </div> </div> <!-- Scrollable Content --> <div class="flex-1 overflow-y-auto p-6"> <div class="space-y-6"> <!-- Task Section --> <div class="border-b border-gray-200 pb-6"> <h3 class="text-lg font-medium text-gray-900 mb-4">Tâche</h3> <div class="space-y-4"> <div> <label for="description" class="block text-sm font-medium text-gray-700 mb-1">Description</label> <textarea id="description" rows="3" class="shadow-sm focus:ring-blue-500 focus:border-blue-500 block w-full sm:text-sm border border-gray-300 rounded-md p-2">Manipulation de produits chimiques</textarea> </div> <div> <label for="comment" class="block text-sm font-medium text-gray-700 mb-1">Commentaire</label> <textarea id="comment" rows="3" class="shadow-sm focus:ring-blue-500 focus:border-blue-500 block w-full sm:text-sm border border-gray-300 rounded-md p-2">Nécessite une formation spécifique et des EPI adaptés</textarea> </div> </div> </div> <!-- Danger Section --> <div class="border-b border-gray-200 pb-6"> <h3 class="text-lg font-medium text-gray-900 mb-4">Danger</h3> <div class="space-y-4"> <div> <label for="biologique" class="block text-sm font-medium text-gray-700 mb-1">Biologique</label> <select id="biologique" class="mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm rounded-md"> <option>Aucun</option> <option selected>Bactéries</option> <option>Virus</option> <option>Parasites</option> <option>Champignons</option> </select> </div> <div> <label for="chimique" class="block text-sm font-medium text-gray-700 mb-1">Chimique</label> <select id="chimique" class="mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm rounded-md"> <option>Aucun</option> <option selected>Produits corrosifs</option> <option>Toxiques</option> <option>Inflammables</option> <option>Explosifs</option> </select> </div> <div> <label for="deplacement" class="block text-sm font-medium text-gray-700 mb-1">Déplacement</label> <select id="deplacement" class="mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm rounded-md"> <option>Aucun</option> <option>Chutes de plain-pied</option> <option selected>Chutes de hauteur</option> <option>Circulation véhicules</option> </select> </div> <div> <label for="ambiance" class="block text-sm font-medium text-gray-700 mb-1">Ambiance de travail</label> <select id="ambiance" class="mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm rounded-md"> <option>Aucun</option> <option>Bruit</option> <option>Température</option> <option selected>Éclairage</option> <option>Vibration</option> </select> </div> </div> </div> <!-- Other fields would go here --> <!-- Sticky footer buttons --> <div class="sticky bottom-0 bg-white p-4 border-t border-gray-200 z-10"> <div class="flex justify-end space-x-3"> <button type="button" onclick="closePanel()" class="inline-flex items-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"> Fermer </button> <button type="button" class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"> Enregistrer </button> </div> </div> </div> </div> </div> <script> // Search popup functionality function openSearchPopup() { document.getElementById('searchModal').classList.remove('hidden'); document.getElementById('searchModalInput').focus(); document.body.style.overflow = 'hidden'; } function closeSearchPopup() { document.getElementById('searchModal').classList.add('hidden'); document.body.style.overflow = ''; } function clearSearchModal() { document.getElementById('searchModalInput').value = ''; document.getElementById('searchResultsModal').classList.add('hidden'); document.getElementById('clearSearchModal').classList.add('hidden'); } // Search functionality let searchHistory = JSON.parse(localStorage.getItem('searchHistory')) || []; const popularTerms = ['Risque chimique', 'Travail en hauteur', 'Manutention', 'EPI', 'Formation sécurité']; function showSearchResults(query) { const searchResults = document.getElementById('searchResults'); const searchResultsModal = document.getElementById('searchResultsModal'); const clearBtn = document.getElementById('clearSearch'); const clearModalBtn = document.getElementById('clearSearchModal'); if (query.length > 0) { if (clearBtn) clearBtn.classList.remove('hidden'); if (clearModalBtn) clearModalBtn.classList.remove('hidden'); if (searchResults) searchResults.classList.remove('hidden'); if (searchResultsModal) searchResultsModal.classList.remove('hidden'); updateSearchSuggestions(query); displaySearchResults(query); } else { if (clearBtn) clearBtn.classList.add('hidden'); if (clearModalBtn) clearModalBtn.classList.add('hidden'); if (searchResults) searchResults.classList.add('hidden'); if (searchResultsModal) searchResultsModal.classList.add('hidden'); } } function updateSearchSuggestions(query) { const suggestionsContainer = document.getElementById('searchSuggestions'); suggestionsContainer.innerHTML = ''; // Show history suggestions const historyMatches = searchHistory.filter(term => term.toLowerCase().includes(query.toLowerCase()) ).slice(0, 3); if (historyMatches.length > 0) { historyMatches.forEach(term => { suggestionsContainer.innerHTML += ` <div class="flex items-center px-2 py-1 hover:bg-gray-100 rounded cursor-pointer" onclick="fillSearch('${term}')"> <i class="fas fa-history text-gray-400 mr-2"></i> <span>${term}</span> </div> `; }); } // Show popular suggestions const popularMatches = popularTerms.filter(term => term.toLowerCase().includes(query.toLowerCase()) && !historyMatches.includes(term) ).slice(0, 3); if (popularMatches.length > 0) { popularMatches.forEach(term => { suggestionsContainer.innerHTML += ` <div class="flex items-center px-2 py-1 hover:bg-gray-100 rounded cursor-pointer" onclick="fillSearch('${term}')"> <i class="fas fa-fire text-orange-400 mr-2"></i> <span>${term}</span> </div> `; }); } } function displaySearchResults(query) { const resultsContainer = document.getElementById('searchResultsContent') || document.getElementById('searchResultsContentModal'); const noResults = document.getElementById('noResults') || document.getElementById('noResultsModal'); const searchTerm = document.getElementById('searchTerm') || document.getElementById('searchTermModal'); // In a real app, this would be an API call const mockResults = { 'risque': [ { title: 'Manipulation produits chimiques', description: 'Risque chimique - Cotation: 8 - Statut: Actif', category: 'Risque', icon: 'exclamation-triangle', color: 'text-red-500' } ], 'tâche': [ { title: 'Nettoyage zone chimique', description: 'Tâche hebdomadaire - Responsable: Jean Dupont', category: 'Tâche', icon: 'tasks', color: 'text-blue-500' } ], 'client': [ { title: 'Client: Laboratoire Pharma', description: 'Contrat actif - 15 sites', category: 'Client', icon: 'building', color: 'text-green-500' } ] }; resultsContainer.innerHTML = ''; searchTerm.textContent = query; // Filter mock results based on query let hasResults = false; Object.keys(mockResults).forEach(category => { const categoryResults = mockResults[category].filter(item => item.title.toLowerCase().includes(query.toLowerCase()) || item.description.toLowerCase().includes(query.toLowerCase()) ); if (categoryResults.length > 0) { hasResults = true; resultsContainer.innerHTML += ` <div class="mb-3"> <h4 class="font-medium text-gray-700 mb-1 flex items-center"> <i class="fas fa-${category === 'risque' ? 'exclamation-triangle' : category === 'tâche' ? 'tasks' : 'building'} ${category === 'risque' ? 'text-red-500' : category === 'tâche' ? 'text-blue-500' : 'text-green-500'} mr-2"></i> ${category.charAt(0).toUpperCase() + category.slice(1)}s (${categoryResults.length}) </h4> <div class="space-y-2"> ${categoryResults.map(item => ` <div class="p-2 hover:bg-gray-50 rounded border border-gray-100 cursor-pointer" onclick="navigateToResult('${item.title}')"> <div class="font-medium">${item.title}</div> <div class="text-sm text-gray-500">${item.description}</div> <div class="flex items-center mt-1"> <span class="text-xs px-2 py-0.5 rounded ${item.color} bg-${item.color.replace('text-', 'bg-')} bg-opacity-10">${item.category}</span> </div> </div> `).join('')} </div> </div> `; } }); if (!hasResults) { noResults.classList.remove('hidden'); resultsContainer.classList.add('hidden'); // Show alternative suggestions const alternatives = document.getElementById('alternativeSuggestions'); alternatives.innerHTML = ''; // Find similar terms const similarTerms = [...popularTerms, ...searchHistory].filter(term => term.toLowerCase() !== query.toLowerCase() && (term.toLowerCase().startsWith(query.toLowerCase()) || term.toLowerCase().includes(query.toLowerCase())) ).slice(0, 3); if (similarTerms.length > 0) { alternatives.innerHTML += '<p class="text-sm">Essayez peut-être :</p>'; similarTerms.forEach(term => { alternatives.innerHTML += ` <span class="inline-block bg-gray-100 rounded-full px-3 py-1 text-sm font-semibold text-gray-700 mr-2 mb-1 cursor-pointer" onclick="fillSearch('${term}')"> ${term} </span> `; }); } } else { noResults.classList.add('hidden'); resultsContainer.classList.remove('hidden'); } } function performSearch() { const query = document.getElementById('globalSearch').value.trim(); if (query.length > 0) { // Add to search history if not already there if (!searchHistory.includes(query)) { searchHistory.unshift(query); if (searchHistory.length > 5) searchHistory.pop(); localStorage.setItem('searchHistory', JSON.stringify(searchHistory)); } // In a real app, this would trigger a full page search console.log('Performing search for:', query); } } function clearSearch() { document.getElementById('globalSearch').value = ''; document.getElementById('searchResults').classList.add('hidden'); document.getElementById('clearSearch').classList.add('hidden'); } function fillSearch(term) { document.getElementById('globalSearch').value = term; showSearchResults(term); } function navigateToResult(result) { // In a real app, this would navigate to the result page console.log('Navigating to:', result); document.getElementById('searchResults').classList.add('hidden'); } // Panel functions function openPanel(id) { // Remove active class from all rows document.querySelectorAll('tr').forEach(row => { row.classList.remove('active'); }); // Add active class to clicked row let target = event.currentTarget.closest('tr'); target.classList.add('active'); // Show overlay and panel document.getElementById('slidePanelOverlay').classList.remove('hidden'); document.getElementById('slidePanel').classList.remove('hidden'); document.getElementById('slidePanel').scrollTop = 0; // Disable scroll on body document.body.style.overflow = 'hidden'; // In a real app, you would load the data for the selected ID here console.log('Opening panel for risk ID:', id); // Update last modified date/time (in a real app this would come from the data) const now = new Date(); const formattedDate = now.toLocaleDateString('fr-FR') + ' à ' + now.toLocaleTimeString('fr-FR', {hour: '2-digit', minute:'2-digit'}); document.getElementById('lastModified').textContent = formattedDate; } function closePanel() { document.getElementById('slidePanelOverlay').classList.add('hidden'); document.getElementById('slidePanel').classList.add('hidden'); document.querySelectorAll('tr').forEach(row => { row.classList.remove('active'); }); // Enable scroll on body document.body.style.overflow = ''; } // Close panel when clicking on overlay document.getElementById('slidePanelOverlay').addEventListener('click', closePanel); // Checkbox and contextual actions functions function toggleAllCheckboxes(source) { const checkboxes = document.querySelectorAll('tbody input[type="checkbox"]'); checkboxes.forEach(checkbox => { checkbox.checked = source.checked; }); updateContextualActions(); } function updateContextualActions() { const checkboxes = document.querySelectorAll('tbody input[type="checkbox"]:checked'); const contextualActions = document.getElementById('contextualActions'); const selectedCount = document.getElementById('selectedCount'); if (checkboxes.length > 0) { contextualActions.classList.remove('hidden'); selectedCount.textContent = `${checkboxes.length} sélectionné${checkboxes.length > 1 ? 's' : ''}`; // On mobile, show floating action button if (window.innerWidth < 768) { contextualActions.classList.add('fixed', 'bottom-4', 'left-4', 'right-4', 'rounded-full', 'shadow-lg', 'bg-blue-50', 'p-4'); contextualActions.classList.remove('flex', 'items-center', 'space-x-4'); } else { contextualActions.classList.remove('fixed', 'bottom-4', 'left-4', 'right-4', 'rounded-full', 'shadow-lg'); contextualActions.classList.add('flex', 'items-center', 'space-x-4'); } } else { contextualActions.classList.add('hidden'); } } // Handle window resize window.addEventListener('resize', function() { updateContextualActions(); }); // Filter functions function applyFilters() { // In a real app, this would filter the table data console.log('Applying filters...'); document.getElementById('filtersModal').classList.add('hidden'); } function resetFilters() { const inputs = document.querySelectorAll('#filtersModal input, #filtersModal select'); inputs.forEach(input => { if (input.tagName === 'SELECT') { input.selectedIndex = 0; } else { input.value = ''; } }); // In a real app, this would reset the table to show all data console.log('Filters reset'); } // Remove the click outside to close functionality </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=LoicUX/evaluteo-3" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> </html>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tableau de gestion des risques</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>
/* Responsive table styles */
@media (max-width: 767px) {
table {
display: block;
width: 100%;
}
thead {
display: none;
}
tbody {
display: block;
width: 100%;
}
tr {
display: block;
margin-bottom: 1rem;
border: 1px solid #e5e7eb;
border-radius: 0.75rem;
padding: 1.25rem;
background-color: white;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
td {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.75rem 0;
border: none;
border-bottom: 1px solid #f3f4f6;
}
td {
padding: 0.75rem 0;
border-bottom: 1px solid #f3f4f6;
}
td:before {
content: attr(data-label);
font-weight: 600;
color: #4b5563;
margin-right: 1rem;
flex: 1;
font-size: 0.875rem;
}
td > * {
flex: 2;
text-align: right;
font-size: 0.875rem;
}
}
/* Search styles */
#searchResults {
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
#searchResultsContent::-webkit-scrollbar,
#searchSuggestions::-webkit-scrollbar {
width: 6px;
}
#searchResultsContent::-webkit-scrollbar-thumb,
#searchSuggestions::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.2);
border-radius: 3px;
}
/* Custom scrollbar */
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-track {
background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
background: #888;
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: #555;
}
/* Slide panel animation */
.slide-panel {
transition: transform 0.3s ease-in-out;
}
.slide-panel.hidden {
transform: translateX(100%);
}
/* Highlight clicked row */
tr.active {