{% load static %}

{% url 'EspaceEnseignant:enseignant_profile' as enseignant_profile %}
{% url 'EspaceEnseignant:infos_personnelles' as infos_perso %}
{% url 'EspaceEnseignant:change_password' as change_password %}
{% url 'EspaceEnseignant:enseignant_edt' as enseignant_edt %}
{% url 'EspaceEnseignant:seance_cours' as seance_cours %}
{% url 'EspaceEnseignant:equipe_list' as equipe_list %}
{% url 'EspaceEnseignant:ps_cours_list' as ps_cours_list %}
{% url 'EspaceEnseignant:pub_list' as pub_list %}
{% url 'EspaceEnseignant:logiciel_list' as logiciel_list %}
{% url 'EspaceEnseignant:enseignant_profil_edit' as enseignant_profil_edit %}
{% url 'EspaceEtudiant:sondage_list' as sondage_list %}


{% url 'EspaceEtudiant:add_photo' as add_photo %}

<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 user.avatar %}
               <img src="/media/{{ user.avatar }}" 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">{{user.nom}}</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 'EspaceEnseignant:enseignant_profile' %}" class="nav-link {% if request.path == enseignant_profile or 'marquer_absence' in request.path %} active {% endif %}">
                    <i class="nav-icon fas fa-home"></i>
                    <p>Tableau de Bord</p>
                </a>
            </li>

            <li class="nav-item">
                <a href="{% url 'EspaceEnseignant:enseignant_edt' %}" class="nav-link {% if request.path == enseignant_edt %} active {% endif %}">
                    <i class="nav-icon fas fa-calendar"></i>
                    <p>Mon EDT</p>
                </a>
            </li>

            <li class="nav-item">
                <a href="{% url 'EspaceEnseignant:seance_cours' %}" class="nav-link {% if request.path == seance_cours or 'edit_seance_cours' in request.path %} active {% endif %}">
                    <i class="nav-icon fas fa-check-circle"></i>
                    <p>Mes Séances</p>
                </a>
            </li>

            <li class="nav-item has-treeview {% if request.path == infos_perso or request.path == enseignant_profil_edit  or request.path == logiciel_list  or request.path == pub_list  or request.path == support_list  or request.path == ps_cours_list  or request.path == equipe_list or request.path == Type_pub_list or request.path == change_password or request.path == add_photo or request.path == Type_cours_list or 'logiciel_edit' in request.pathor  or 'Type_pub_edit' in request.pathor or 'equipe_edit' in request.path or 'ps_cours_edit' in request.path  or 'pub_edit' in request.path  or 'support_edit' in request.path  or 'Type_cours_edit' in request.path %} menu-open {% endif %}">
                <a href="#" class="nav-link">
                    <i class="nav-icon fas fa-users"></i>
                    <p>Mon compte</p>
                </a>
                <ul class="nav nav-treeview">

                    <li class="nav-item">
                    <a href="{% url 'EspaceEnseignant:equipe_list' %}" class="nav-link {% if request.path == equipe_list or 'equipe_edit' in request.path %} active {% endif %}">
                      <i class="fa fa-circle-o nav-icon"></i>
                      <p>Mes équipes</p>
                    </a>
                  </li>
                    <li class="nav-item">
                    <a href="{% url 'EspaceEnseignant:ps_cours_list' %}" class="nav-link {% if request.path == ps_cours_list or 'ps_cours_edit' in request.path %} active {% endif %}">
                      <i class="fa fa-circle-o nav-icon"></i>
                      <p>Mes enseignements</p>
                    </a>
                  </li>
                    <li class="nav-item">
                    <a href="{% url 'EspaceEnseignant:pub_list' %}" class="nav-link {% if request.path == pub_list or 'pub_edit' in request.path %} active {% endif %}">
                      <i class="fa fa-circle-o nav-icon"></i>
                      <p>Mes publications</p>
                    </a>
                  </li>
                    <li class="nav-item">
                    <a href="{% url 'EspaceEnseignant:logiciel_list' %}" class="nav-link {% if request.path == logiciel_list or 'logiciel_edit' in request.path %} active {% endif %}">
                      <i class="fa fa-circle-o nav-icon"></i>
                      <p>Mes logiciels et brevets</p>
                    </a>
                  </li>
                    <li class="nav-item">
                    <a href="{% url 'EspaceEtudiant:add_photo' %}" class="nav-link {% if request.path == add_photo %} active {% endif %}">
                      <i class="fa fa-circle-o nav-icon"></i>
                      <p>Ma Photo</p>
                    </a>
                  </li>
                  <li class="nav-item">
                    <a href="{% url 'EspaceEnseignant:infos_personnelles' %}" class="nav-link {% if request.path == infos_perso or request.path == enseignant_profil_edit %} active {% endif %}">
                      <i class="fa fa-circle-o nav-icon"></i>
                      <p>Mes informations</p>
                    </a>
                  </li>
                  <li class="nav-item">
                    <a href="{% url 'EspaceEnseignant:change_password' %}" class="nav-link {% if request.path == change_password %} active {% endif %}">
                      <i class="fa fa-circle-o nav-icon"></i>
                      <p>Changer le Mot de passe</p>
                    </a>
                  </li>
                    <li class="nav-item">
                    <hr/>
                  </li>
                </ul>
            </li>
            {% if user.add_programme == True %}
            <li class="nav-item">
                <a href="{% url 'EspaceEnseignant:emploi_du_temps_list' %}" class="nav-link {% if request.path == emploi_du_temps  %} active {% endif %}">
                    <i class="nav-icon fas fa-calendar fa-plus"></i>
                    <p>Ajouter Emplois du Temps</p>
                </a>
            </li>
            {% endif %}
            <li class="nav-item">
                <a href="{% url 'EspaceEtudiant:sondage_list' %}" class="nav-link {% if request.path == sondage_list %} active {% endif %}">
                    <i class="nav-icon fa fa-file"></i>
                    <p>Sondage</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>