{% load i18n %}
{% load rules %}

<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
    <div class="container">

        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="{% url 'home' %}">{{ request.site.name }}</a>
        </div>

        <div class="collapse navbar-collapse" id="navbar-collapse">
            <ul class="nav navbar-nav">

            </ul>

            <ul class="nav navbar-nav navbar-right">

                {% if user.is_authenticated %}

                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                        {{ user.profile.full_name }}<span class="caret"></span>
                    </a>
                    <ul class="dropdown-menu">
                        {% include 'core/base_navigation_account.html' %}
                        {% include 'core/base_navigation_management.html' %}
                        {% include 'core/base_navigation_admin.html' %}

                        <li>
                            {% include 'account/logout_form.html' %}
                        </li>
                    </ul>
                </li>

                {% else %}

                <li>
                    <a href="{% url 'account_login' %}">{% trans 'Login' %}</a>
                </li>

                {% endif %}

            </ul>
        </div>
    </div>
</nav>
