<nav class="navbar navbar-expand-lg navbar-dark bg-dark py-0">
  <a class="navbar-brand" href="{{! base }}">
    <!-- Replace with your logo. Just specify height, not width. -->
    <img height="36" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkAQAAAADJe6U1AAAABGdBTUEAALGPC/xhBQAAAAJ0Uk5TAAB2k804AAAANUlEQVR42mNgwAX4/x8AkvZgsh5M/geTP8CyH0ggP1BKMoLIH8wfwG54AHbPA7jb+P9jcz0AKpcxBQbNJ8sAAAAASUVORK5CYII=" alt="Logo">
    <span class="text-uppercase">{{ appname }}</span>
  </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">
    <!-- Navbar left -->
    <ul class="navbar-nav mr-auto">
      <li class="nav-item active">
        <a class="nav-link" href="{{! base }}">Home <span class="sr-only">(current)</span></a>
      </li>
      <li class="nav-item dropdown">
        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
          Dropdown
        </a>
        <div class="dropdown-menu" aria-labelledby="navbarDropdown">
          <a class="dropdown-item" href="#">Action</a>
          <a class="dropdown-item" href="#">Another action</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="#">Something else here</a>
        </div>
      </li>
    </ul>
    <!-- Navbar middle -->
    <div class="navbar-nav mr-auto">
      <span class="nav-item nav-link active text-uppercase h5 mb-0">Dashboard</span>
    </div>
    <!-- Navbar right -->
    <div class="navbar-nav mr-2">
      {%! if handler.current_user %}
        <a class="nav-item nav-link" href="{{! base }}/login/" title="Log in again" data-placement="bottom">
          {{! handler.current_user.id }}
        </a>
        <a class="nav-item nav-link" href="{{! base }}/logout/" title="Log out" data-placement="bottom"><span class="fas fa-arrow-right bg-light round text-dark p-1"></span></a>
      {%! else %}
        <a class="nav-item nav-link" href="{{! base }}/login/" title="Log in again" data-placement="bottom">
          Log in
        </a>
      {%! end %}
    </div>
    <form class="form-inline my-2 my-lg-0">
      <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
      <button class="btn btn-light my-2 my-sm-0" type="submit">Search</button>
    </form>
  </div>
</nav>
