gestiojeux/website/templates/partials/header.html
2020-12-30 00:44:45 +01:00

28 lines
1.3 KiB
HTML

<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>
<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="{% url "suggestions:suggestions" %}">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>