{% load i18n %}
<nav class="navbar navbar-expand-md fixed-top navbar-dark bg-dark">
    <div class="container">
        <a class="navbar-brand" href="{% url 'index_index' %}">{% trans 'dashboard' %}</a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-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 mr-auto">
                {% include "magplan/partials/_navbar_header_links.html" %}
            </ul>


            <div class="navbar-nav">
                <form class="form-inline" action="{% url 'articles_search' %}" method="post">
                    {% csrf_token %}
                    <input class="form-control mr-sm-2" type="search" placeholder="{% trans "search_articles" %}"
                           aria-label="Search"
                           name="search_query">
                    <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Искать!</button>
                </form>
            </div>
            <ul class="navbar-nav">
                <li class="nav-item dropdown ml-auto">
                    <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
                       data-toggle="dropdown"
                       aria-haspopup="true" aria-expanded="false">
                        {{ request.user.email }}
                    </a>
                    <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                        <a class="dropdown-item" href="{% url 'preferences_index' %}">Настройки</a>
                        <div class="dropdown-divider"></div>
{#                        <a class="dropdown-item"#}
{#                           href="{% url 'logout' %}?next={% url 'login' %}">{% trans "logout" %}</a>#}
                    </div>
                </li>
            </ul>

            <span class="navbar-text">

      </span>
        </div>
    </div>
</nav>
