{% load static %}

{% url 'Scolarite:ags_home' as ags_home %}
{% url 'Scolarite:ags_inscrption_list' as ags_inscrption_list %}
{% url 'Scolarite:ags_reinscrption_list' as ags_reinscrption_list %}
{% url 'Scolarite:ags_pv_list' as ags_pv_list %}
{% url 'Scolarite:demande_list' as demande_list %}


<aside class="main-sidebar sidebar-dark-primary elevation-4">
    <!-- Brand Logo -->
    <a href="#" class="brand-link">
        <img src="{% static 'ac-img/IV.jpeg' %}" alt="AdminLTE Logo"
            class="brand-image img-circle elevation-3" style="opacity: .8">
        <span class="brand-text font-weight-light">IVESTP </span>
    </a>

    <!-- Sidebar -->
    <div class="sidebar">
        <!-- Sidebar user panel (optional) -->
        <div class="user-panel mt-3 pb-3 mb-3 d-flex">
            <div class="image">
                {% if request.user.avatar %}
               <img src="{{ user.avatar.url }}" class="img-circle elevation-2" alt="User Image">
                {% else %}
                <img src="{% static 'ac-img/user-default2.png' %}" class="img-circle elevation-2" alt="User Image">
                {% endif %}
            </div>
            <div class="info">
                <a class="d-block">{{request.user}}</a>
            </div>
        </div>

        <!-- Sidebar Menu -->
        <nav class="mt-2">
            <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">

            <li class="nav-item">
                <a href="{% url 'Scolarite:ags_home' %}" class="nav-link {% if request.path == ags_home %} active {% endif %}">
                    <i class="nav-icon fas fa-home"></i>
                    <p>Tableau de Bord</p>
                </a>
            </li>
            <li class="nav-item has-treeview {% if request.path == ags_inscrption_list or 'ags_reinscrption_check' in request.path or 'ags_reinscrption_list' in request.path or 'ags_inscrption_agree' in request.path or request.path == enseignant_add or request.path in enseignant_edit or request.path == etudiant_list or request.path == etudiant_add or request.path in etudiant_edit %} menu-open {% endif %}">
                <a href="#" class="nav-link">
                    <i class="nav-icon fas fa-users"></i>
                    <p>Inscrire</p>
                </a>
                <ul class="nav nav-treeview">
                  <li class="nav-item">
                    <a href="{% url 'Scolarite:ags_inscrption_list' %}" class="nav-link {% if request.path == ags_inscrption_list or 'ags_inscrption_agree' in request.path or request.path == enseignant_add or request.path in enseignant_edit %} active {% endif %}">
                      <i class="fa fa-circle-o nav-icon"></i>
                      <p>Inscription</p>
                    </a>
                  </li>
                  <li class="nav-item">
                    <a href="{% url 'Scolarite:ags_reinscrption_list' %}" class="nav-link {% if request.path == ags_reinscrption_list or 'ags_reinscrption_check' in request.path %} active {% endif %}">
                      <i class="fa fa-circle-o nav-icon"></i>
                      <p>Réinscription</p>
                    </a>
                  </li>
                </ul>
            </li>
            <li class="nav-item">
                <a href="{% url 'Scolarite:ags_pv_list' %}" class="nav-link {% if request.path == ags_pv_list %} active {% endif %}">
                  <i class="fa fa-file-pdf nav-icon"></i>
                  <p>Procès verbaux</p>
                </a>
            </li>
            <li class="nav-item">
                <a href="{% url 'Scolarite:demande_list' %}" class="nav-link {% if request.path == demande_list %} active {% endif %}">
                  <i class="fa fa-history nav-icon"></i>
                  <p>Demandes d'actes</p>
                </a>
            </li>

            <li class="nav-item">
                <a href="{% url 'BasicData:logout' %}" class="nav-link">
                <i class="nav-icon fas fa-power-off"></i>
                <p>Quitter</p>
                </a>
            </li>

</ul>
</nav>
<!-- /.sidebar-menu -->
</div>
<!-- /.sidebar -->
</aside>