df
This commit is contained in:
parent
29bc1d8676
commit
91d693a802
|
|
@ -978,4 +978,32 @@ body {
|
|||
.breadcrumb-item + .breadcrumb-item::before {
|
||||
display: none !important;
|
||||
content: none !important;
|
||||
}
|
||||
|
||||
/* Styles pour les chevrons de la sidebar */
|
||||
.sidebar-chevron {
|
||||
transition: transform 0.3s ease;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.sidebar-chevron-rotated {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
/* Bootstrap gère déjà l'état 'show' du collapse */
|
||||
.collapse.show + .sidebar-chevron-rotated,
|
||||
[aria-expanded="true"] .sidebar-chevron {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
/* Correction pour l'affichage des icônes */
|
||||
.icon-wrapper {
|
||||
min-width: 36px;
|
||||
min-height: 36px;
|
||||
flex-shrink: 0; /* Empêche le rétrécissement */
|
||||
}
|
||||
|
||||
.icon-wrapper i {
|
||||
font-size: 1rem;
|
||||
line-height: 1;
|
||||
}
|
||||
|
|
@ -285,24 +285,16 @@ $retourVue = $infovue['lienRetour'];
|
|||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
console.log("=== GABARIT INITIALISATION ===");
|
||||
console.log("jQuery version:", $.fn.jquery);
|
||||
console.log("Bootstrap Select disponible:", typeof $.fn.selectpicker !== 'undefined');
|
||||
console.log("Select2 disponible:", typeof $.fn.select2 !== 'undefined');
|
||||
console.log("Toastr disponible:", typeof toastr !== 'undefined');
|
||||
|
||||
|
||||
// 1. Initialiser Bootstrap Select IMMÉDIATEMENT
|
||||
if (typeof $.fn.selectpicker !== 'undefined') {
|
||||
try {
|
||||
$('.selectpicker').selectpicker();
|
||||
console.log("✅ Bootstrap Select initialisé avec succès");
|
||||
console.log(" Nombre de .selectpicker trouvés:", $('.selectpicker').length);
|
||||
} catch (error) {
|
||||
console.error("❌ Erreur Bootstrap Select:", error);
|
||||
}
|
||||
} else {
|
||||
console.warn("⚠️ Bootstrap Select non disponible");
|
||||
// Fallback: utiliser Select2
|
||||
// Fallback: utiliser Select2
|
||||
if (typeof $.fn.select2 !== 'undefined') {
|
||||
$('.selectpicker').each(function() {
|
||||
if (!$(this).hasClass('select2-hidden-accessible')) {
|
||||
|
|
@ -312,7 +304,7 @@ $retourVue = $infovue['lienRetour'];
|
|||
}).addClass('selectpicker-fallback');
|
||||
}
|
||||
});
|
||||
console.log("✅ Fallback Select2 appliqué aux .selectpicker");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -321,7 +313,6 @@ $retourVue = $infovue['lienRetour'];
|
|||
$('.select2').select2({
|
||||
theme: 'bootstrap-5'
|
||||
});
|
||||
console.log("✅ Select2 initialisé");
|
||||
}
|
||||
|
||||
// 3. Gestion du sidebar
|
||||
|
|
@ -332,23 +323,15 @@ $retourVue = $infovue['lienRetour'];
|
|||
|
||||
// 4. Gestion de la barre de contexte - VERSION SIMPLIFIÉE ET ROBUSTE
|
||||
function initContextPanel() {
|
||||
console.log("Initialisation du panneau de contexte...");
|
||||
|
||||
var $panel = $('#barre_laterale_d');
|
||||
var $showBtn = $('#showSideNav');
|
||||
var $hideBtn = $('#hideSideNav');
|
||||
|
||||
// Vérifier que les éléments existent
|
||||
if (!$panel.length || !$showBtn.length || !$hideBtn.length) {
|
||||
console.error("❌ Éléments du panneau de contexte non trouvés");
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("✅ Éléments trouvés:");
|
||||
console.log(" - Panel:", $panel.length);
|
||||
console.log(" - Bouton show:", $showBtn.length);
|
||||
console.log(" - Bouton hide:", $hideBtn.length);
|
||||
|
||||
// S'assurer que le panel est caché au départ
|
||||
$panel.removeClass('active');
|
||||
$showBtn.show();
|
||||
|
|
@ -372,7 +355,6 @@ $retourVue = $infovue['lienRetour'];
|
|||
$hideBtn.off('click').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
console.log("Bouton hide cliqué");
|
||||
|
||||
$panel.removeClass('active');
|
||||
$showBtn.show();
|
||||
|
|
@ -386,7 +368,6 @@ $retourVue = $infovue['lienRetour'];
|
|||
if ($panel.hasClass('active') &&
|
||||
!$(e.target).closest('#barre_laterale_d').length &&
|
||||
!$(e.target).is('#showSideNav')) {
|
||||
console.log("Clic en dehors du panel");
|
||||
$panel.removeClass('active');
|
||||
$showBtn.show();
|
||||
$('body').removeClass('context-panel-open');
|
||||
|
|
@ -397,8 +378,6 @@ $retourVue = $infovue['lienRetour'];
|
|||
$panel.off('click').on('click', function(e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
console.log("✅ Panneau de contexte initialisé");
|
||||
}
|
||||
|
||||
// Initialiser le panneau de contexte
|
||||
|
|
@ -412,26 +391,6 @@ $retourVue = $infovue['lienRetour'];
|
|||
'cursor': 'pointer'
|
||||
});
|
||||
|
||||
/* Ajouter un bouton de test debug (à enlever en production)
|
||||
if (typeof modeDev !== 'undefined' && modeDev == "1") {
|
||||
$('body').append(
|
||||
'<button id="debugTestPanel" style="position:fixed; bottom:20px; left:20px; z-index:9999; padding:10px; background:red; color:white; border:none; border-radius:5px;">DEBUG: Test Panel</button>'
|
||||
);
|
||||
|
||||
$('#debugTestPanel').on('click', function() {
|
||||
var $panel = $('#barre_laterale_d');
|
||||
if ($panel.hasClass('active')) {
|
||||
$panel.removeClass('active');
|
||||
$('#showSideNav').show();
|
||||
console.log("DEBUG: Panel fermé");
|
||||
} else {
|
||||
$panel.addClass('active');
|
||||
$('#showSideNav').hide();
|
||||
console.log("DEBUG: Panel ouvert");
|
||||
}
|
||||
});
|
||||
}
|
||||
*/
|
||||
// 6. Synchronisation du badge de notifications
|
||||
function syncBadge() {
|
||||
var count = parseInt($("#msgNonLus").val()) || 0;
|
||||
|
|
@ -459,10 +418,7 @@ $retourVue = $infovue['lienRetour'];
|
|||
"timeOut": "5000",
|
||||
"extendedTimeOut": "1000"
|
||||
};
|
||||
console.log("✅ Toastr configuré");
|
||||
}
|
||||
|
||||
console.log("=== GABARIT INITIALISATION TERMINÉE ===");
|
||||
});
|
||||
|
||||
// Fonctions globales pour le panneau de contexte
|
||||
|
|
|
|||
|
|
@ -15,17 +15,21 @@
|
|||
<div class="sidebar-body">
|
||||
<ul class="sidebar-nav list-unstyled" id="sidebar-nav">
|
||||
<?php foreach ($menus as $key0 => $menuParent): ?>
|
||||
<?php $menuChildrenLevelOne = $gabary->get_menus_by_parent_code($menuParent['vue']); ?>
|
||||
<?php
|
||||
$menuChildrenLevelOne = $gabary->get_menus_by_parent_code($menuParent['vue']);
|
||||
$hasChildren = sizeof($menuChildrenLevelOne) > 0;
|
||||
$isActiveParent = strtolower($menuParent['libeleMenu']) == strtolower($activeLevel1);
|
||||
?>
|
||||
|
||||
<?php if (sizeof($menuChildrenLevelOne) > 0): ?>
|
||||
<?php if ($hasChildren): ?>
|
||||
<!-- Menu avec sous-menus -->
|
||||
<li class="nav-item mb-1">
|
||||
<a class="nav-link d-flex align-items-center justify-content-between py-3 px-4
|
||||
<?= strtolower($menuParent['libeleMenu']) == strtolower($activeLevel1) ? 'active-main' : '' ?>"
|
||||
<?= $isActiveParent ? 'active-main' : '' ?>"
|
||||
data-bs-toggle="collapse"
|
||||
href="#menu-<?= $menuParent['codeMenu'] . $key0 ?>"
|
||||
role="button"
|
||||
aria-expanded="<?= strtolower($menuParent['libeleMenu']) == strtolower($activeLevel1) ? 'true' : 'false' ?>"
|
||||
aria-expanded="<?= $isActiveParent ? 'true' : 'false' ?>"
|
||||
aria-controls="menu-<?= $menuParent['codeMenu'] . $key0 ?>">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="icon-wrapper bg-primary bg-opacity-10 rounded-circle d-flex align-items-center justify-content-center me-3"
|
||||
|
|
@ -34,25 +38,26 @@
|
|||
</div>
|
||||
<span class="fw-medium"><?= $menuParent['libeleMenu'] ?></span>
|
||||
</div>
|
||||
<!-- Icône qui change selon l'état ouvert/fermé -->
|
||||
<i class="fas <?= strtolower($menuParent['libeleMenu']) == strtolower($activeLevel1) ? 'fa-chevron-up' : 'fa-chevron-down' ?> transition-transform"></i>
|
||||
<!-- Icône avec rotation CSS pure -->
|
||||
<i class="fas fa-chevron-down sidebar-chevron <?= $isActiveParent ? 'sidebar-chevron-rotated' : '' ?>"></i>
|
||||
</a>
|
||||
|
||||
<div class="collapse <?= strtolower($menuParent['libeleMenu']) == strtolower($activeLevel1) ? 'show' : '' ?>"
|
||||
<div class="collapse <?= $isActiveParent ? 'show' : '' ?>"
|
||||
id="menu-<?= $menuParent['codeMenu'] . $key0 ?>">
|
||||
<ul class="list-unstyled ps-4 py-2 bg-light rounded">
|
||||
<?php foreach ($menuChildrenLevelOne as $key1 => $menuChild): ?>
|
||||
<?php
|
||||
$link_clean = explode('/', $menuChild['lienMenu'])[0];
|
||||
$activeLink = $_SESSION['firstLevelMenu'];
|
||||
$activeLink = $_SESSION['firstLevelMenu'] ?? '';
|
||||
$isActiveChild = $link_clean == $activeLink;
|
||||
?>
|
||||
<li class="mb-1">
|
||||
<a class="nav-link-sub d-flex align-items-center py-2 px-3 rounded
|
||||
<?= $link_clean == $activeLink ? 'active-submenu bg-primary text-white' : 'text-dark' ?>"
|
||||
<?= $isActiveChild ? 'active-submenu bg-primary text-white' : 'text-dark' ?>"
|
||||
href="<?= $menuChild['lienMenu'] ?>">
|
||||
<i class="fas fa-circle me-2" style="font-size: 0.5rem;"></i>
|
||||
<span><?= $menuChild['libeleMenu'] ?></span>
|
||||
<?php if ($link_clean == $activeLink): ?>
|
||||
<?php if ($isActiveChild): ?>
|
||||
<i class="fas fa-arrow-right ms-auto"></i>
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
|
|
@ -65,10 +70,9 @@
|
|||
<!-- Menu sans sous-menus (comme Quitter) -->
|
||||
<li class="nav-item mb-1">
|
||||
<a class="nav-link d-flex align-items-center justify-content-between py-3 px-4
|
||||
<?= strtolower($menuParent['libeleMenu']) == strtolower($activeLevel1) ? 'active-main' : '' ?>"
|
||||
<?= $isActiveParent ? 'active-main' : '' ?>"
|
||||
href="<?= $menuParent['lienMenu'] ?>">
|
||||
<div class="d-flex align-items-center">
|
||||
<!-- Conteneur d'icône identique aux autres menus -->
|
||||
<div class="icon-wrapper bg-primary bg-opacity-10 rounded-circle d-flex align-items-center justify-content-center me-3"
|
||||
style="width: 36px; height: 36px;">
|
||||
<i class="<?= $menuParent['icone'] ?> text-primary"></i>
|
||||
|
|
@ -76,7 +80,7 @@
|
|||
<span class="fw-medium"><?= $menuParent['libeleMenu'] ?></span>
|
||||
</div>
|
||||
<!-- Flèche uniquement si le menu est actif -->
|
||||
<?php if (strtolower($menuParent['libeleMenu']) == strtolower($activeLevel1)): ?>
|
||||
<?php if ($isActiveParent): ?>
|
||||
<i class="fas fa-arrow-right ms-auto text-primary"></i>
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
|
|
@ -95,7 +99,7 @@
|
|||
</button>
|
||||
</div>
|
||||
<div class="mt-3 text-center">
|
||||
<small class="text-muted">v<?= $_SESSION['version_C'] ?? '1.0.4' ?></small>
|
||||
<small class="text-muted">v<?= $_SESSION['version_C'] ?? '1.0.0' ?></small>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user