{% load staticfiles %}
{% load navigation %}
{% load hijack_tags %}
{% load render_bundle from webpack_loader %}
<!doctype html>
<html lang="en-gb">
<head>
    {% block pre_head %}{% endblock %}

    <title>{% page_title %}</title>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, user-scalable=no"/>

    <!--suppress HtmlUnknownTarget -->
    <link rel="manifest" href="/manifest.json">

    {# Global JS object to pass state from backend to frontend #}
    <script type="text/javascript">
        window.g = {{ global_json|safe }};
    </script>

    <!-- BUNDLE -->
    {% render_bundle 'lib' %}
    {% render_bundle 'app' 'css' %}
    {% render_bundle 'styles' %}

    {% include 'browser/head.html' %}

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

<body class="{% block body_class %}xsd{% endblock %}"
      id="{{ current_url.namespace }}-{{ current_url.url_name }}">

{% if request.user.is_authenticated %}{% app_nav %}{% endif %}

{{ request|hijackNotification }}

<div class="xsd-messages">
    {% if messages %}
        <ul class="xsd-messages__list">
            {% for message in messages %}
                <li class="xsd-messages__message xsd-messages__message--{{ message.tags }} xsd-messages__message--{{ message.level }}">
                    <div class="xsd-messages__message-inner">
                        <i class="xsd-messages__message-icon"></i>
                        {{ message }}
                    </div>
                </li>
            {% endfor %}
        </ul>
    {% endif %}
</div>

{% block breakout %}
    <div class="xsd-application-container">
        {% block content %}
            No content
        {% endblock %}
    </div>
{% endblock %}

{{ request|hijackNotification }}

{% block modals %}{% endblock %}

{% block closing_js %}{% endblock %}

<script type="text/javascript">
    $('.popover-button').popover();
    $('[data-toggle="popover"]').popover();
</script>

<span id="mq-detector">
    <span class="visible-xs"></span>
    <span class="visible-sm"></span>
    <span class="visible-md"></span>
    <span class="visible-lg"></span>
</span>

{% render_bundle 'app' 'js' %}

</body>

</html>
