User dans la navbar

This commit is contained in:
Klafyvel 2018-02-28 15:18:08 +01:00
parent 47d96bbef9
commit 4d8074ef95

View file

@ -16,5 +16,22 @@
<li class="nav-item {% if settings %}active{% endif %}"><a class="nav-link" href="{% url 'settings:index' %}">Administration</a></li>
</ul>
<ul class="navbar-nav ml-auto">
{% if request.user.is_authenticated %}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{request.user}}
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="#"><i class="fa fa-user"></i> Accéder à mon profil</a>
<a class="dropdown-item" href="#"><i class="fa fa-sign-out-alt"></i> Se déconnecter</a>
</div>
</li>
{% else %}
<li class="nav-item {% if active == 4 %}active{% endif %}">
<a class="nav-link" href="">Connexion<span class="sr-only">(current)</span></a>
</li>
{% endif %}
</ul>
</div>
</nav>