{% load staticfiles i18n %}
{% load admin_urls %}
{% load avatar_tags %}

<div class="item">
    <a href="{% url 'home' %}">
        <img class="ui large image item" src="{% static 'images/logo-souschef-coul.png' %}" title="{% trans "Logo Sous-Chef" %}"/>
    </a>
</div>
{% if request.user %}
<div class="item loggedin-user">
    <a href="{% url 'avatar_change' %}">
      {% avatar user 80 class="ui tiny left floated circular image" id="user_avatar" %}
    </a>
    <h4 class="ui header name">
        {{ request.user.first_name }} <span class="sub-name">({{ request.user.username }})</span>
    </h4>
    <p class="ui roles">{% for group in request.user.groups.all %}
        <span class="ui label role">{{ group }}</span>
    {% endfor %}</p>
</div>
{% endif %}
<div class="item">
    <a class="item" href="{% url 'member:list'%}?status={{ CLIENT_FILTER_DEFAULT_STATUS | urlencode }}">{% trans 'Clients' %}
        <div class="ui label">{{ CLIENTS_TOTAL }}</div>
    </a>

    <div class="item">
        <form action="{% url 'member:list' %}" method="get">
            <div class="ui icon transparent inverted input" style="display: block;">
                <input type="text" name="name" placeholder="Search client...">
                <i class="search icon"></i>
            </div>
        </form>
    </div>
    <a class="item" href="{% url 'order:list' %}?status={{ ORDER_FILTER_DEFAULT_STATUS | urlencode }}&amp;delivery_date={{ ORDER_FILTER_DEFAULT_DATE | date:'Y-m-d' | urlencode }}">{% trans 'Orders' %}
        <div class="ui label">{{ ORDERS_TOTAL }}</div>
    </a>
    <a class="item" href="{% url 'note:note_list' %}?is_read={{ NOTE_FILTER_DEFAULT_IS_READ | urlencode }}">{% trans 'Staff Notes' %}
        <div class="ui label">{{ NOTES_TOTAL }}</div>
    </a>

    <a class="item" href="{% url 'member:route_list' %}">{% trans 'Routes' %}
        <div class="ui label">{{ ROUTES_TOTAL }}</div>
    </a>
</div>

<div class="item">
    <a class="item" href="{% url 'delivery:order' %}"><i class="food icon"></i>{% trans 'Kitchen Count' %}</a>
    <a class="item" href="{% url 'billing:list' %}"><i class="dollar icon"></i>{% trans 'Billing' %}</a>
    {% if request.user.is_superuser %}<a class="item" href="{% url 'admin:index' %}"><i class="settings icon"></i>{% trans 'Admin' %}</a>{% endif %}
    <!-- The archive link is served by nginx and will not work in a development setup. -->
    <!-- It contains previously generated kitchen counts, labels and route reports. -->
    <a class="item" href="/archive/?C=M&O=D" target="_blank"><i class="folder icon"></i>{% trans 'Archive' %}</a>
    <a href="{% url 'page:logout' %}" class="item"><i class="sign out icon"></i>{% trans 'Logout' %}</a>
</div>
<div class="item">
    <strong class="ui center aligned container" style="color:aqua;">
        {{ SC_ENVIRONMENT_NAME }} {{ SC_VERSION }}
    </strong>
</div>
