templates/bundles/SyliusShopBundle/Product/Show/Tabs/productFile.html.twig line 1

Open in your IDE?
  1. {% if vendor_can_product_file(product) %}
  2.     <div class="ui bottom attached tab segment product-tabs" data-tab="product_file">
  3.         <ul>
  4.             {% set isPreview = product.id is null
  5.                 or 'open_marketplace_vendor_product_listings_preview' == app.request.attributes.get('_route')
  6.             %}
  7.             {% set ownerType = isPreview ? 'draft' : 'product' %}
  8.             {% for datasheet in product.datasheets %}
  9.                 <li>
  10.                     <a href="{{ path('app_datasheet', {
  11.                         'ownerType': ownerType,
  12.                         'ownerId': isPreview ? product_listing.latestDraft.id|default(product.id) : product.id,
  13.                         'action': 'inline',
  14.                         'filename': datasheet.originalFilename
  15.                     }) }}" target="_blank"> <i class="icon file"></i> {{ datasheet.originalFilename }} </a>
  16.                     <a href="{{ path('app_datasheet', {
  17.                         'ownerType': ownerType,
  18.                         'ownerId': isPreview ? product_listing.latestDraft.id|default(product.id) : product.id,
  19.                         'action': 'download',
  20.                         'filename': datasheet.originalFilename
  21.                     }) }}"> {{ 'app.ui.download'|trans }} </a>
  22.                 </li>
  23.             {% endfor %}
  24.         </ul>
  25.     </div>
  26. {% endif %}