{#
    LimeSurvey accessible vanilla
    Copyright (C) 2007-2018 Denis Chenu
    Copyright (C) 2007-2018 The LimeSurvey Project Team
    All rights reserved.
    License: GNU/GPL License v4 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    See https://github.com/LimeSurvey/LimeSurvey/blob/master/themes/survey/vanilla/views/layout_global.twig for general comment about LimeSurvey themes
    For this template : 
    - A11Y issue : https://gitlab.com/SondagesPro/SurveyThemes/accessible_vanilla/issues
    - Contribution are welcome : https://gitlab.com/SondagesPro/SurveyThemes/accessible_vanilla/merge_requests
    Remind A11Y issue can be reported to LimeSurvey core too : https://www.limesurvey.org/community/bug-tracker
#}<!DOCTYPE html>
<html lang="{{ aSurveyInfo.languagecode }}" dir="{{ aSurveyInfo.dir }}" class="{{ aSurveyInfo.languagecode }} dir-{{ aSurveyInfo.dir }} {{ aSurveyInfo.class.html }}" {{ aSurveyInfo.attr.html }}>
<!-- {{ aSurveyInfo.options.variation }} -->
    {% block head %}
    {# Headers, metadata, etc #}
    {{ include('./subviews/header/head.twig') }}
    {% endblock %}
    <body class="{% if(aSurveyInfo.options.bodyloaded == 'on' or not aSurveyInfo.options.bodyloaded) %}body-loading {% endif %}{{ aSurveyInfo.class.body }} lang-{{aSurveyInfo.languagecode}} {{aSurveyInfo.surveyformat}} {{ ( aSurveyInfo.options.brandlogo == "on") ? 'with-brand-logo' : '' }} {{ (aSurveyInfo.options.fixedheader == 'on') ? 'with-navbar-fixed-top' : '' }}" >
        <div id="{{ aSurveyInfo.id.dynamicreload }}">
            {% block body %}
                {# Bootstrap Navigation Bar: the top menu #}
                {% block nav_bar %}
                    {{ include('./subviews/header/nav_bar.twig') }}
                {% endblock %}

                <!-- Outer Frame Container -->
                {% block content %}
                    {#
                        Content depends on the action (survey, questions, register, assesments, submit, etc)
                        Action are in ./subviews/content/
                    #}
                    {% set sViewContent =  './subviews/content/' ~ aSurveyInfo.include_content ~ '.twig' %}
                    {% include './subviews/content/outerframe.twig' with {'include_content': sViewContent } %}
                {% endblock %}
                {% block bootstrap_modal %}
                {# Bootstrap alert modal #}
                {{ include('./subviews/messages/bootstrap_alert_modal.twig') }}
                {% endblock %}
            {% endblock %}
            {% block footer %}
                {{ include('./subviews/footer/footer.twig') }}
            {% endblock %}
        </div>
        {# This is not for ajax, but for page loading/unloading #}
        {{ include('./subviews/navigation/ajax_indicator.twig') }}
        {% block themescripts %}
            {% set skelOptions = {
                bodyLoaded: (aSurveyInfo.options.bodyloaded == 'on' or not aSurveyInfo.options.bodyloaded),
                removeBack: ((aSurveyInfo.options.removeback == 'on' or not aSurveyInfo.options.removeback) and aSurveyInfo.include_content == 'main'),
                }
            %}
            {% set accessibleOptions = {
                dynamicValidity: (aSurveyInfo.options.dynamicvalidity == 'on' or not aSurveyInfo.options.dynamicvalidity),
                }
            %}
            <script>
                if(window.basicThemeScripts === undefined){ 
                    window.basicThemeScripts = new ThemeScripts(); 
                } 
                basicThemeScripts.initGlobal(); 
                window.basicThemeScripts.init();
                window.TemplateAccessible.init({{ json_encode(accessibleOptions) }});
                window.skelVanilla.init({{ json_encode(skelOptions) }});
            </script>
        {% endblock %}
    </body>
</html>
