      <div class="navbar-collapse justify-content-end" id="loginNavbar">
        <ul class="navbar-nav">
          <li class="nav-item dropdown">
            {% if request.user.is_staff %}
            <a class="nav-link dropdown-toggle" href="#" role="button" id="dropdownLogin" data-bs-toggle="dropdown" aria-expanded="false">
              Welcome back, <strong>{{ request.user }}</strong>
            </a>
            <ul class="dropdown-menu" aria-labelledby="dropdownLogin">
              <li><a class="dropdown-item" href="{% url 'admin:roster_rollingstock_changelist' %}">Rolling stock</a></li>
              <li><a class="dropdown-item" href="{% url 'admin:consist_consist_changelist' %}">Consists</a></li>
              <li><a class="dropdown-item" href="{% url 'admin:app_list' 'metadata' %}">Metadata</a></li>
              <li><a class="dropdown-item" href="{% url 'admin:portal_flatpage_changelist' %}">Pages</a></li>
              <li><a class="dropdown-item" href="{% url 'admin:app_list' 'bookshelf' %}">Bookshelf</a></li>
              <li><hr class="dropdown-divider"></li>
              <li><a class="dropdown-item" href="{% url 'admin:index' %}">Admin</a></li>
              <li><a class="dropdown-item" href="{% url 'admin:portal_siteconfiguration_changelist' %}">Site configuration</a></li>
              <li><a class="dropdown-item" href="{% url 'admin:driver_driverconfiguration_changelist' %}">DCC configuration</a></li>
              <li><hr class="dropdown-divider"></li>
              <li><a class="dropdown-item text-danger" href="{% url 'admin:logout' %}?next={{ request.path }}">Logout</a></li>
            </ul>
            {% else %}
            <a class="nav-link" href="{% url 'admin:login' %}?next={{ request.path }}">Log in</a>
            {% endif %}
          </li>
          <li class="nav-item dropdown">
            <a class="theme-icon-active nav-link dropdown-toggle" href="#" role="button" id="bd-theme" data-bs-toggle="dropdown" aria-expanded="false">
              <i class="bi bi-circle-half"></i>
            </a>
            <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="bd-theme">
              <li>
                <button class="theme-icon dropdown-item" data-bs-theme-value="light" aria-pressed="false">
                  <span class="me-2"><i class="bi bi-sun-fill"></i></span> Light
                </button>
              </li>
              <li>
                <button class="theme-icon dropdown-item" data-bs-theme-value="dark" aria-pressed="false">
                  <span class="me-2"><i class="bi bi-moon-stars-fill"></i></span> Dark
                </button>
              </li>
              <li>
                <button class="theme-icon dropdown-item" data-bs-theme-value="auto" aria-pressed="false">
                  <span class="me-2"><i class="bi bi-circle-half"></i></span> Auto
                </button>
              </li>
            </ul>
          </li>
        </ul>
      </div>
