{% load i18n %}
<nav class="sticky-top navbar navbar-expand-lg navbar-dark bg-dark">
    <div class="container-fluid">
        <a class="navbar-brand" href="{% url 'start:index' %}">
            <img src="https://static.cscherr.de/images/profile/profile-margin.png"
                 alt="Logo"
                 height="30"
                 class="d-inline-block align-text-top">
            {% translate "cscherr.de" noop %}
        </a>
        <button class="navbar-toggler"
                type="button"
                data-bs-toggle="collapse"
                data-bs-target="#navbarSupportedContent"
                aria-controls="navbarSupportedContent"
                aria-expanded="false"
                aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <ul class="navbar-nav me-auto mb-2 mb-lg-0">
                <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle"
                       href="#"
                       role="button"
                       data-bs-toggle="dropdown"
                       aria-expanded="false">{% translate "Start" %}</a>
                    <ul class="dropdown-menu">
                        <li>
                            <a class="dropdown-item" href="{% url 'start:index' %}">{% translate "Start" %}</a>
                        </li>
                        <li>
                            <a class="dropdown-item" href="{% url 'start:professional' %}">{% translate "Professionell" %}</a>
                        </li>
                        <li>
                            <a class="dropdown-item" href="{% url 'start:links' %}">{% translate "Links" %}</a>
                        </li>
                        <li>
                            <hr class="dropdown-divider">
                        </li>
                        <li>
                            <a class="dropdown-item" href="{% url 'start:legal' %}">{% translate "Legal Info" %}</a>
                        </li>
                    </ul>
                </li>
                <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle"
                       href="#"
                       role="button"
                       data-bs-toggle="dropdown"
                       aria-expanded="false">{% translate "Blog" %}</a>
                    <ul class="dropdown-menu">
                        <li>
                            <a class="dropdown-item" href="{% url 'blog:index' %}">{% translate "Start" %}</a>
                        </li>
                        <li>
                            <a class="dropdown-item" href="{% url 'blog:browse' %}">{% translate "Browse" %}</a>
                        </li>
                    </ul>
                </li>
                <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle"
                       href="#"
                       role="button"
                       data-bs-toggle="dropdown"
                       aria-expanded="false">Debug</a>
                    <ul class="dropdown-menu">
                        <li>
                            <a class="dropdown-item" href="http://localhost:8080" target="_blank">DB</a>
                        </li>
                        <li>
                            <a class="dropdown-item" href="{% url 'admin:index' %}" target="_blank">Admin</a>
                        </li>
                        <li>
                            <hr class="dropdown-divider">
                        </li>
                        <li>
                            <a class="dropdown-item" href="#">Something else here</a>
                        </li>
                    </ul>
                </li>
                <li class="nav-item dropdown">
                    {% get_current_language as LANGUAGE_CODE %}
                    <form action="{% url 'set_language' %}" method="post">
                        {% csrf_token %}
                        {% get_current_language as LANGUAGE_CODE %}
                        {% get_available_languages as LANGUAGES %}
                        {% get_language_info_list for LANGUAGES as languages %}
                        <input name="next" type="hidden" value="{{ redirect_to }}">
                        <a class="nav-link dropdown-toggle"
                           href="#"
                           role="button"
                           data-bs-toggle="dropdown"
                           aria-expanded="false">{{ LANGUAGE_CODE }}</a>
                        <ul class="dropdown-menu">
                            {% for language in languages %}
                                <li>
                                    <input class="dropdown-item"
                                           type="submit"
                                           name="language"
                                           value="{{ language.code }}">
                                </li>
                            {% endfor %}
                        </ul>
                    </form>
                </li>
                <li class="nav-item">
                    <button type="button" class="btn btn-dark" id="toggleThemeButton">
                        <i id="toggleThemeIcon" class="bi bi-sun"></i>
                    </button>
                </li>
            </ul>
            {% include 'main_search_form.html' %}
        </div>
    </div>
</nav>
