Add login/logout links and templates

This commit is contained in:
Claude Paroz 2018-08-14 14:57:29 +02:00
parent bff06c1de2
commit c96bd0d0db
3 changed files with 77 additions and 6 deletions

View file

@ -9,9 +9,9 @@
<div id="user-tools">
{% if user.is_authenticated %}
{% block welcome-msg %}Bienvenue <strong>{% firstof user.username %}</strong>.{% endblock %}
<a href="{% url 'home' %}">Site public</a>&nbsp;&nbsp;<a href="{% url 'admin:index' %}">Admin</a>
<a href="{% url 'logout' %}">Déconnexion</a>
{% else %}
<a href="{% url 'admin:index' %}">Admin</a>
<a href="{% url 'login' %}?next={{ request.path }}">Connexion</a>
{% endif %}
</div>
{% endblock %}