{% load static wagtailcore_tags wagtailimages_tags wagtailmetadata_tags %}

<!doctype html>
<html lang="cs">
  <head>
    {% if request.in_preview_panel %}
      <base target="_blank">
    {% endif %}

    <!-- Meta -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width"/>

    {% meta_tags %}

    {% if settings.MAJAK_ENV == "test" %}
      <meta name="robots" content="noindex, nofollow">
    {% endif %}

    <!-- Favicon -->
    {% include "shared/favicon_snippet.html" %}

    <!-- Styles -->
    <link rel="stylesheet" href="{% static 'styleguide2/main.css' %}">

    <!--TODO - Migrate to styleguide-->
    {% block styles %}{% endblock styles %}

    {% if page.root_page.matomo_id %}
      {% include "shared/matomo_snippet.html" with matomo_id=page.root_page.matomo_id %}
    {% endif %}

    {% if page.root_page.custom_css %}
      <style type="text/css">
        {{ page.root_page.custom_css }}
      </style>
    {% endif %}
  </head>

  <body class="__{{ page.content_type.model }}">
    {% include 'styleguide2/includes/organisms/layout/messages.html' %}

    {% block content %}{% endblock content %}

    {% if page.root_page.hide_footer is not True %}
      {% include 'styleguide2/includes/organisms/layout/footer.html' %}
    {% endif %}

    <script src="{% static 'styleguide2/main.js' %}"></script>

    <!--TODO - Migrate to styleguide-->
    {% include "maps_utils/includes/scripts.html" %}
    {% include "maps_utils/includes/styles.html" %}

    {% block scripts %}{% endblock scripts %}
  </body>
</html>