{% extends "sqladmin/base.html" %}
{% from 'sqladmin/_macros.html' import display_menu %}
{% block body %}
<div class="wrapper">
  <aside class="navbar navbar-expand-lg navbar-vertical navbar-expand-md navbar-dark">
    <div class="container-fluid">
      <h1 class="navbar-brand navbar-brand-autodark">
        <a href="{{ url_for('admin:index') }}">
          {% if admin.logo_url %}
          <img src="{{ admin.logo_url }}" width="64" height="64" alt="Admin" class="navbar-brand-image" />
          {% else %}
          <h3>{{ admin.title }}</h3>
          {% endif %}
        </a>
      </h1>
      <nav class="navbar navbar-expand-sm" id="navbar-menu">
        <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">
          {{ display_menu(admin._menu, request) }}
        </div>
      </nav>
      {% if admin.authentication_backend %}
      <a href="{{ request.url_for('admin:logout') }}" class="btn btn-secondary btn-icon">
        <i class="fa fa-sign-out"></i>
        <span>Logout</span>
      </a>
      {% endif %}
    </div>
  </aside>
  <div class="page-wrapper">
    <div class="container-fluid">
      <div class="page-header d-print-none">
        {% block content_header %}
        <div class="row align-items-center">
          <div class="col">
            <h2 class="page-title">{{ title }}</h2>
            <div class="page-pretitle">{{ subtitle }}</div>
          </div>
        </div>
        {% endblock %}
      </div>
    </div>
    <div class="page-body flex-grow-1">
      <div class="container-fluid">
        <div class="row row-deck row-cards">
          {% block content %} {% endblock %}
        </div>
      </div>
    </div>
  </div>
</div>
{% endblock %}