<!DOCTYPE html>
{%- import 'crudlfap.html' as crudlfap %}
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="canonical" href="{{ view.url }}" />
    <link rel="icon" href="{{ static('favicon.ico') }}">

    <title>{% block title %}{{ view.title_html }}{% endblock %} {% if settings.SITE_TITLE %}- {{ crudlfap_site.title }}{% endif %}</title>

    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="https://fengyuanchen.github.io/viewerjs/css/viewer.css" />

    <meta name="turbolinks-root" content="{{ crudlfap_site.views['home'].url }}">

    <script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
    {% block bundles %}
      {% block style_bundle %}
      <link href="{{ static('crudlfap.css') }}" rel="stylesheet">
      {% endblock %}

      {% block script_bundle %}
      <script src="{{ static('crudlfap.js') }}" defer></script>
      {% endblock %}
    {% endblock %}

    {% block extra_style %}{% endblock %}
  </head>

  <body class="{% block body_class %}{{ view.body_class|default('') }}{% endblock %}">
    {% include 'crudlfap/_loader.html' %}
    {% include 'crudlfap/_menu_main.html' %}
    {% block breadcrumb %}{% endblock %}
    {% include 'crudlfap/_messages.html' %}
    {% block before_container %}{% endblock %}
    {% block content_open %}<div class="{% if view.body_class|default('') != 'full-width' %}container{% endif %}" id="modal-body-ajax">{% endblock %}
      {% block form_open %}{% endblock %}
        <div class="modal-content">
        {% block title_heading %}
          {% if view.title_heading and request.META.get('HTTP_X_MODAL') %}
          <h4
            class="text-{{ view.style|default('default') }} {% block title_heading_class %}{% endblock %}"
            id="modal-title-ajax"
          >{{ view.title_heading }}</h4>
          {% endif %}
        {% endblock %}
          {% block content %}{% block form %}{% endblock %}{% endblock %}
        </div>
        <div class="modal-footer">
          {% block buttons %}{% endblock %}
        </div>
      {% block form_close %}{% endblock %}

    {% block content_close %}</div>{% endblock %}

    <div id="modal" class="modal modal-fixed-footer"></div>

    {% block after_container %}
    <div class="fixed-actions">
      {{ crudlfap.dropdown(
        view.menu_views,
        'fixed-actions',
        class='btn btn-floating red',
        next=view.request.path_info
      ) }}
    </div>
    {% endblock %}
  </body>
</html>
