{% load spirit_tags i18n %}

    <header class="header js-tabs-container">
		<a class="header-logo" href="{% url "spirit:index" %}">{{ config.site_name }}</a>

        {% if user.is_authenticated %}
            {% has_topic_notifications user as has_notifications %}

            <ul class="header-tabs">
                <li><a class="header-tab-link js-tab" href="{% url "spirit:search" %}" data-related=".js-search-content"><i class="fa fa-search"></i></a></li><!--
             --><li><a class="header-tab-link js-tab-notification{% if has_notifications %} is-highlighted{% endif %}" href="{% url "spirit:topic-notification-list" %}" data-related=".js-notifications-content"><i class="fa fa-bell"></i></a></li><!--
             --><li><a class="header-tab-link js-tab" href="{% url "spirit:user-menu" %}" data-related=".js-user-content">{{ user.username }} <i class="fa fa-chevron-down"></i></a></li>
            </ul>

            <div class="header-tabs-content">

                <div class="header-tab-content js-tab-content js-user-content">
                    <nav class="header-nav">
                        <ul class="menu">
                            <li><a class="menu-link" href="{% url "spirit:profile-detail" pk=user.pk slug=user.slug %}">{% trans "Profile" %}</a></li>
                            <li><a class="menu-link" href="{% url "spirit:topic-active" %}">{% trans "Topics" %}</a></li>
                            <li><a class="menu-link" href="{% url "spirit:topic-unread-list" %}">{% trans "Unread topics" %}</a></li>
                            <li><a class="menu-link" href="{% url "spirit:private-list" %}">{% trans "Private topics" %}</a></li>

                            {% if user.is_administrator %}
                                <li><a class="menu-link" href="{% url "spirit:admin" %}">{% trans "Admin" %}</a></li>
                            {% endif %}

                            <li><a class="menu-link js-post" href="{% url "spirit:user-logout" %}?next={% firstof request.get_full_path|urlencode '/' %}">{% trans "Log out" %}</a></li>
                        </ul>
                    </nav>
                </div>

                <div class="header-tab-content js-tab-content js-notifications-content"></div>

                <div class="header-tab-content js-tab-content js-search-content">
                    {% render_search_form %}
                </div>

            </div>
        {% else %}
            <a class="header-link" href="{% url "spirit:user-login" %}?next={% firstof request.get_full_path|urlencode '/' %}">{% trans "Log in" %}</a>
        {% endif %}
	</header>