<nav class="navbar navbar-dark bg-aptimap navbar-expand-lg ">
    <a class="navbar-brand" href="<?php echo e(route('home')); ?>">Apti<span class="font-weight-bold">Map</span></a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>

    <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <?php if(auth()->guard()->check()): ?>
            <!-- Partie gauche de la navbar -->
            <ul class="navbar-nav mr-auto">
                <?php if(Auth::user()->hasRole(ROLE::SUPER_ADMINISTRATEUR)): ?>
                    <li class="nav-item">
                        <a class="nav-link <?php if(Request::is('administration/consolidations*')): ?> active <?php endif; ?>"
                           href="<?php echo e(route('consolidations.index')); ?>">Consolidations</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link <?php if(Request::is('administration/structures*')): ?> active <?php endif; ?>"
                           href="<?php echo e(route('structures.index')); ?>">Structures</a>
                    </li>
                <?php endif; ?>
                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('see_projet')): ?>
                    <li class="nav-item">
                        <a class="nav-link <?php if(Request::is('projets*')): ?> active <?php endif; ?>"
                           href="<?php echo e(route('projets.index')); ?>">Projets</a>
                    </li>
                <?php endif; ?>
                <li class="nav-item <?php if(Request::is('cartographie*')): ?> active <?php endif; ?>">
                    <a class="nav-link" href="<?php echo e(route('cartographie.index')); ?>">Cartographie</a>
                </li>
                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('see_paat')): ?>
                    <li class="nav-item <?php if(Request::is('paats*')): ?> active <?php endif; ?>">
                        <a class="nav-link" href="<?php echo e(route('paats.index')); ?>">PAAT</a>
                    </li>
                <?php endif; ?>
                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('see_utilisateur')): ?>
                    <li class="nav-item">
                        <a class="nav-link <?php if(Request::is('utilisateurs*')): ?> active <?php endif; ?>"
                           href="<?php echo e(route('utilisateurs.index')); ?>">Utilisateurs</a>
                    </li>
                <?php endif; ?>
                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('see_bibliotheque_projets')): ?>
                    <li class="nav-item">
                        <a class="nav-link <?php if(Request::is('bibliotheque_projets*')): ?> active <?php endif; ?>"
                           href="<?php echo e(route('bibliotheque_projets.index')); ?>">Bibliothèque projet</a>
                    </li>
                <?php endif; ?>
                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->any(array('see_parametre', 'see_structure', 'importer_parametre'))): ?>
                    <li class="nav-item dropdown <?php if(Request::is('parametres*')): ?> active <?php endif; ?>">
                        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
                           data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                            Paramètres
                        </a>
                        <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('see_structure')): ?>
                                <a class="dropdown-item" href="<?php echo e(route('structure.index')); ?>">Ma structure</a>
                            <?php endif; ?>
                            <?php if(env('APTIMAP_CONFIG_ORDIGES', false)): ?>
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('importer_parametre')): ?>
                                    <?php if(!Auth::user()->hasRole(ROLE::RESPONSABLE_PERFORMANCE_ARS)): ?>
                                        <a class="dropdown-item" href="<?php echo e(route('import-nomenclature.index')); ?>">Import
                                            nomenclature</a>
                                    <?php endif; ?>
                                    <a class="dropdown-item" href="<?php echo e(route('import-projet.index')); ?>">Import
                                        projets</a>
                                <?php endif; ?>
                            <?php endif; ?>

                            <?php if(Auth::user()->hasRole(ROLE::SUPER_ADMINISTRATEUR)): ?>
                                <a class="dropdown-item" href="<?php echo e(route('import-cartographie.index')); ?>">Import
                                    cartographie</a>
                            <?php endif; ?>
                            <?php if(Auth::user()->canAny(array('see_structure', 'importer_parametre')) && Auth::user()->can('see_parametre')): ?>
                                <div class="dropdown-divider"></div>
                            <?php endif; ?>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('see_parametre')): ?>
                                <a class="dropdown-item" href="<?php echo e(route('familles.index')); ?>">Familles</a>
                                <a class="dropdown-item" href="<?php echo e(route('leviers.index')); ?>">Leviers</a>
                                <a class="dropdown-item" href="<?php echo e(route('imputations-budgetaires.index')); ?>">Imputations
                                    budgétaires</a>
                                <a class="dropdown-item" href="<?php echo e(route('niveaux-mutualisations.index')); ?>">Niveaux de
                                    mutualisation</a>
                                <a class="dropdown-item" href="<?php echo e(route('operateurs-mutualisations.index')); ?>">Opérateurs
                                    de mutualisation</a>
                                <a class="dropdown-item" href="<?php echo e(route('portefeuilles-responsables-achats.index')); ?>">Portefeuilles
                                    responsable achat</a>
                                <a class="dropdown-item" href="<?php echo e(route('directions.index')); ?>">Directions</a>
                                <a class="dropdown-item" href="<?php echo e(route('thematiques.index')); ?>">Thématiques</a>
                                <a class="dropdown-item" href="<?php echo e(route('resp-soc-env.index')); ?>">Resp.Soc.Env</a>
                                <a class="dropdown-item" href="<?php echo e(route('alertes.index')); ?>">Alertes</a>
                            <?php endif; ?>
                        </div>
                    </li>
                <?php endif; ?>
            </ul>
            <!-- Partie droite de la navbar -->
            <ul class="navbar-nav ml-auto">
                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('see_projet')): ?>
                    <!-- Barre de recherche dans la navbar -->
                    <form class="mb-0" method="POST" action="<?php echo e(route('projets.recherche')); ?>">
                        <?php echo csrf_field(); ?>
                        <div class="input-group">
                            <input name="recherche" id="navbar-recherche" class="form-control" type="search"
                                   placeholder="Rechercher" aria-label="Rechercher" required>
                            <div class="input-group-append">
                                <button class="btn btn-outline-light" type="submit">
                                    <svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-search"
                                         fill="currentColor" xmlns="http://www.w3.org/2000/svg">
                                        <path fill-rule="evenodd"
                                              d="M10.442 10.442a1 1 0 0 1 1.415 0l3.85 3.85a1 1 0 0 1-1.414 1.415l-3.85-3.85a1 1 0 0 1 0-1.415z"/>
                                        <path fill-rule="evenodd"
                                              d="M6.5 12a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11zM13 6.5a6.5 6.5 0 1 1-13 0 6.5 6.5 0 0 1 13 0z"/>
                                    </svg>
                                </button>
                            </div>
                        </div>
                    </form>
                <?php endif; ?>
                <span class="navbar-text font-weight-bold text-white mx-4">
                    Bonjour, <?php echo e(Auth::user()->nom_complet()); ?>

                </span>
                <?php if(!Auth::user()->hasRole(ROLE::SUPER_ADMINISTRATEUR)): ?>
                    
                    <li id="notifications" class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
                           data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                            
                            <?php if(Auth::user()->unreadNotifications->count() === 0): ?>
                                <svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-bell" fill="currentColor"
                                     xmlns="http://www.w3.org/2000/svg">
                                    <path d="M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2z"/>
                                    <path fill-rule="evenodd"
                                          d="M8 1.918l-.797.161A4.002 4.002 0 0 0 4 6c0 .628-.134 2.197-.459 3.742-.16.767-.376 1.566-.663 2.258h10.244c-.287-.692-.502-1.49-.663-2.258C12.134 8.197 12 6.628 12 6a4.002 4.002 0 0 0-3.203-3.92L8 1.917zM14.22 12c.223.447.481.801.78 1H1c.299-.199.557-.553.78-1C2.68 10.2 3 6.88 3 6c0-2.42 1.72-4.44 4.005-4.901a1 1 0 1 1 1.99 0A5.002 5.002 0 0 1 13 6c0 .88.32 4.2 1.22 6z"/>
                                </svg>
                                
                            <?php else: ?>
                                <?php echo e(Auth::user()->unreadNotifications->count()); ?>

                                <svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-bell-fill text-warning"
                                     fill="currentColor" xmlns="http://www.w3.org/2000/svg">
                                    <path
                                        d="M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2zm.995-14.901a1 1 0 1 0-1.99 0A5.002 5.002 0 0 0 3 6c0 1.098-.5 6-2 7h14c-1.5-1-2-5.902-2-7 0-2.42-1.72-4.44-4.005-4.901z"/>
                                </svg>
                            <?php endif; ?>
                        </a>
                        <ul class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
                            <?php echo $__env->make('layouts.includes.notification', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                        </ul>
                    </li>
                <?php endif; ?>
                <!-- Bouton de déconnexion -->
                <a class="btn btn-dark" href="<?php echo e(route('logout')); ?>"
                   onclick="event.preventDefault(); document.getElementById('logout-form').submit();">Déconnexion</a>
                <form id="logout-form" action="<?php echo e(route('logout')); ?>" method="POST" class="d-none">
                    <?php echo csrf_field(); ?>
                </form>
            </ul>
        <?php endif; ?>
    </div>
</nav>
<?php /**PATH /var/www/html/resources/views/layouts/includes/navbar.blade.php ENDPATH**/ ?>