{% load i18n static cosinnus_tags thumbnail %}

<li id="searchbar">
    <form id="cosinnus_search_form" action="{% url "cosinnus:search" %}" method="GET">
        <input class="form-control" placeholder="{% trans "Search..." %}" value="" name="q" />
        <i class="fa fa-search" onclick="$('#cosinnus_search_form').submit();" title="{% trans "Search" %}"></i>
    </form>
</li>
{% if request.user.is_authenticated %}
    <li>
        <a href="{% url 'postman:inbox' %}" title="{% trans "Messages" %}">
            <i class="fa fa-envelope"></i>
            {% if COSINNUS_UNREAD_MESSAGE_COUNT and COSINNUS_UNREAD_MESSAGE_COUNT > 0 %}
               <span id="messageCounter">{{ COSINNUS_UNREAD_MESSAGE_COUNT }}</span>
            {% endif %}
            <span class="visible-xs-inline">&nbsp;{% trans "Messages" %}</span>
        </a>
    </li>
    <li>
        <a href="{% url 'cosinnus:my_stream' %}" title="{% trans "My Stream" %}">
            <i class="fa fa-globe"></i>
            {% if COSINNUS_STREAM_UNSEEN_COUNT and COSINNUS_STREAM_UNSEEN_COUNT > 0 %}
               <span id="messageCounter">{{ COSINNUS_STREAM_UNSEEN_COUNT }}</span>
            {% endif %}
            <span class="visible-xs-inline">&nbsp;{% trans "My Stream" %}</span>
        </a>
    </li>
{% endif %}

{% block extra_navbar_icon_buttons %}{% endblock extra_navbar_icon_buttons %}

<li class="dropdown">
    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
        {{ request.LANGUAGE_CODE|upper }}
        <i class="fa fa-caret-down"></i>
    </a>
    <ul class="dropdown-menu">
        {% for code, language in SETTINGS.LANGUAGES %}
            <li><a href="{% url 'cosinnus:switch-language' language=code %}?next={{ request.path }}" {% if request.LANGUAGE_CODE == code %}style="font-weight:bold;"{% endif %}>{{ language }}</a></li>
        {% endfor %}
    </ul>
</li>
