{% load branding i18n %}
{% load url from future %}
{% load context_selection %}

<nav class="navbar navbar-default">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
        <span class="sr-only">{% trans "Toggle navigation" %}</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="{% site_branding_link %}">
        <span class="openstack-logo"></span>
        {% site_branding %}
      </a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="navbar-collapse">
      <ul class="nav navbar-nav">
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
            {% show_overview %}
            <b class="caret"></b>
          </a>
          {% show_domain_list %}
          {% show_project_list %}
          {% show_region_list %}
        </li>
      </ul>

      {% include "horizon/common/_region_selector.html" %}

      <ul class="nav navbar-nav navbar-right">
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
            <span class="fa fa-user"></span>
            {{ request.user.username }}
            <b class="caret"></b>
          </a>
          <ul id="editor_list" class="dropdown-menu">
            <li>
              <a href="{% url 'horizon:settings:user:index' %}">
                <span class="fa fa-cog"></span>
                {% trans "Settings" %}
              </a>
            </li>
            {% if HORIZON_CONFIG.help_url %}
              <li>
                <a href="{{ HORIZON_CONFIG.help_url }}" target="_blank">
                  <span class="fa fa-question-circle"></span>
                  {% trans "Help" %}
                </a>
              </li>
            {% endif %}
            <li class="divider"></li>
            <li>
              <a href="{% url 'logout' %}">
                <span class="fa fa-sign-out"></span>
                {% trans "Sign Out" %}
              </a>
            </li>
          </ul>
        </li>
      </ul>
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>
