{% load static %}
<div id="user_menu" class="menu">
    <div id="menu_username">
        {% if online_status and settings.SOSSE_ONLINE_SEARCH_REDIRECT %}
            {% if online_status == 'online' %}
                <div id="online_status" style="display: inline" title="Online">
                    <svg height="12" width="12">
                        <circle cx="6" cy="6" r="6" stroke="#96dd6f" stroke-width="1" fill="#78b159" />
                    </svg>
                </div>
            {% elif online_status == 'offline' %}
                <div id="online_status" style="display: inline" title="Offline">
                    <svg height="12" width="12">
                        <circle cx="6" cy="6" r="6" stroke="#fddc92" stroke-width="1" fill="#fdcb58" />
                    </svg>
                </div>
            {% endif %}
        {% endif %}
        {% if user.has_usable_password %}
            {% firstof user.get_short_name user.get_username %}
        {% endif %}
    </div>
    <button class="menu_button img_button" id="user_menu_button" title="User"></button>
    <div id="user_menu_panel" class="panel">
        <a href="{% url "profile" %}" class="links menu_links">Profile</a>
        <a href="{% url "resources" %}" class="links menu_links">Resources</a>
        {% if user.is_active %}
            <a href="{% url 'logout' %}" class="links menu_links">Log out</a>
        {% else %}
            <a href="{% url 'login' %}" class="links menu_links">Log in</a>
        {% endif %}
    </div>
</div>
{% if user.is_active and user.is_staff %}
    <div id="conf_menu" class="menu">
        <button class="menu_button img_button" id="conf_menu_button" title="Configuration"></button>
        <div id="conf_menu_panel" class="panel">
            <a href="{% url 'admin:index' %}" class="links menu_links">Administration</a>
            <a href="{% url 'admin:queue' %}" class="links menu_links">Crawl a new url</a>
            <a href="{% url 'admin:crawl_queue' %}" class="links menu_links">Crawl queue</a>
            <a href="{% url 'admin:analytics' %}" class="links menu_links">Analytics</a>
        </div>
    </div>
{% endif %}
