{% set list = load_nodes('image', {parent:module.id}).list %}
{% set thmb = thmb|default(module.vars.thumb) %}
<div class="node-gallery">
{% set urls = [] %}
<div class="{{ thmb == 'node_gallery_outbound' ? 'gallery-fullwidth' : 'image-list' }}">
{% set rows = list|design_rows %}
{% set num = 0 %}
{% for row in rows %}
{% for index, item in row %}
{% set url = item.vars.url %}
<a href="{% if item.vars.url %}
{%- if is_video_url(url) -%}
{%- set url= url -%}
{%- endif -%}
{{- url -}}
{%- set urls = urls|merge({(index) :
{
src: url,
type: 'video',
thumb: item.vars.photo.path|imagine_filter_cache(thmb),
caption: item.vars.title,
sources: [url]
}
}) -%}
{%-else-%}
{{- item.vars.photo.path|imagine_filter_cache('full') -}}
{%- set urls = urls|merge({(index) :
{
src: asset(item.vars.photo.path),
thumb: item.vars.photo.path|imagine_filter_cache(thmb),
title: item.vars.title,
sources: [asset(item.vars.photo.path)]
}
}) -%}
{%- endif -%}" {% if module.vars.download %} download {% else %} @click.stop.prevent="showGal({{ module.id }}, {{ index }})"{% endif %} title="{{ item.vars.title }}">
{% if (thmb == 'node_gallery_outbound') %}
<img src="{{ item.vars.photo.path }}" />
{% else %}
<img src="{{ item.vars.photo.path }}" class="gallery-square" />
{% endif %}
</a>
{% endfor %}
{% endfor %}
</div>
<div class="clear-fix"></div>
{% if not module.vars.download %}
<div v-if="galEnabled({{ module.id }})">
<teleport to="body">
<light-box :start-at="galStart" :show-caption="true" :media="{{ urls|json_encode|e('html_attr') }}" @onClosed="hideGal({{ module.id }})"></light-box>
</teleport>
</div>
{% endif %}