gestiojeux/website/templates/partials/header.html

29 lines
1.2 KiB
HTML
Raw Normal View History

<header>
<h1>GestioJeux</h1>
<div id="mobile_nav_trigger" onclick="toggle_mobile_nav()">
<i class="fa fa-fw fa-bars" aria-hidden="true"></i> Menu
</div>
<nav>
{% with url_name=request.resolver_match.url_name %}
<div>
2020-12-27 12:48:08 +01:00
<a {% if url_name == "home" %}class="current"{% endif %} href="{% url "website: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 %}
</div>
<div id="account">
{% if request.user.is_authenticated %}
<a class="username" href="{% url "accounts:account_settings" %}">{{ request.user }}</a>
<a class="logout" 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 %}
</div>
{% endwith %}
</div>
</header>