gestiojeux/mainsite/templates/partials/header.html
Guillaume Bertholon c836f642fa Authenticate by email with a custom user model
This avoid the weird double username situation where we want to give the
users the choice of their displayed name but at the same time we need them to
never change their CAS username.

Now CAS matches on email so we do not have problems.
2020-12-24 14:19:35 +01:00

20 lines
1 KiB
HTML

<header>
<h1>GestioJeux</h1>
{% with url_name=request.resolver_match.url_name %}
<nav>
<a {% if url_name == "home" %}class="current"{% endif %} href="{% url "mainsite:home" %}"><i class="fa fa-home" aria-hidden="true"></i></a>
<a {% if url_name == "inventory" %}class="current"{% endif %} href="{% url "inventory:inventory" %}">Inventaire</a>
<a {% if url_name == "suggestions" %}class="current"{% endif %} href="">Suggestions</a>
{% if request.user.is_staff %}
<a href="{% url "admin:index" %}">Admin</a>
{% endif %}
</nav>
{% if request.user.is_authenticated %}
<a class="username" href="{% url "accounts:account_settings" %}">{{ request.user }}</a>
<a class="login" href="{% url "accounts:logout" %}?next={{ request.get_full_path }}"><i class="fa fa-sign-out" aria-hidden="true"></i></a>
{% else %}
<a class="login{% if url_name == "login" %} current{% endif %}" href="{% url "accounts:login" %}?next={{ request.get_full_path }}">Connexion</a>
{% endif %}
{% endwith %}
</header>