

<!-- Sidebar -->
<ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar">
    
    <!-- Sidebar - Brand -->
    <a class="sidebar-brand d-flex align-items-center justify-content-center" href="{{ path('backend_admin_demo_index') }}">
        <div class="sidebar-brand-icon rotate-n-15">
            <i class="fas fa-laugh-wink"></i>
        </div>
        <div class="sidebar-brand-text mx-3">Promo<sup>TN</sup></div>
    </a>


    <!-- Divider -->
    <hr class="sidebar-divider my-0">
    <!-- Nav Item - Dashboard -->
    <li class="nav-item">
        <a class="nav-link" href="{{ path('frontend_home_index') }}">
            <i class="fa-solid fa-right-from-bracket"></i>
            <span>Retour au site</span>
        </a>
    </li>
    
    <!-- Divider -->
    <hr class="sidebar-divider">
    <!-- Heading -->
    <div class="sidebar-heading">Gestion</div>


    <!-- Nav Item - Charts -->
    <li class="nav-item {{ is_active(['backend_admin_dashboard_index']) }}">
        <a class="nav-link" href="{{ path('backend_admin_dashboard_index') }}">
            <i class="fas fa-fw fa-tachometer-alt"></i>
            <span>Dashboard</span>
        </a>
    </li>


    <!-- Nav Item - Charts -->
    <li class="nav-item ">
        <a class="nav-link" href="#">
            <i class="fa-solid fa-envelope"></i>
            <span>Message</span>
        </a>
    </li>

    <!-- Nav Item - Charts -->
    {% set activeCategorie = is_active(['backend_admin_categorie_index', 'backend_admin_groupe_categorie_index']) %}
    {% if (activeCategorie == 'active')  %} {% set showCategorie = 'show' %} {% else %}  {% set showCategorie = ''%} {% endif %}
    <li class="nav-item {{ showCategorie }}">
        <a class="nav-link collapsed" href="#collapsecategories" data-toggle="collapse" data-bs-toggle="collapse" aria-expanded="true" aria-controls="collapsecategories">
            <i class="fa-solid fa-bars"></i>
            <span>Catégorie</span>
        </a>
        <div id="collapsecategories" class="collapse {{ showCategorie }}" data-parent="#accordionSidebar" aria-labelledby="headingcategories">
            <div class="bg-white py-2 collapse-inner rounded">
                <h6 class="collapse-header">catégories:</h6>
                <a class="collapse-item {{ is_active(['backend_admin_groupe_categorie_index']) }}" href="{{ path('backend_admin_groupe_categorie_index') }}">Groupe</a>
                <a class="collapse-item {{ is_active(['backend_admin_categorie_index']) }}" href="{{ path('backend_admin_categorie_index') }}">Catégorie</a>
            </div>
        </div>
    </li>

    <!-- Nav Item - Partenariat -->
    {% set activePartenariat = is_active(['backend_admin_societe_index', 'backend_admin_societe_add', 'backend_admin_societe_update', 'backend_admin_partenaire_index', 'backend_admin_partenaire_add']) %}
    {% if (activePartenariat == 'active')  %} {% set showPartenariat = 'show' %} {% else %}  {% set showPartenariat = ''%} {% endif %}
    <li class="nav-item {{ activePartenariat }}">
        <a class="nav-link collapsed" href="#collapsepartenariat" data-toggle="collapse" data-bs-toggle="collapse" aria-expanded="true" aria-controls="collapsepositions">
            <i class="fa-regular fa-building"></i>
            <span>Partenariat</span>
        </a>
        <div id="collapsepartenariat" class="collapse {{ showPartenariat }}" data-parent="#accordionSidebar"aria-labelledby="headingpositions"  >
            <div class="bg-white py-2 collapse-inner rounded">
                <h6 class="collapse-header">Partenariat:</h6>
                <a class="collapse-item {{ is_active(['backend_admin_societe_index', 'backend_admin_societe_add', 'backend_admin_societe_update']) }}" href="{{ path('backend_admin_societe_index') }}">Société</a>
                <a class="collapse-item {{ is_active(['backend_admin_partenaire_index', 'backend_admin_partenaire_add']) }}" href="{{ path('backend_admin_partenaire_index') }}">Partenaire </a>
            </div>
        </div>
    </li>

    
    <!-- Nav Item - Annonce -->
    {% set activeAnnonce = is_active(['backend_admin_annonce_index', 'backend_admin_annonce_add', 'backend_admin_annonce_update', 'backend_admin_annonce_uploder', 'backend_admin_position_index', 'backend_admin_position_creer', 'backend_admin_position_detail']) %}
    {% if (activeAnnonce == 'active')  %} {% set showAnnonce = 'show' %} {% else %}  {% set showAnnonce = ''%} {% endif %}
    <li class="nav-item {{ activeAnnonce }}">
        <a class="nav-link collapsed" href="#collapseannonce" data-toggle="collapse" data-bs-toggle="collapse" aria-expanded="true" aria-controls="collapsepositions">
            <i class="fa-solid fa-scroll"></i>
            <span>Annonce</span>
        </a>
        <div id="collapseannonce" class="collapse {{ showAnnonce }}" data-parent="#accordionSidebar"aria-labelledby="headingpositions"  >
            <div class="bg-white py-2 collapse-inner rounded">
                <h6 class="collapse-header">Annonce:</h6>
                <a class="collapse-item {{ is_active(['backend_admin_annonce_index', 'backend_admin_annonce_add', 'backend_admin_annonce_update', 'backend_admin_annonce_uploder']) }}" href="{{ path('backend_admin_annonce_index') }}">Gestion des Annonces</a>
                <a class="collapse-item {{ is_active(['backend_admin_position_index', 'backend_admin_position_creer', 'backend_admin_position_detail']) }}" href="{{ path('backend_admin_position_index') }}">Position & Affichage </a>
            </div>
        </div>
    </li>


    <!-- Nav Item - Article -->
    {% set activeArticle = is_active(['backend_admin_article_index', 'backend_admin_article_add', 'backend_admin_article_update', 'backend_admin_article_uploder']) %}
    {% if (activeArticle == 'active')  %} {% set showArticle = 'show' %} {% else %}  {% set showArticle = ''%} {% endif %}
    <li class="nav-item {{ activeArticle }}">
        <a class="nav-link collapsed" href="#collapsearticles" data-toggle="collapse" data-bs-toggle="collapse" aria-expanded="true" aria-controls="collapsearticles">
            <i class="fa-solid fa-barcode"></i>
            <span>Article</span>
        </a>
        <div id="collapsearticles" class="collapse {{ showArticle }}" data-parent="#accordionSidebar"aria-labelledby="headingpositions"  >
            <div class="bg-white py-2 collapse-inner rounded">
                <h6 class="collapse-header">Article:</h6>
                <a class="collapse-item {{ is_active(['backend_admin_article_index', 'backend_admin_article_update']) }}" href="{{ path('backend_admin_article_index') }}">Gestion</a>
                <a class="collapse-item {{ is_active(['backend_admin_article_add', 'backend_admin_article_uploder']) }}" href="{{ path('backend_admin_article_add') }}">Ajouter</a>
            </div>
        </div>
    </li>
    

    <!-- Nav Item - Service -->
    {% set activeService = is_active(['backend_admin_service_index', 'backend_admin_service_add', 'backend_admin_service_update', 'backend_admin_service_uploder']) %}
    {% if (activeService == 'active')  %} {% set showService = 'show' %} {% else %}  {% set showService = ''%} {% endif %}
    <li class="nav-item {{ activeService }}">
        <a class="nav-link collapsed" href="#collapseservices" data-toggle="collapse" data-bs-toggle="collapse" aria-expanded="true" aria-controls="collapseservices">
            <i class="fa-solid fa-handshake"></i>
            <span>Service</span>
        </a>
        <div id="collapseservices" class="collapse {{ showService }}" data-parent="#accordionSidebar"aria-labelledby="headingpositions"  >
            <div class="bg-white py-2 collapse-inner rounded">
                <h6 class="collapse-header">Service:</h6>
                <a class="collapse-item {{ is_active(['backend_admin_service_index', 'backend_admin_service_update']) }}" href="{{ path('backend_admin_service_index') }}">Gestion</a>
                <a class="collapse-item {{ is_active(['backend_admin_service_add', 'backend_admin_service_uploder']) }}" href="{{ path('backend_admin_service_add') }}">Ajouter</a>
            </div>
        </div>
    </li>

    <!-- Nav Item - utilisateurs Collapse Menu -->
    
    {% set activeUser = is_active(['backend_admin_user_index', 'backend_admin_user_deleted']) %}
    {% if (activeUser == 'active')  %} {% set showUser = 'show' %} {% else %}  {% set showUser = ''%} {% endif %}
    <li class="nav-item {{ activeUser }}">
        <a class="nav-link collapsed" href="#collapseutilisateurs" data-toggle="collapse" data-bs-toggle="collapse" aria-expanded="true" aria-controls="collapseutilisateurs">
            <i class="fa-solid fa-users"></i>
            <span>Utilisateurs</span>
        </a>
        <div id="collapseutilisateurs" class="collapse {{ showUser }}" data-parent="#accordionSidebar"aria-labelledby="headingutilisateurs"  >
            <div class="bg-white py-2 collapse-inner rounded">
                <h6 class="collapse-header">utilisateurs:</h6>
                <a class="collapse-item {{ is_active(['backend_admin_user_index']) }}" href="{{ path('backend_admin_user_index') }}">Lister</a>
                <a class="collapse-item {{ is_active(['backend_admin_user_deleted']) }}" href="{{ path('backend_admin_user_deleted') }}">Inactifs</a>
            </div>
        </div>
    </li>

    <!-- Sidebar Message -->
    <hr class="sidebar-divider">
    <div class="sidebar-card d-none d-lg-flex">
    
        <img class="sidebar-card-illustration mb-2" src="{{ asset('images/backend/img/undraw_profile.svg') }}" alt="{{ app.user.firstname  ~  '  '  ~  app.user.lastname|e }}">

        <p class="text-center mb-2"><strong>{{ app.user.firstname  ~  '  '  ~  app.user.lastname|e }}</strong></p>
        <a class="btn btn-success btn-sm" href="{{ path('frontend_security_logout') }}">Déconnexion</a>
    </div>

    <hr class="sidebar-divider">
    <div class="text-center d-none d-md-inline">
        <button class="rounded-circle border-0" id="sidebarToggle"></button>
    </div>

</ul>
<!-- End of Sidebar -->