{% import "::blocks/utility/banners.html.twig" as banners %}

<!DOCTYPE html>
<html lang="{{ getISOLang(getDomainParameter('locale')) }}">

    <head>
        {% block head -%}

            {% block SEO %}
                {{ generateSEOFromContent( customContentHomePage(true) ) }}
            {% endblock %}

            <link rel="icon" type="image/x-icon" href="{{ asset(getParameter('domain.favicon') ?: 'favicon.ico') }}"/>

            {% include '::head.html.twig' -%}

            {% spaceless %}
                {% block stylesheets %}
                    {% stylesheets
                    filter='cssrewrite'
                    output='assets/default/css/style.css'
                    '%kernel.root_dir%/Resources/themes/default/assets/less/theme.less'
                    'assets/js/lib/owl-carousel/*.css'
                    'assets/css/smartbanner/*.css'
                    '%kernel.root_dir%/Resources/themes/default/css/*.css' %}
                    <link href="{{ asset_url }}" rel="stylesheet"/>
                    {% endstylesheets %}
                {% endblock -%}
            {% endspaceless %}

            <link href="{{ asset(getDomainParameter('path') ~ 'theme/default/colorscheme.css') }}" rel="stylesheet"/>

            {% if file_exists(getDomainParameter('path') ~ 'theme/default/csseditor.css') -%}
                <link href="{{ asset(getDomainParameter('path') ~ 'theme/default/csseditor.css') }}" rel="stylesheet"/>
            {% endif -%}

            {{ googleTagAnalytics() }}
        {% endblock -%}
    </head>

    <body>

        {# Invisible tags for body content -#}
        {% include '::body.html.twig' -%}

        {% block nav -%}
            {% include '::blocks/navigation/navbar.html.twig' with { "searchButton" : true } -%}
        {% endblock -%}


        {% block subheader -%}
            {# Top search bar -#}
            {% include '::blocks/search-header.html.twig' -%}

        {% endblock -%}


        {% if app.session.flashbag.has('notice') -%}
            {% include '::blocks/alert.html.twig' -%}
        {% endif -%}

        {% block topbanner -%}
            {{ banners.top() }}
        {% endblock -%}

        {% block body -%} {# Main Content -#} {% endblock -%}

        {% block bottombanners -%}
            {{ banners.bottom() }}
        {% endblock -%}

        {% block footer -%}
            {{ include("::blocks/footer.html.twig") }}
        {% endblock -%}

        {# Scripts -#}
        {% block scripts -%}

            {% javascripts
            output='js/minified.js'
            'assets/js/scripts.js'
            'assets/js/*.js' -%}
            <script src="{{ asset_url }}"></script>
            {% endjavascripts -%}

            <script src="{{ asset('bundles/fosjsrouting/js/router.js') }}"></script>
            <script src="{{ path('fos_js_routing_js', {'callback': 'fos.Router.setData'}) }}"></script>

            <script>

                {# uncomment it if you wanna debug in jsrender
                $.views.tags({
                    debug: function(obj) {
                        console.log(obj);
                    }
                });-#}

                {# changes JsRender delimiters -#}
                $.views.settings.delimiters('<%', '%>');
            </script>

            {{ smartBannerAndroid() }}
            {{ addJSFile('assets/js/lib/smartbanner/jquery.smartbanner.js') }}

            {{ renderJS() }}
        {% endblock -%}

        {#Messages Templating-#}
        <script id="alert-message" type="text/x-jsrender">
            <span class="alert alert-<%:type%>" role="alert">
                <i class="fa fa-warning"></i>
                <%:message%>
            </span>


        </script>
    </body>

</html>
