{% load static %}

{% url 'EspaceEnseignant:Home' as home %}
{% url 'EspaceEnseignant:manage_password' as password %}
{% url 'EspaceEnseignant:add_note_views' as password %}

<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 enseignant.avatar %}
               <img src="{{ enseignant.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">{{user.prenoms}}</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:Home' %}" class="nav-link {% if request.path == home %} 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:manage_password' %}" class="nav-link {% if request.path == password %} active {% endif %}">
                    <i class="nav-icon fas fa-lock"></i>
                    <p>Changer le mot de passe</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>