<div class="js-section">
{% set mobile = openform_front_util.isMobileDevice() %}
{% for section in sections|default([]) %}
{% if section is iterable %}
{# sekcja typu slider #}
{# public const SECTION_TYPE_COLUMNS = 'columns'; #}
{{ include('@openform_front_templates/_blocks_sections/_slider.html.twig') }}
{% else %}
{# inne sekcje #}
{# classType , w nim bedzie typ sekcji, bez kolumn, z kolumnami, z duzym zdjęciem #}
{# nazwy są takie
public const SECTION_TYPE_NORMAL = 'normal';
public const SECTION_TYPE_COLUMNS = 'columns';
public const SECTION_TYPE_BIG_LEFT = 'big_column_left';
public const SECTION_TYPE_BIG_RIGHT = 'big_column_right';
#}
{% set classType = section.type %}
{# ilość kolumn, gdy section.type === 'columns' ==> SECTION_TYPE_COLUMNS #}
{% set numCollumns = section.numCollumn %}
{% set blocks = openform_front_util.getSectionBlocks(section) %}
<div class="container block-container {{not mobile and classType != "columns" ? classType : not mobile and classType == "columns" and section.numCollumn > 1 ? classType }}{{ blocks|length == 0 ? ' hide' }}" style="background: {{section.sectionBackground|default('transparent') }}; {{ entity is defined and entity.mainContentPaddingTop is defined and entity.mainContentPaddingTop ? 'padding-top: ' ~ entity.mainContentPaddingTop ~ 'px;'}} {{ entity is defined and entity.mainContentPaddingBottom is defined and entity.mainContentPaddingBottom ? 'padding-bottom: ' ~ entity.mainContentPaddingBottom ~ 'px;'}}">
{% if section.Translation[app.request.locale].title %}
<div class="block__h2 block-container__title">{{section.Translation[app.request.locale].titleHtml|raw}}</div>
{% endif %}
<div class="block-container__blocks" {% if classType == "columns" and section.numCollumn and section.numCollumn > 1 and not mobile %}style="grid-template-columns: repeat({{ section.numCollumn }}, minmax(0, 1fr));"{% endif %}>
{% for block in blocks %}
{% if block.type == 'text' %}
{{ include('@openform_front_templates/_blocks_sections/_text.html.twig', {block: block}) }}
{% elseif block.type == 'text_with_image' %}
{{ include('@openform_front_templates/_blocks_sections/_text_image.html.twig', {block: block}) }}
{% elseif block.type == 'text_with_youtube' %}
{{ include('@openform_front_templates/_blocks_sections/_text_image.html.twig', {block: block}) }}
{% elseif block.type == 'news' %}
{{ include('@openform_front_templates/_blocks_sections/_news.html.twig', {block: block}) }}
{% elseif block.type == 'text_with_audio' %}
{{ include('@openform_front_templates/_blocks_sections/_text_audio.html.twig', {block: block}) }}
{% elseif block.type == 'faq' %}
{{ include('@openform_front_templates/_blocks_sections/_faq.html.twig', {block: block}) }}
{% elseif block.type == 'gallery' %}
{{ include('@openform_front_templates/_blocks_sections/_gallery.html.twig', {block: block, count: mobile ? 1 : (classType !='normal' ? blocks|length >= 4 ? 1 : blocks|length == 3 ? 1 : blocks|length == 2 ? 1 : blocks|length == 1 and classType =='big_column_right' or classType == 'big_column_left' ? 1 : 3 : 3)}) }}
{% elseif block.type == 'logotypes' %}
{{ include('@openform_front_templates/_blocks_sections/_logotypes.html.twig', {block: block, count: classType !='normal' ? blocks|length >= 4 ? 2 : blocks|length == 3 ? 3 : blocks|length == 2 ? 4 : blocks|length == 1 and classType =='big_column_right' or classType == 'big_column_left' ? 3 : 7 : 7 }) }}
{% elseif block.type == 'links' %}
{{ include('@openform_front_templates/_blocks_sections/_links.html.twig', {block: block}) }}
{% elseif block.type == 'filesets' %}
{{ include('@openform_front_templates/_blocks_sections/_filesets.html.twig', {block: block}) }}
{% elseif block.type == 'sponsors' %}
{{ include('@openform_front_templates/_blocks_sections/_sponsors.html.twig', {block: block}) }}
{% endif %}
{% endfor %}
</div>
{# linia oddzielająca jesli zdefiniowana #}
{% if section.hrWeight|default(0) > 0 %}
<hr class="block-container__line" style="height: {{section.hrWeight}}px; background: {{section.hrBackground|default('transparent') }};"/>
{% endif %}
</div>
{% endif %}
{% endfor %}
</div>