{% apply spaceless %}
{% set loaderHtml = include(aa_admin_loader_path) %}
{% set entitySlug = app.request.entitySlug|default() %}
{% set action = app.request.action|default() %}
{% endapply %}<!DOCTYPE html>
<html lang="fr">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

  <title>{% block meta_title %}Admin - {{ aa_admin_sitename() }}{% endblock %}</title>

  <meta name="description" content="{% block meta_description %}Admin - {{ aa_admin_sitename() }}{% endblock %}">
  <meta name="author" content="{% block meta_author %}GDA{% endblock %}">

  {% block stylesheets %}
    {% for css in aa_admin_config.assets.css|default([]) %}
      <link rel="stylesheet" href="{{ css|gda_cache_suffix_add }}"/>
    {% endfor %}
  {% endblock %}

  {% block head_bottom %}{% endblock %}
</head>
<body class="{% block body_css_classes %}{% endblock %}" data-loader="{{ loaderHtml|e('html') }}">
{% block body %}
  <div id="wrapper">
    {% block sidebar %}
      {% include '@AutoAdminAdmin/_partials/_sidebar.html.twig' %}
    {% endblock %}
    {% set mainTitle %}
      {% if (mainTitle is defined and mainTitle is not empty) %}
        {{ mainTitle }}
      {% elseif app.request.get('_route') == 'aa_admin_entity' and aa.entity is defined and aa.entity is not empty %}
        {{ aa.entity.config.name|default(aa.entity.slug)|default(aa.entity.config.class) }}
      {% else %}
        {{ 'Override {{ mainTitle }} twig variable or define entity slug.' }}
      {% endif %}
    {% endset %}
    {% set actionTitle %}
      {% if actionTitle is defined and actionTitle is not empty %}
        {{ actionTitle|default('') }}
      {% elseif aa is defined and aa is not empty and aa.entity is not empty %}
        {{ aa.entity.config.actions[aa.entity.action].name|default('') }}
      {% endif %}
    {% endset %}
    <div id="content-wrapper" class="d-flex flex-column">
      <div id="content">
        <nav class="main-navbar navbar navbar-light bg-white">
          {% block main_title_wrap %}
            <div class="main-title-wrap">
              <h1 class="content-title">{% block main_title %}{{ mainTitle|default() }}{% endblock %}</h1>
            </div>
          {% endblock %}

          <div class="navbar-nav ml-auto navbar-top-right">
            {% block navbar_top_right %}{% endblock %}
          </div>
        </nav>

        {% block page_content %}
          <div class="container-fluid">
            {% block page_inner %}{% endblock %}
          </div>
        {% endblock %}

      </div>
      {% if 'DashboardController' in app.request.attributes.get("_controller") %}
        {% include "@AutoAdminAdmin/_partials/_footer.html.twig" %}
      {% endif %}
    </div>

  </div>
{% endblock %}

{% block layout_utils %}
  {% include "@AutoAdminAdmin/_partials/_scroll-top.html.twig" %}
  {% include "@AutoAdminAdmin/_partials/_toast.html.twig" %}
  {% include "@AutoAdminAdmin/_partials/components/modals/modale_prevent.html.twig" %}
  {% include "@AutoAdminMedia/library/library.html.twig" %}
{% endblock %}

{% block javascript %}
  {% for js in aa_admin_config.assets.js|default([]) %}
    <script type="text/javascript" src="{{ js|gda_cache_suffix_add }}" defer></script>
  {% endfor %}
{% endblock %}
</body>

</html>
