{% load i18n %}

<div id="top_page" class="navbar navbar-static-top accounts">
	<div class="navbar-inner">

        {# This is used in mobile view #}
	    <a class="btn btn-navbar" data-toggle="collapse" data-target=".account-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </a>

        <div class="nav-collapse account-collapse">
            <div class="container-fluid">
                {% if LANGUAGES|length > 1 %}
                    <form id="language_selector" class="pull-left navbar-form" action="/i18n/setlang/" method="post">
                        {% csrf_token %}
                        <select name="language">
                            {% for language in LANGUAGES %}
                            <option value="{{ language.0 }}" {% if LANGUAGE_CODE == language.0 %}selected="selected"{% endif %}>{{ language.1 }}</option>
                            {% endfor %}
                        </select>
                        <button class="btn" type="submit">Go</button>
                    </form>
                {% endif %}
                <ul class="nav pull-right">
                    {% if user.is_authenticated %}
                        <li>
                            <a href="{% url customer:summary %}"><i class="icon-user"></i> {% trans "Account" %}</a>
                        </li>
                        <li>
                            <a href="{% url customer:notifications-inbox %}">
                                <i class="icon-envelope"></i> {% trans "Notifications" %}
                                {% if num_unread_notifications > 0 %}
                                    <span class="label label-important">{{ num_unread_notifications }}</span>
                                {% endif %}</a>
                        </li>
                        {% if user.is_staff %}
                            <li><a href="{% url dashboard:index %}"><i class="icon-list-ul"></i> {% trans "Dashboard" %}</a></li>
                        {% endif %}
                        <li><a href="{% url customer:logout %}"><i class="icon-signout"></i> {% trans "Logout" %}</a></li>
                    {% else %}
                        <li><a href="{% url customer:login %}"><i class="icon-signin"></i> {% trans "Login or register" %}</a></li>
                    {% endif %}
                </ul>
            </div>
		</div>

    </div>
</div>
