friendsmap/map/templates/map/navbar.html

35 lines
2 KiB
HTML

<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container">
<a class="navbar-brand" href="{% url 'map' %}">{{ app.site.name }}</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item dropdown">
{% if user.is_authenticated %}
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
{% firstof user.get_full_name user.username %}
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
{% if user.is_staff %}
<a class="dropdown-item" href="{% url 'admin:index' %}">Admin</a>
<div role="separator" class="dropdown-divider"></div>
{% endif %}
<a class="dropdown-item" href="{% url 'change-profile' %}">Edit profile</a>
<a class="dropdown-item" href="{% url 'password_change' %}">Change password</a>
<div role="separator" class="dropdown-divider"></div>
<a class="dropdown-item" href="{% url 'logout' %}">Logout</a>
</div>
{% else %}
<a class="nav-link" href="{% url 'login' %}">Login</a>
{% endif %}
</li>
</ul>
</div>
</div>
</nav>