{% set mapping = getProductAssets(entity) %}
{% if mapping | length %}
{% set maximumSizeAllowedForAppend = 1024 * 1024 * 256 %}
{% for category, collection in mapping %}
{% if collection.assets is defined and collection.assets is not empty %}
<div class="trailer__misc-container">
<h3>{{ category | trans({}, 'PressSite') }}</h3>
<div class="trailer-grid__container">
{% for item in collection.assets %}
{% set assetSize = item.asset.file.size %}
{% set pathParams = {_locale: app.request.locale, id: item.id} %}
<div class="trailer-misc__container">
<div class="film-info-details">
<div class="film-info-modal__container">
<img class="movie-poster" src="{{ getAssetPoster(item.asset) }}" alt="">
<div class="info__container">
<div class="short-movie-info__wrapper">
<h6>Product</h6>
<p>{{ getProductLocalTitle(item.asset.product) }}</p>
</div>
<div class="short-movie-info__wrapper">
<h6>Short name</h6>
<p>{{ item.short_name }}</p>
</div>
<div class="short-movie-info__wrapper">
<h6>Content type</h6>
<p>{{ item.content_type_name }}</p>
</div>
<div class="short-movie-info__wrapper">
<h6>Identifier</h6>
<p>{{ item.asset.identifier }}</p>
</div>
<div class="short-movie-info__wrapper">
<h6>Extension</h6>
<p>{{ item.extension }}</p>
</div>
<div class="short-movie-info__wrapper">
<h6>File</h6>
<p>{{ getAssetFilesize(item.asset) }}</p>
</div>
{% if item.video_resolution_aspect %}
{% include "press_site/actions/movies/partials/multimedia/video_assets.html.twig" %}
{% endif %}
</div>
</div>
</div>
{% if item.default_image_box %}
<div class="image-box default-portrait">
<img src="{{ item.thumbnail_url }}" class="thumb" alt="">
</div>
{% else %}
<div>
<img src="{{ item.thumbnail_url }}" class="thumb" alt="">
</div>
{% endif %}
<div class="misc__container">
<p>
{{ item.content_type_name }}<br>
{{ item.copyright ?? '' }}
</p>
<div class="misc__image-container" data-role="assets-container-{{ item.id }}">
{% set params = {_locale: app.request.locale, id: item.id} %}
{% set ajaxParams = {_locale: app.request.locale, productId: item.asset.product.productID, assetId: item.asset.assetID} %}
{% if maximumSizeAllowedForAppend > assetSize %}
<a
href="javascript://"
title="Add to download list"
data-role="bulk-file-append"
data-asset-id="{{ item.id }}"
data-download="{{ isAssetSelected(app.request, item.asset.product.productID, item.asset.assetID) ? 0 : 1 }}"
data-plus-icon="{{ asset('assets/press_site/images/misc/plus.png') }}"
data-minus-icon="{{ asset('assets/press_site/images/misc/minus.png') }}"
data-path="{{ path('press_site.actions.assets.manage_item', ajaxParams) }}"
>
{% if isAssetSelected(app.request, item.asset.product.productID, item.asset.assetID) %}
<img src="{{ asset('assets/press_site/images/misc/minus.png') }}" alt="">
{% else %}
<img src="{{ asset('assets/press_site/images/misc/plus.png') }}" alt="">
{% endif %}
</a>
{% endif %}
<a
href="{{ item.asset.file | media_download }}"
title="Download"
download=""
>
<img src="{{ asset('assets/press_site/images/misc/download.png') }}" alt="">
</a>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
{% endif %}
{% endfor %}
{% endif %}