templates/press_site/actions/movies/partials/multimedia/assets.html.twig line 1

Open in your IDE?
  1. {% set mapping = getProductAssets(entity) %}
  2. {% if mapping | length %}
  3.     {% set maximumSizeAllowedForAppend = 1024 * 1024 * 256 %}
  4.     {% for category, collection in mapping %}
  5.         {% if collection.assets is defined and collection.assets is not empty %}
  6.         <div class="trailer__misc-container">
  7.             <h3>{{ category | trans({}, 'PressSite') }}</h3>
  8.             <div class="trailer-grid__container">
  9.                 {% for item in collection.assets %}
  10.                     {% set assetSize = item.asset.file.size %}
  11.                     {% set pathParams = {_locale: app.request.locale, id: item.id} %}
  12.                     <div class="trailer-misc__container">
  13.                         <div class="film-info-details">
  14.                             <div class="film-info-modal__container">
  15.                                 <img class="movie-poster" src="{{ getAssetPoster(item.asset) }}" alt="">
  16.                                 <div class="info__container">
  17.                                     <div class="short-movie-info__wrapper">
  18.                                         <h6>Product</h6>
  19.                                         <p>{{ getProductLocalTitle(item.asset.product) }}</p>
  20.                                     </div>
  21.                                     <div class="short-movie-info__wrapper">
  22.                                         <h6>Short name</h6>
  23.                                         <p>{{ item.short_name }}</p>
  24.                                     </div>
  25.                                     <div class="short-movie-info__wrapper">
  26.                                         <h6>Content type</h6>
  27.                                         <p>{{ item.content_type_name }}</p>
  28.                                     </div>
  29.                                     <div class="short-movie-info__wrapper">
  30.                                         <h6>Identifier</h6>
  31.                                         <p>{{ item.asset.identifier }}</p>
  32.                                     </div>
  33.                                     <div class="short-movie-info__wrapper">
  34.                                         <h6>Extension</h6>
  35.                                         <p>{{ item.extension }}</p>
  36.                                     </div>
  37.                                     <div class="short-movie-info__wrapper">
  38.                                         <h6>File</h6>
  39.                                         <p>{{ getAssetFilesize(item.asset) }}</p>
  40.                                     </div>
  41.                                     
  42.                                     {% if item.video_resolution_aspect %}
  43.                                          {% include "press_site/actions/movies/partials/multimedia/video_assets.html.twig" %}
  44.                                     {% endif %}
  45.                                 </div>
  46.                             </div>
  47.                         </div>
  48.                         {% if item.default_image_box %}
  49.                             <div class="image-box default-portrait">
  50.                                 <img src="{{ item.thumbnail_url }}" class="thumb" alt="">
  51.                             </div>
  52.                         {% else %}
  53.                             <div>
  54.                                 <img src="{{ item.thumbnail_url }}" class="thumb" alt="">
  55.                             </div>
  56.                         {% endif %}
  57.                         <div class="misc__container">
  58.                             <p>
  59.                                 {{ item.content_type_name }}<br>
  60.                                 {{ item.copyright ?? '' }}
  61.                             </p>
  62.                             <div class="misc__image-container" data-role="assets-container-{{ item.id }}">
  63.                                 {% set params = {_locale: app.request.locale, id: item.id} %}
  64.                                 {% set ajaxParams = {_locale: app.request.locale, productId: item.asset.product.productID, assetId: item.asset.assetID} %}
  65.                                 {% if maximumSizeAllowedForAppend > assetSize %}
  66.                                 <a
  67.                                         href="javascript://"
  68.                                         title="Add to download list"
  69.                                         data-role="bulk-file-append"
  70.                                         data-asset-id="{{ item.id }}"
  71.                                         data-download="{{ isAssetSelected(app.request, item.asset.product.productID, item.asset.assetID) ? 0 : 1 }}"
  72.                                         data-plus-icon="{{ asset('assets/press_site/images/misc/plus.png') }}"
  73.                                         data-minus-icon="{{ asset('assets/press_site/images/misc/minus.png') }}"
  74.                                         data-path="{{ path('press_site.actions.assets.manage_item', ajaxParams) }}"
  75.                                 >
  76.                                     {% if isAssetSelected(app.request, item.asset.product.productID, item.asset.assetID) %}
  77.                                         <img src="{{ asset('assets/press_site/images/misc/minus.png') }}" alt="">
  78.                                     {% else %}
  79.                                         <img src="{{ asset('assets/press_site/images/misc/plus.png') }}" alt="">
  80.                                     {% endif %}
  81.                                 </a>
  82.                                 {% endif %}
  83.                                 <a
  84.                                         href="{{ item.asset.file | media_download }}"
  85.                                         title="Download"
  86.                                         download=""
  87.                                 >
  88.                                     <img src="{{ asset('assets/press_site/images/misc/download.png') }}" alt="">
  89.                                 </a>
  90.                             </div>
  91.                         </div>
  92.                     </div>
  93.                 {% endfor %}
  94.             </div>
  95.         </div>
  96.         {% endif %}
  97.     {% endfor %}
  98. {% endif %}