{% if app.user is defined and app.user.appTheme == 1 %}
    {% set theme = 'sidebar-light' %}
{% else %}
    {% set theme = 'sidebar-dark' %}
{% endif %}

<div class="sidebar {{ theme}} sidebar-main sidebar-expand-lg">

    <!-- Sidebar content -->
    <div class="sidebar-content">

        <!-- User menu -->
        {% include 'admin/layouts/_navs/_partials/_sidebar_user.html.twig' %}
        <!-- /user menu -->

        <!-- Main navigation -->
        <div class="sidebar-section">
            <ul class="nav nav-sidebar" data-nav-type="accordion">
                <!-- Main -->
                <li class="nav-item">
                    <a href="{{ path('admin.home') }}" class="nav-link {{ set_active_route_global(current_page, 'admin_home') }}">
                        <i class="icon-grid6"></i>
                        <span>
                            Tableau de bord
                            {% if app.user.superAdmin %}
                                Super admin
                            {% elseif app.user.admin %}
                                Administrateur
                            {% else %}
                                Utilisateur
                            {% endif %}
                        </span>
                    </a>
                </li>
                <li class="nav-item">
                    <a href="{{ path('admin.searchs') }}" class="nav-link {{ set_active_route_global(current_page, 'admin_searchs') }}">
                        <i class="icon-printer"></i>
                        <span>Imprimer etat des loyers</span>
                    </a>
                </li>

                <!-- /main -->
                <li class="nav-item-header">
                    <div class="text-uppercase font-size-xs line-height-xs">ACTEURS & IMMOBILIERS</div>
                    <i class="icon-menu" title="Navigation"></i>
                </li>
                <li class="nav-item nav-item-submenu {{ set_active_route_global(current_global, 'acteurs') }}">
                    <a href="#" class="nav-link"><i class="icon-users"></i> <span>Locataires & Propriétaires</span></a>
                    <ul class="nav nav-group-sub" data-submenu-title="Locataires & Propriétaires" {% if set_active_route_global(current_global, 'acteurs') %}style="display: block;"{% endif %}>
                        <li class="nav-item nav-item-submenu {{ set_active_route_global(current_page, 'locataires') }}">
                            <a href="javascript:" class="nav-link"><i class="icon-users2"></i> Gestion des locataires</a>
                            <ul class="nav nav-group-sub" {% if set_active_route(current_page, 'locataires') or set_active_route(current_page, 'locataires_new') or set_active_route(current_page, 'locataires_card') %}style="display: block;"{% endif %}>
                                <li class="nav-item {{ set_active_route(current_page, 'locataires_new') }}">
                                    <a href="{{ path('admin.acteurs.locataires.new') }}" class="nav-link">
                                        <i class="icon-user-plus"></i> Nouveau locataire
                                    </a>
                                </li>
                                <li class="nav-item {{ set_active_route(current_page, 'locataires') }}">
                                    <a href="{{ path('admin.acteurs.locataires.index') }}" class="nav-link">
                                        <i class="icon-list"></i> Liste des locataires
                                    </a>
                                </li>
                                <li class="nav-item {{ set_active_route(current_page, 'locataires_card') }}">
                                    <a href="{{ path('admin.acteurs.locataires.list') }}" class="nav-link">
                                        <i class="icon-users"></i> Tous locataires
                                    </a>
                                </li>
                                <li class="nav-item {{ set_active_route(current_page, 'locataires_out') }}">
                                    <a href="{{ path('admin.acteurs.locataires.out') }}" class="nav-link">
                                        <i class="icon-list"></i> Locataires archivés
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-submenu {{ set_active_route_global(current_page, 'proprietaires') }}">
                            <a href="javascript:" class="nav-link"><i class="icon-users2"></i> Gestion proprietaires</a>
                            <ul class="nav nav-group-sub" {% if set_active_route(current_page, 'proprietaires') or set_active_route(current_page, 'proprietaires_new') %}style="display: block;"{% endif %}>
                                <li class="nav-item {{ set_active_route(current_page, 'proprietaires_new') }}">
                                    <a href="{{ path('admin.acteurs.proprietaires.new') }}" class="nav-link">
                                        <i class="icon-user-plus"></i> Nouveau proprietaire
                                    </a>
                                </li>
                                <li class="nav-item {{ set_active_route(current_page, 'proprietaires') }}">
                                    <a href="{{ path('admin.acteurs.proprietaires.index') }}" class="nav-link">
                                        <i class="icon-list"></i> Liste des proprietaires
                                    </a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </li>
                <li class="nav-item nav-item-submenu {{ set_active_route_global(current_page, 'properties') }}">
                    <a href="javascript:" class="nav-link"><i class="icon-home9"></i> Gestion des propriétés</a>
                    <ul class="nav nav-group-sub"
                        {% if set_active_route(current_page, 'properties') or
                            set_active_route(current_page, 'typesproperties') or
                            set_active_route(current_page, 'properties_new')
                        %}style="display: block;"{% endif %}>
                        <li class="nav-item {{ set_active_route(current_page, 'properties_new') }}">
                            <a href="{{ path('admin.properties.new') }}" class="nav-link">
                                <i class="icon-plus2"></i> Nouvelle propriété
                            </a>
                        </li>
                        <li class="nav-item {{ set_active_route(current_page, 'properties') }}">
                            <a href="{{ path('admin.properties.index') }}" class="nav-link">
                                <i class="icon-list2"></i> Liste des propriétés
                            </a>
                        </li>
                        <li class="nav-item {{ set_active_route(current_page, 'typesproperties') }}">
                            <a href="{{ path('admin.typesproperties.index') }}" class="nav-link">
                                <i class="icon-inbox"></i> Type de propriété
                            </a>
                        </li>
                    </ul>
                </li>
                 
                <li class="nav-item nav-item-submenu {{ set_active_route_global(current_page, 'demarcheurs') }}">
                    <a href="javascript:" class="nav-link"><i class="icon-home9"></i> Gestion des démarcheurs</a>
                    <ul class="nav nav-group-sub"
                        {% if set_active_route(current_page, 'demarcheurs') or
                            set_active_route(current_page, 'demarcheur_new')
                        %}style="display: block;"{% endif %}>
                        <li class="nav-item {{ set_active_route(current_page, 'demarcheur_new') }}">
                            <a href="{{ path('admin.demarcheurs.new') }}" class="nav-link">
                                <i class="icon-plus2"></i> Nouveau démarcheur
                            </a>
                        </li>
                        <li class="nav-item {{ set_active_route(current_page, 'demarcheurs') }}">
                            <a href="{{ path('admin.demarcheurs.index') }}" class="nav-link">
                                <i class="icon-list2"></i> Liste des démarcheurs
                            </a>
                        </li>
                        
                    </ul>
                </li>

                 <li class="nav-item nav-item-submenu {{ set_active_route_global(current_page, 'biens') }}">
                    <a href="javascript:" class="nav-link"><i class="icon-home9"></i> Gestion des biens</a>
                    <ul class="nav nav-group-sub"
                        {% if set_active_route(current_page, 'biens') or
                            set_active_route(current_page, 'bien_new')
                        %}style="display: block;"{% endif %}>
                        <li class="nav-item {{ set_active_route(current_page, 'bien_new') }}">
                            <a href="{{ path('admin.biens.new') }}" class="nav-link">
                                <i class="icon-plus2"></i> Ajouter un bien
                            </a>
                        </li>
                        <li class="nav-item {{ set_active_route(current_page, 'biens') }}">
                            <a href="{{ path('admin.biens.index') }}" class="nav-link">
                                <i class="icon-list2"></i> Liste des biens
                            </a>
                        </li>
                        
                    </ul>
                </li>


                <li class="nav-item nav-item-submenu {{ set_active_route_global(current_page, 'quittances') }}">
                    <a href="javascript:" class="nav-link"><i class="icon-coin-euro"></i> Quittances des loyers</a>
                    <ul class="nav nav-group-sub"
                        {% if set_active_route(current_page, 'quittances')
                        %}style="display: block;"{% endif %}>
                        <li class="nav-item {{ set_active_route(current_page, 'quittances') }}">
                            <a href="{{ path('admin.quittances.index') }}" class="nav-link">
                                <i class="icon-coin-euro"></i> Quittance des loyers
                            </a>
                        </li>
                    </ul>
                </li>
                <!-- Administration -->
                {% include 'admin/layouts/_navs/_partials/_sidebar_administration.html.twig' %}
                <!-- /Administration -->
            </ul>
        </div>
        <!-- /main navigation -->
    </div>
    <!-- /sidebar content -->
</div>