Files
TSysDocker/TSDMaster/TSDMaster/templates/loginpartial.html

14 lines
580 B
HTML

{% load i18n %}
{% if user.is_authenticated %}
<form id="logoutForm" action="{% url 'logout' %}" method="post">
{% csrf_token %}
<span class="navbar-brand">{{ user }}</span>
{% if user.is_staff %}
<a class="btn btn-outline-success my-2 my-sm-2" href="/admin">Admin</a>
{% endif %}
<a class="btn btn-outline-success my-2 my-sm-0" href="javascript:document.getElementById('logoutForm').submit()">{% trans "Logout" %}</a>
</form>
{% else %}
<a class="btn btn-outline-success my-2 my-sm-0" href="{% url 'login' %}">{% trans "Login" %}</a>
{% endif %}