{% load i18n %}

<ul class="nav navbar-nav navbar-right">
    <li class="dropdown" id="tab_account">
        <a class="dropdown-toggle" href="#" id="account_dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
          {% if request.user.is_authenticated %}
            <i class="fa-solid fa-user" aria-hidden="true"></i> {{ request.user }}
          {% else %}
            <i class="fa-solid fa-right-to-bracket" aria-hidden="true"></i> Login
          {% endif %}
        </a>
        <ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
          {% if request.user.is_authenticated %}
            <li><a href="{% url 'profile'  %}"><i class="fa-solid fa-fw fa-image" aria-hidden="true"></i> {% trans 'Profile' %}</a></li>
            <li><a href="{% url 'user_preference' %}"><i class="fa-solid fa-fw fa-gear" aria-hidden="true"></i> {% trans 'Preferences' %}</a></li>
            <li><a href="{% url 'import_photo' %}"><i class="fa-solid fa-fw fa-envelope" aria-hidden="true"></i> {% trans 'Import photo via mail address' %}</a></li>
            <li><a href="{% url 'upload_export' %}"><i class="fa-solid fa-fw fa-file-zipper" aria-hidden="true"></i> {% trans 'Import libravatar XML export' %}</a></li>
            <li><a href="{% url 'export' %}"><i class="fa-solid fa-fw fa-file-zipper" aria-hidden="true"></i> {% trans 'Download your libravatar data' %}</a></li>
            <li><a href="{% url 'password_change' %}"><i class="fa-solid fa-fw fa-key" aria-hidden="true"></i> {% trans 'Change password' %}</a></li>
            <li><a href="{% url 'password_reset' %}"><i class="fa-solid fa-fw fa-unlock-keyhole" aria-hidden="true"></i> {% trans 'Reset password' %}</a></li>
	    <li>{% include '_account_logout.html' %}</li>
          {% else %}
            <li><a href="{% url 'login' %}"><i class="fa-solid fa-fw fa-right-to-bracket" aria-hidden="true"></i> {% trans 'Local' %}</a></li>
            <li><a href="{% url 'new_account' %}"><i class="fa-solid fa-fw fa-user-plus" aria-hidden="true"></i> {% trans 'Create account' %}</a></li>
          {% endif %}
        </ul>
    </li>
    {% if user.is_staff %}
      <li>
        <a href="{% url 'admin:index' %}" target="_new"><i class="fa-solid fa-fw fa-user-secret" aria-hidden="true"></i> {% trans 'Admin' %}</a>
      </li>
    {% endif %}
</ul>
