add dashboard nav

This commit is contained in:
bkfox 2024-03-29 05:02:43 +01:00
parent bd1b996695
commit 6d0f2a7395
2 changed files with 30 additions and 11 deletions

View File

@ -62,18 +62,10 @@ Usefull context:
{% for item, render in items %}
{{ render }}
{% endfor %}
{% if user.is_staff %}
<a class="nav-item" href="{% url "admin:index" %}" target="new">
{% translate "Admin" %}
</a>
{% endif %}
{% if user.is_authenticated %}
<a class="nav-item" href="{% url "logout" %}" title="{% translate "Disconnect" %}"
aria-label="{% translate "Disconnect" %}">
<i class="fa fa-power-off"></i>
</a>
{% endif %}
{% endblock %}
{% if user.is_authenticated %}
{% include "./dashboard/nav.html" %}
{% endif %}
</div>
{% endblock %}
</nav>

View File

@ -0,0 +1,27 @@
{% load i18n %}
<div class="dropdown is-hoverable is-right">
<div class="dropdown-trigger">
<button class="button square" aria-haspopup="true" aria-controls="dropdown-menu" type="button">
<span class="icon">
<i class="fa fa-user" aria-hidden="true"></i>
</span>
</button>
</div>
<div class="dropdown-menu" id="dropdown-menu" role="menu" style="z-index:200">
<div class="dropdown-content">
{% block user-menu %}
{% endblock %}
{% if user.is_admin %}
{% block admin-menu %}
<a class="nav-item" href="{% url "admin:index" %}" target="new">
{% translate "Admin" %}
</a>
{% endblock %}
<hr class="dropdown-divider" />
{% endif %}
<a class="dropdown-item" href="{% url "logout" %}">
{% translate "Disconnect" %}
</a>
</div>
</div>
</div>