{% set object = object|default(null) %}
{% set hasWishlist = hasWishlist | default(false) %}
{% if object and object.gallery.items is not empty %}
{% set galleryImages = [object.teaserImage] | merge(object.gallery.items) %}
{% if galleryImages is not empty %}
<div class="js-dropdown dropdown dropdown--gallery ">
<button class="btn btn-lg btn-white" type="button" id="ddDownload" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="btn__icon">
<span class="icon icon-download" aria-hidden="true"></span>
</span>
<span class="btn__text">{{ 'detail.downloads' | trans }}</span>
</button>
<ul class="dropdown-menu js-dropdown-persist" aria-labelledby="ddDownload" >
{% for item in galleryImages|filter(i => app.user ? true : not i.image.property('isPrintQuality')) %}
<li>
{% if item.image.property('isPrintQuality') %}
<button type="button"
data-target="#dlModal"
class="dropdown-item js-dl-modal-toggle"
data-content-url="{{ item }}"
data-download="{{ item.image.filename }}"
data-modal-checkbox="false">
{{ item.image.filename }}
</button>
{% else %}
<a class="dropdown-item"
href="{{ item }}"
download={{ item.image.filename }}>
{{ item.image.filename }}
</a>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% endif %}