{% load aircox 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-regular fa-user" aria-hidden="true" style="opacity: 0.6"></i>
            </span>
        </button>
    </div>
    <div class="dropdown-menu" id="dropdown-menu" role="menu" style="z-index:200">
        <div class="dropdown-content">
            {% block user-menu %}
            <a class="dropdown-item" href="{% url "dashboard" %}" data-force-reload="1">
                {% translate "Dashboard" %}
            </a>
            {% if user|has_perm:"list_user" %}
            <a class="dropdown-item" href="{% url "user-list" %}" data-force-reload="1">
                {% translate "Users" %}
            </a>
            {% endif %}
            {% endblock %}


            {% comment %}
            {% block edit-menu %}
            {% if request.user|has_perm:"aircox.create_program" %}
            <a class="dropdown-item" href="{% url "program-create" %}">
                {% translate "Create Program" %}
            </a>
            {% endif %}
            {% endblock %}
            {% endcomment %}
            {% if user.is_superuser %}
            <hr class="dropdown-divider" />
            {% block admin-menu %}
            <a class="dropdown-item" href="{% url "admin:index" %}" target="new">
                {% translate "Admin" %}
            </a>
            <a class="dropdown-item" href="{% url "dashboard-statistics" %}">
                {% translate "Statistics" %}
            </a>
            {% endblock %}
            {% endif %}
            {% if user.is_authenticated %}
            <hr class="dropdown-divider" />
            <form id="logout" action="{% url 'logout' %}" method="post">
                    {% csrf_token %}
                    <a class="dropdown-item" href="#" type="submit" onclick="document.getElementById('logout').submit();">
                        {% translate "Disconnect" %}
                    </a>
            </form>
            {% endif %}
        </div>
    </div>
</div>
