{% extends "base.html" %}
{% load static %}
{% load i18n %}

{% block title-site %}Dashboard | CIRCLE{% endblock %}


{% block extra_link %}
  {% block extra_link_2 %}{% endblock %}
{% endblock %}


{% block navbar %}
{% if request.user.is_authenticated and request.user.pk and not request.token_user %}

  <span id="user-options" data-desktop_notifications="{{ request.user.profile.desktop_notifications }}"><span>

  <ul class="nav navbar-nav navbar-right" id="dashboard-menu">
    {% if request.user.is_superuser %}
    {% if ADMIN_ENABLED %}
    <li>
      <a href="/admin/">
        <i class="fa fa-cogs"></i>
        <span class="hidden-sm">{% trans "Admin" %}</span>
      </a>
    </li>
    <li>
      <a href="/rosetta/">
        <i class="fa fa-space-shuttle"></i>
        <span class="hidden-sm">{% trans "Translations" %}</span>
      </a>
    </li>
    {% endif %}
    <li>
      <a href="{% url "dashboard.views.message-list" %}">
        <i class="fa fa-bullhorn"></i>
        <span class="hidden-sm">{% trans "Messages" %}</span>
      </a>
    </li>
    <li>
      <a href="{% url "dashboard.views.storage" %}">
        <i class="fa fa-database"></i>
        <span class="hidden-sm">{% trans "Storage" %}</span>
      </a>
    </li>
    <li>
      <a href="{% url "network.index" %}">
        <i class="fa fa-globe"></i>
        <span class="hidden-sm">{% trans "Network" %}</span>
      </a>
    </li>
    <li>
      <a href="{% url "request.views.request-list" %}">
        <i class="fa fa-phone"></i>
        <span class="hidden-sm">{% trans "Requests" %}</span>
      </a>
    </li>
    {% endif %}
    <li>
      <a href="{% url "dashboard.views.profile-preferences" %}">
        <i class="fa fa-user"></i>
        {% include "dashboard/_display-name.html" with user=request.user show_org=True %}
      </a>
    </li>
    <li>
      <a href="{% url "logout" %}?next={% url "login" %}">
        <i class="fa fa-sign-out"></i> {% trans "Log out" %}
      </a>
    </li>
    <li class="visible-xs">
      <a href="{% url "dashboard.views.notifications" %}">
        {% trans "Notifications" %}
        {% if NEW_NOTIFICATIONS_COUNT > 0 %}
          <span class="badge badge-pulse">{{ NEW_NOTIFICATIONS_COUNT }}</span>
        {% endif %}
      </a>
    </li>
    <li class="dropdown hidden-xs" id="notification-button">
      <a href="{% url "dashboard.views.notifications" %}"
        class="dropdown-toggle" data-toggle="dropdown"
        id="notification_count" data-notifications="{{ NEW_NOTIFICATIONS_COUNT }}">
        {% trans "Notifications" %}
        {% if NEW_NOTIFICATIONS_COUNT > 0 %}
          <span class="badge badge-pulse">
            {{ NEW_NOTIFICATIONS_COUNT }}
          </span>
        {% endif %}
      </a>
      <ul class="dropdown-menu" id="notification-messages">
        <li>{% trans "Loading..." %}</li>
      </ul>
    </li>
    <li class="hidden-xs">
      <a href="{% url "dashboard.views.profile-preferences" %}">
        <!--<img class="profile-avatar" src="{{ request.user.profile.get_avatar_url }}" /> -->
      </a>
    </li>
  </ul>

{% else %}
  <a class="navbar-brand pull-right" href="{% url "login" %}?next={{ request.path }}"><i class="fa fa-sign-in"></i> {% trans "Log in " %}</a>
{% endif %}

{% endblock %}
