{% import '@galleries/shortcode/style.twig' as style %}
{% if gallery is defined and gallery is not empty %}
{% if settings.icons is defined and settings.icons.enabled == 'true' %}
{% endif %}
{% if categories is defined and categories is not empty and environment.isPro() %}
{% if settings.categories is defined and settings.categories.enabled == 'true' and settings.categories.position == 'top' %}
{% set navStyle %}
text-align: {{ settings.categories.align|default('left') }};
{% if settings.categories.hide_nav_bg == 'off' %}
background-color: {{ settings.categories.nav_bg }};
padding-left: 10px; padding-right: 10px;
{% endif %}
{% endset %}
{% set navAStyle %}
{% if settings.categories.hide_text_bg == 'off' %}
background-color:{{ settings.categories.text_bg }};
{% endif %}
{% if settings.categories.theme_color == 'off' %}
color:{{ settings.categories.text_color }};
text-decoration:none !important;
font-size: {{ settings.categories.font_size }}px;
font-weight: {{ settings.categories.font_weight }};
{% endif %}
margin-left: 2.5px;
margin-right: 2.5px;
border: {{ settings.categories.border.width }}px {{ settings.categories.border.style }} {{ settings.categories.border.color }};
border-radius: {{ settings.categories.border.radius }}{{ settings.categories.border.radius_unit }};
padding: {{ settings.categories.padding.vert }}px {{ settings.categories.padding.hor }}px;
margin-bottom: {{ settings.categories.padding.vert }}px;
{% endset %}
{% endif %}
{% endif %}
{% set paginationButtons %}
{% if environment.isPro() and settings.pagination is defined and settings.pagination.enabled == 'true' %}
{% if settings.posts.enable != '1' %}
{% set postsLength = 0 %}
{% endif %}
{% set totalPages = ((gallery.photos|length + postsLength)/ settings.pagination.per_page)|round(0, 'ceil') %}
{% set paginationWrapperStyle %}
{{ style.prop('text-align', settings.pagination.align) }}
{% if settings.pagination.container.hide_background == 'off' %}
{{ style.prop('background-color', settings.pagination.container.background) }}
{% endif %}
{% endset %}
{% set paginationLinkStyle %}
{{ style.prop('padding-left', settings.pagination.padding.horizontal ~ 'px') }}
{{ style.prop('padding-right', settings.pagination.padding.horizontal ~ 'px') }}
{{ style.prop('padding-top', settings.pagination.padding.vertical ~ 'px') }}
{{ style.prop('padding-bottom', settings.pagination.padding.vertical ~ 'px') }}
{{ style.prop('font-weight', settings.pagination.font.weight) }}
{{ style.prop('font-size', settings.pagination.font.size ~ 'px') }}
{{ style.prop('border-width', settings.pagination.border.width ~ 'px') }}
{{ style.prop('border-style', settings.pagination.border.type) }}
{{ style.prop('border-color', settings.pagination.border.color) }}
{{ style.prop('border-radius', settings.pagination.border.radius ~ settings.pagination.border.radius_unit) }}
{% if settings.pagination.text.hide_background == 'off' %}
{{ style.prop('background-color', settings.pagination.text.background) }}
{% endif %}
{% if settings.pagination.text.hide_color == 'off' %}
{{ style.prop('color', settings.pagination.text.color) }}
{% endif %}
{% endset %}
{% endif %}
{% endset %}
{% if settings.pagination.pos == 'top' %}
{{ paginationButtons }}
{% endif %}
{% import '@galleries/r314/shortcode/helpers.twig' as helper %}
{% import '@galleries/r314/shortcode/post_helpers.twig' as post_helper %}
{% for photo in gallery.photos %}
{{ helper.image(photo, settings) }}
{% endfor %}
{% if settings.posts.enable == '1' %}
{% for post in posts %}
{% if settings.posts.style > '3' %}
{{ post_helper.sodiumStyles(post, settings, settings.posts.style) }}
{% endif %}
{% if settings.posts.style == '3' %}
{{ post_helper.captionRight(post, settings) }}
{% endif %}
{% if settings.posts.style == '2' %}
{{ post_helper.imageSlide(post, settings) }}
{% endif %}
{% if settings.posts.style == '1' %}
{{ post_helper.imageCaption(post, settings) }}
{% endif %}
{% if settings.posts.style == '0' %}
{{ post_helper.image(post, settings) }}
{% endif %}
{% endfor %}
{% for page in pages %}
{% if settings.posts.style > '3' %}
{{ post_helper.sodiumStyles(page, settings, settings.posts.style) }}
{% endif %}
{% if settings.posts.style == '3' %}
{{ post_helper.captionRight(page, settings) }}
{% endif %}
{% if settings.posts.style == '2' %}
{{ post_helper.imageSlide(page, settings) }}
{% endif %}
{% if settings.posts.style == '1' %}
{{ post_helper.imageCaption(page, settings) }}
{% endif %}
{% if settings.posts.style == '0' %}
{{ post_helper.image(page, settings) }}
{% endif %}
{% endfor %}
{% endif %}
{% if categories is defined and categories is not empty and environment.isPro() %}
{% if settings.categories is defined and settings.categories.enabled == 'true' and settings.categories.position == 'bottom' %}
{% set navStyle %}
text-align: {{ settings.categories.align|default('left') }};
{% if settings.categories.hide_nav_bg == 'off' %}
background-color: {{ settings.categories.nav_bg }};
padding-left: 10px; padding-right: 10px;
{% endif %}
position: relative;
{% endset %}
{% set navAStyle %}
{% if settings.categories.hide_text_bg == 'off' %}
background-color:{{ settings.categories.text_bg }};
{% endif %}
{% if settings.categories.theme_color == 'off' %}
color:{{ settings.categories.text_color }};
text-decoration:none !important;
font-size: {{ settings.categories.font_size }}px;
font-weight: {{ settings.categories.font_weight }};
{% endif %}
margin-left: 2.5px;
margin-right: 2.5px;
border: {{ settings.categories.border.width }}px {{ settings.categories.border.style }} {{ settings.categories.border.color }};
border-radius: {{ settings.categories.border.radius }}{{ settings.categories.border.radius_unit }};
padding: {{ settings.categories.padding.vert }}px {{ settings.categories.padding.hor }}px;
margin-bottom: {{ settings.categories.padding.vert }}px;
{% endset %}
{% endif %}
{% endif %}
{% if settings.pagination.pos == 'bottom' %}
{{ paginationButtons }}
{% endif %}
{% endif %}