{% load i18n %}

{% if site_url %}
    <a href="{{ site_url }}" class="mx-1 px-3 py-2 rounded-default hover:bg-base-100 hover:text-base-700 dark:hover:bg-base-700 dark:hover:text-base-200">
        {% trans "View site" %}
    </a>
{% endif %}

{% if account_links %}
    {% for link in account_links %}
        <a href="{{ link.link }}" class="mx-1 px-3 py-2 rounded-default hover:bg-base-100 hover:text-base-700 dark:hover:bg-base-700 dark:hover:text-base-200">
            {{ link.title }}
        </a>
    {% endfor %}
{% else %}
    {% if user.has_usable_password %}
        <a href="{% url 'admin:password_change' %}" class="mx-1 px-3 py-2 rounded-default hover:bg-base-100 hover:text-base-700 dark:hover:bg-base-700 dark:hover:text-base-200">
            {% trans "Change password" %}
        </a>
    {% endif %}
{% endif %}

<div class="border-t border-base-200 mt-1 pt-1 dark:border-base-700">
    <form id="logout-form" method="post" action="{% url 'admin:logout' %}" class="mx-1">
        {% csrf_token %}

        <button type="submit" class="bg-none flex cursor-pointer items-center px-3 py-1.5 text-left text-red-700 rounded-default w-full hover:bg-red-100 dark:hover:bg-red-500/20 dark:text-red-400 dark:hover:text-red-400">
            {% trans "Log out" %} <span class="ml-auto material-symbols-outlined text-red-700 dark:text-red-400">logout</span>
        </button>
    </form>
</div>
