{# this file is the bridge between adminlte3 and flask-admin template 

  Every block in `flask-admin/base.html` should be nested
  in a block from `BASE_TEMPLATE`
#}

{% extends config.BASE_TEMPLATE %}
{% import 'admin/layout.html' as layout with context -%}
{% import 'admin/static.html' as admin_static with context %}
{% import 'flask-admin/static.html' as adminlte_static with context %}

{% block title %}{{admin_view.name}} | {{super()}}{%endblock%}

{% block stylesheets %}
  {{super()}}
    <!--| admin/adminlte3-full.html |-->
  {% block head_css %}
    {%if config.ASSETS_ADMIN_CSS%}
      {# assets config.ASSETS_ADMIN_CSS %}<link rel="stylesheet" href="{{ ASSET_URL }}" />{%endassets#}
    {%else%}
      <!-- Google Font: Source Sans Pro -->
      <link href="{{ admin_static.url(filename='admin/css/bootstrap4/admin.css', v='1.1.1') }}" rel="stylesheet">
      <link href="{{ admin_static.url(filename='bootstrap/bootstrap4/css/font-awesome.min.css', v='4.7.0') }}" rel="stylesheet">
      <link href="{{ admin_static.url(filename='admin/css/bootstrap4/submenu.css') }}" rel="stylesheet">
    {%endif%}
    {% if admin_view and admin_view.extra_css %}
      {% for css_url in admin_view.extra_css %}
        <link href="{{ css_url }}" rel="stylesheet">
      {% endfor %}
    {% endif %}
  <style>
    .hide {
        display: none;
    }
  </style>
  {% endblock head_css %}
  <!--|END|-->

{% endblock stylesheets %}

{%block page_header %}{%endblock%}

{% block page_content %}
  {% set render_ctx = h.resolve_ctx() %}
  {% block body %}
  {% endblock body %}
{% endblock page_content %}

{% block messages %}
  {# TODO: uncomment this if toastr is disabled #}
  {% if not toastr %}
    {{ layout.messages() }}
  {% endif %}
{% endblock messages %}

{% block javascripts %}
  {{super()}}
  <!--| admin/adminlte3-full.html |-->
  {% block tail_js %}
    {%if config.ASSETS_ADMIN_JS%}
      {# assets config.ASSETS_ADMIN_JS %}<script type="text/javascript" src="{{ ASSET_URL }}"></script>{%endassets#}
    {%else%}
      <script src="{{ admin_static.url(filename='bootstrap/bootstrap4/js/popper.min.js') }}" type="text/javascript"></script>
      <!--script src="{{ admin_static.url(filename='vendor/jquery.min.js', v='2.1.4') }}" type="text/javascript"></script-->
      <!--script src="{{ admin_static.url(filename='bootstrap/bootstrap4/js/bootstrap.min.js', v='4.2.1') }}" type="text/javascript"></script-->
      <script src="{{ admin_static.url(filename='vendor/moment.min.js', v='2.9.0') }}" type="text/javascript"></script>
      <script src="{{ admin_static.url(filename='vendor/bootstrap4/util.js', v='4.3.1') }}" type="text/javascript"></script>
      <script src="{{ admin_static.url(filename='vendor/bootstrap4/dropdown.js', v='4.3.1') }}" type="text/javascript"></script>
      <script src="{{ admin_static.url(filename='vendor/select2/select2.min.js', v='4.2.1') }}" type="text/javascript"></script>
    {%endif%}
    {% if admin_view and admin_view.extra_js %}
      {% for js_url in admin_view.extra_js %}
        <script src="{{ js_url }}" type="text/javascript"></script>
      {% endfor %}
    {% endif %}

  {% endblock tail_js %}

  {% block tail%}
  {% endblock %}
  <!--|END|-->

{% endblock javascripts %}