<!doctype html>

<html lang="{{ config('app.locale') }}">

<head>
    {% include "qcr.theme.qcr::partials/metadata" %}
</head>

<body id="skrollr-body">

{% include template.theme.header %}

<div class="container">
    {% include "qcr.theme.qcr::partials/messages" %}
</div>

{% if not post.id %}

    {% do template.set('meta_title', variable_value('posts', 'title', 'News & Updates')) %}
    {% do template.set('meta_description', variable_value('posts', 'description', 'Stay up to date with news & tips')) %}

    {% include "qcr.theme.qcr::grids/alternate_banner" %}
{% elseif post.id and not post.blocks.has('*_banner_block') %}

    {% do template.set('meta_title', variable_value('posts', 'title', 'News & Updates')) %}
    {% do template.set('meta_description', variable_value('posts', 'description', 'Stay up to date with news & tips')) %}

    {% include "qcr.theme.qcr::grids/alternate_banner" %}
{% elseif post.id and post.blocks.has('*_banner_block') %}
    {% for block in page.blocks %}
        {% if str_is('*_banner_block', block.extension.value.slug) %}
            {{ block.render()|raw }}
        {% endif %}
    {% endfor %}
{% endif %}

<main id="main" class="posts-layout">

    <div id="content">
        {% block content %}{% endblock %}
    </div>

    {% include "qcr.theme.qcr::grids/poster" with {
        'title': variable_value('posts', 'poster_title'),
        'image': variable('posts', 'poster_image') ?: (template.theme.poster ?: 'qcr.theme.qcr::img/bottom-bg.jpg')
        } %}
</main>

{% include "qcr.theme.qcr::partials/footer" %}
{% include "qcr.theme.qcr::partials/modals" %}
{% include "qcr.theme.qcr::partials/assets" %}

</body>
</html>
