<header class="masthead mb-auto">
    <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
      <a class="navbar-brand" href="/">REALNET</a>
      <button class="navbar-toggler" 
              type="button" 
              data-toggle="collapse" 
              data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>
      <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav mr-auto">
          {% for app in apps %}
            {% if active_app_name == app.name | lower %}
            <li class="nav-item active">
              <a class="nav-link" href="/{{app.name | lower}}">{{app.name}}</a>
            </li>
            {% else %}
            <li class="nav-item">
              <a class="nav-link" href="/{{app.name | lower}}">{{app.name}}</a>
            </li>
            {% endif %}
          {% endfor %}
        </ul>
        <ul class="nav navbar-right">
          <li class="nav-item dropdown endpoint-inline my-2 my-lg-0">
            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
              {{account.name}}@{{org.name}}
            </a>
            <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownMenuLink">
              <a class="dropdown-item" href="#" id="location"></a>
              {% for menu_item in menu_items %}
              <a class="dropdown-item" href="./views/{{menu_item.name}}"><i class="material-icons">{{menu_item.icon}}</i>{{menu_item.name}}</a>
              {% endfor %}
              <a class="dropdown-item" href="#" id="logout"><i class="material-icons">lock</i>Logout</a>
            </div>
          </li>
        </ul>
        </div>
    </nav>
  </header>