{% load i18n %}
{% load static %}
{% load navactive %}

<nav class="navbar navbar-default navbar-static-top auth-navbar-top" role="navigation">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".auth-menus-collapse">
              <span class="sr-only">{% translate "Toggle navigation" %}</span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
            </button>

            <a class="navbar-brand">
                <img src="https://images.evetech.net/corporations/98000030/logo?size=32" style="display: inline-block;" height="32" width="32"/>
                {{ SITE_NAME }}
            </a>
        </div>

        <div class="collapse navbar-collapse auth-menus-collapse">
            <ul class="nav navbar-nav navbar-right navbar-pills">
{#                <li>#}
{#                    {% include 'allianceauth/night-toggle.html' %}#}
{#                </li>#}

                {% if notifications %}
                    <li class="{% navactive request 'notifications:' %}">
                        <a href="{% url 'notifications:list' %}">{% translate "Notifications" %}
                            <span class="badge">{{ notifications }}</span>
                        </a>
                    </li>
                {% else %}
                    <li>
                        <a href="{% url 'notifications:list' %}">
                            <i class="far fa-bell"></i>
                        </a>
                    </li>
                {% endif %}

                {% if user.is_authenticated %}
                    {% if user.is_staff %}
                        <li><a href="{% url 'admin:index' %}" target="_blank" rel="noopener noreferer">{% translate "Admin" %}</a></li>
                    {% endif %}
                {% endif %}

                <li><a href="https://terra-nanotech.de/" target="_blank" rel="noopener noreferer">TN-NT Website</a></li>
                <li><a href="https://forum.terra-nanotech.de/" target="_blank" rel="noopener noreferer">TN-NT Forums</a></li>
                <li><a href="https://wiki.terra-nanotech.de/" target="_blank" rel="noopener noreferer">TN-NT Wiki</a></li>
                <li><a href="https://seat.terra-nanotech.de/" target="_blank" rel="noopener noreferer">TN-NT SeAT</a></li>

                {% if user.is_authenticated %}
                    <li><a href="{% url 'logout' %}">{% translate "Logout" %}</a></li>
                {% else %}
                    <li><a href="{% url 'authentication:login' %}">{% translate "Login" %}</a></li>
                {% endif %}

                {% if user.is_superuser %}
                    <li>
                        <a class="navbar-brand" style="margin-left: -4px;" href="https://allianceauth.readthedocs.io/" target="_blank">
                            <i class="fas fa-question-circle fa-fw"></i>
                        </a>
                    </li>
                {% endif %}
            </ul>

            <form id="f-lang-select" class="navbar-form navbar-right" action="{% url 'set_language' %}" method="post">
                {% csrf_token %}

                <div class="form-group">
                    <select onchange="this.form.submit()" class="form-control" id="lang-select" name="language">
                        {% get_language_info_list for LANGUAGES as languages %}

                        {% for language in languages %}
                            <option value="{{ language.code }}"{% if language.code == LANGUAGE_CODE %} selected="selected"{% endif %}>
                                {{ language.name_local }} ({{ language.code }})
                            </option>
                        {% endfor %}
                    </select>
                </div>
            </form>
        </div>
    </div>
</nav>
