{% load i18n %}
{% load utils %}
    <ul class="nav navbar-nav navbar-right">
      {% if lava.instance_name %}
      <li class="hidden-sm"><p class="navbar-text">Instance: {{ lava.instance_name }}</p></li>
      {% endif %}
      {% if user.is_authenticated %}
      <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="glyphicon glyphicon-user"></span> {{ user.get_full_name|default:user.username }} <b class="caret"></b></a>
        <ul class="dropdown-menu">
          <li><a href="{% url 'lava.me' %}"><span class="glyphicon glyphicon-cog"></span> Profile</a></li>
          <li><a href="{% url 'lava.scheduler.myjobs' %}"><span class="glyphicon glyphicon-tasks"></span> Jobs</a></li>
          <li><a href="{% url 'lava.scheduler.favorite_jobs' %}"><span class="glyphicon glyphicon-tasks"></span> Favorite Jobs</a></li>
          <li><a href="{% url 'lava.scheduler.mydevice_list' %}"><span class="glyphicon glyphicon-phone"></span> Devices</a></li>
          <li><a href="{% url 'lava.scheduler.mydevices_health_history_log' %}"><span class="glyphicon glyphicon-time"></span> Devices Health History</a></li>
          {% if user.is_staff %}
          <li class="divider"></li>
          <li><a href="{% url 'admin:index' %}"><span class="glyphicon glyphicon-fire"></span> Administration</a></li>
          {% endif %}
          <li class="divider"></li>
          <li><a href="{% url 'logout' %}?next={% url 'lava.home' %}"><span class="glyphicon glyphicon-off"></span> Sign out</a></li>
        </ul>
      </li>
      {% else %}
      <li><p class="navbar-text">
      {% if request.get_full_path == "/accounts/logout/" %}
        <a href="{% url 'login' %}">{% trans "Sign In" %}</a>
       {% else %}
        <a href="{% url 'login' %}?next={{request.get_full_path}}">{% trans "Sign In" %}</a>
       {% endif %}
      </p></li>
      {% endif %}
    </ul>

