templates/shop_video/details.html.twig line 1

Open in your IDE?
  1. {% trans_default_domain 'shop_video' %}
  2. {% extends 'base_home.html.twig' %}
  3. {% block title %}{{ 'details.title'|trans({'{ shop_video }': entity.title}) }}{% endblock %}
  4. {% set resolutionsLabels = {
  5.     '360': 'SD 360p',
  6.     '480': 'SD 480p',
  7.     '540': 'SD 540p',
  8.     '720': 'HD 720p',
  9.     '1080': 'HD 1080p',
  10.     '2160': 'uHD 4K',
  11.     '2880': 'uHD 5K',
  12.     '4320': 'uHD 8K',
  13. } %}
  14. {% block content %}
  15. {% set hasCredits = false %}
  16. {% set hasPurchased = is_granted('ROLE_USER') and is_granted(constant('App\\Security\\Voter\\Bid\\HasPurchasedOnceVoter::ATTRIBUTE'), entity.createBid(app.user)) %}
  17. <div class="nk-content pt-md-3 min-vh-100 pb-5">
  18.     <div class="container">
  19.         <div class="row shop-video-details mb-5 enable-loading-delay">
  20.             <div class="col-12">
  21.                 <div class="contribution-wrap d-flex flex-column align-center">
  22.                     <div class="row mb-4">
  23.                         <div class="col-12">
  24.                             <h3 class="text-center">{{ entity.title }}</h3>
  25.                         </div>
  26.                     </div>
  27.                     <div class="row">
  28.                         <div class="col-12">
  29.                             <div class="d-flex justify-center flex-wrap">
  30.                                 <div class="badge badge-outline-dark badge-lg badge-pill fw-normal mr-2 mb-2" data-toggle="tooltip" data-bs-placement="top" title="{{ 'details.type_badage_tooltip'|trans }}">
  31.                                     <span>{{ 'details.type_badage'|trans }}</span>
  32.                                 </div>
  33.                                 <div class="badge badge-outline-dark badge-lg badge-pill fw-normal mr-2 mb-2">
  34.                                     <span>{{ resolutionsLabels[entity.videoFile.resolution]|default(entity.videoFile.height ~ 'p') }}</span>
  35.                                 </div>
  36.                                 <div class="badge badge-outline-dark badge-lg badge-pill fw-normal mr-2 mb-2">
  37.                                     <span>{{ 'minute.plural'|trans({count: entity.videoFile.durationMinutes|number_format(2, ':')}, 'messages') }}</span>
  38.                                 </div>
  39.                                 <div class="badge badge-outline-dark badge-lg badge-pill fw-normal mr-2 mb-2">
  40.                                     <span>{{ entity.videoFile.fileSize // 1024 }} MB</span>
  41.                                 </div>
  42.                             </div>
  43.                         </div>
  44.                     </div>
  45.                 </div>
  46.             </div>
  47.         </div>
  48.         <div class="row shop-video-details enable-loading-delay">
  49.             <div class="col-12 col-lg-8 offset-lg-2">
  50.                 <div style="max-width: 770px; margin: 0 auto;">
  51.                     <div class="gallery-slider js-shop-video-slider">
  52.                         {% if entity.trailer %}
  53.                             <div class="shop-video-trailer rounded">
  54.                                 <a href="{{ entity.trailer.webPath | sindrive_protect }}" data-fancybox="video_vidcaps">
  55.                                     <div class="shop-trailer rounded mr-1 mr-md-2">
  56.                                     <span class="trailer-play-handle rounded-circle">
  57.                                         <i class="icon dp-icon-video"></i>
  58.                                     </span>
  59.                                         {% if entity.preview %}
  60.                                             <img src="{{ entity.preview.webPath | sindrive_resize(752, 423) | sindrive_timed_protect }}" class="img-fluid rounded preview mr-2 ml-2" alt="{{ entity.title }}">
  61.                                         {% else %}
  62.                                             <img src="{{ asset('images/proposal/blank.jpg') }}" class="img-fluid rounded mr-2 ml-2" alt="{{ entity.title }}">
  63.                                         {% endif %}
  64.                                     </div>
  65.                                 </a>
  66.                             </div>
  67.                         {% else %}
  68.                             <div class="shop-trailer rounded">
  69.                                 {% if entity.preview %}
  70.                                     <img src="{{ entity.preview.webPath | sindrive_resize(752, 423) | sindrive_timed_protect }}" class="img-fluid rounded preview mr-2 ml-2" alt="{{ entity.title }}">
  71.                                 {% else %}
  72.                                     <img src="{{ asset('images/proposal/blank.jpg') }}" class="img-fluid rounded mr-2 ml-2" alt="{{ entity.title }}">
  73.                                 {% endif %}
  74.                             </div>
  75.                         {% endif %}
  76.                         {% if entity.gallery|length > 0  %}
  77.                             {% for galleryImage in entity.gallery %}
  78.                                 <div class="screencap-item">
  79.                                     <a href="{{ galleryImage.webPath | sindrive_protect | sindrive_resize(1920) }}" data-fancybox="video_vidcaps">
  80.                                         <img class="preview mr-2 ml-2" src="{{ galleryImage.webPath | sindrive_resize(752, 423) | sindrive_timed_protect }}" alt="">
  81.                                     </a>
  82.                                 </div>
  83.                             {% endfor %}
  84.                         {% endif %}
  85.                         {% if entity.publishedVidcaps|length > 0  %}
  86.                             {% for vidcap in entity.publishedVidcaps %}
  87.                                 <div class="screencap-item">
  88.                                     <a href="{{ vidcap.webPath | sindrive_protect | sindrive_resize(1920) }}" data-fancybox="video_vidcaps">
  89.                                         <img class="preview mr-2 ml-2" src="{{ vidcap.webPath | sindrive_resize(752, 423) | sindrive_timed_protect }}" alt="">
  90.                                     </a>
  91.                                 </div>
  92.                             {% endfor %}
  93.                         {% endif %}
  94.                     </div>
  95.                 </div>
  96.             </div>
  97.         </div>
  98.         <div class="row mb-6 shop-video-details enable-loading-delay">
  99.             <div class="col-12 col-lg-6 offset-lg-3">
  100.                 <div class="contribution-action-wrap">
  101.                     {% if is_granted('ROLE_USER') %}
  102.                         {% if hasPurchased %}
  103.                             <div class="form-control-wrap">
  104.                                 <button class="btn btn-lg btn-round btn-dark fw-bolder contribution-purchase-button justify-between" data-toggle="modal" data-target="#download-{{ entity.stringId }}">
  105.                                     <span class="lead text-white m-0">
  106.                                         <em class="icon dp-icon-downloads mr-4"></em>
  107.                                     </span>
  108.                                     <span>{{ 'details.purchase.download_button'|trans }}</span>
  109.                                 </button>
  110.                             </div>
  111.                             {% include 'shop_video/Block/download_popup.html.twig' with {shop_video: entity} only %}
  112.                         {% elseif is_granted(constant('App\\Security\\Voter\\Bid\\HasCreditsVoter::ATTRIBUTE'), entity.createBid(app.user)) %}
  113.                             <div class="contribution-action">
  114.                                 {{ render_crud_result('App\\Controller\\ShopVideo\\PurchaseController', {'stringId': entity.stringId}) }}
  115.                             </div>
  116.                         {% else %}
  117.                             <div class="contribution-action">
  118.                                 <div class="contribution-info-amount">
  119.                                     <span class="mr-2 fw-normal">{{ 'details.purchase.current_price'|trans }}</span>{{ 'credits.plural'|trans({count: entity.priceFloat|price_format(true)}, 'messages') }}
  120.                                 </div>
  121.                                 <button class="btn btn-lg btn-round fw-bolder contribution-purchase-button btn-secondary mb-4" data-toggle="modal" data-target="#purchase-credits-dialog">
  122.                                     <span>{{ 'details.purchase.button'|trans }}</span>
  123.                                 </button>
  124.                                 <div>
  125.                                     <p class="fs-14px">{{ 'details.purchase.hint'|trans }}</p>
  126.                                 </div>
  127.                             </div>
  128.                         {% endif %}
  129.                     {% elseif not is_granted('ROLE_USER') %}
  130.                         <div class="contribution-action mt-2">
  131.                             <div class="form-control-wrap">
  132.                                 <div class="contribution-info-amount">
  133.                                     <span class="mr-2 fw-normal">{{ 'details.purchase.current_price'|trans }}</span> {{ 'details.purchase.blind_price'|trans }}
  134.                                 </div>
  135.                                 <a href="{{ path('app_login', {'return': app.request.pathInfo}) }}" class="btn btn-lg btn-round fw-bolder contribution-purchase-button btn-secondary mb-4" type="submit">
  136.                                     <div>{{ 'details.purchase.button'|trans }}</div>
  137.                                 </a>
  138.                                 <div>
  139.                                     <p class="fs-14px">{{ 'details.purchase.hint'|trans }} <a href="{{ path('app_login') }}" class="fw-bolder link">{{ 'details.purchase.login_label'|trans }}</a> or <a href="{{ path('registration') }}" class="fw-bolder link">{{ 'details.purchase.signup_label'|trans }}</a>.</p>
  140.                                 </div>
  141.                             </div>
  142.                         </div>
  143.                     {% endif %}
  144.                 </div>
  145.             </div>
  146.         </div>
  147.         <div class="shop-video-details content rounded pt-4 mb-5 enable-loading-delay">
  148.             <div class="row">
  149.                 <div class="col-12 col-lg-8 offset-lg-2">
  150.                     <div class="row mb-6">
  151.                         <div class="col-12">
  152.                             {% if entity.tags|length > 0 %}
  153.                                 <div class="row">
  154.                                     <div class="col-12">
  155.                                         <div class="d-flex justify-center flex-wrap">
  156.                                             {% for tag in entity.tags %}
  157.                                                 <div class="badge badge-pill badge-light font-weight-normal text-dark mr-1 mb-1">
  158.                                                     <span>{{ tag.name }}</span>
  159.                                                 </div>
  160.                                             {% endfor %}
  161.                                         </div>
  162.                                     </div>
  163.                                 </div>
  164.                             {% endif %}
  165.                             <div class="row">
  166.                                 <div class="col-12">
  167.                                     <hr>
  168.                                 </div>
  169.                             </div>
  170.                             <div class="row mb-4">
  171.                                 <div class="col-12">
  172.                                     <div class="pr-lg-4">
  173.                                         <p class="text-center">
  174.                                             {{ entity.description | raw }}
  175.                                         </p>
  176.                                     </div>
  177.                                 </div>
  178.                             </div>
  179.                         </div>
  180.                     </div>
  181.                 </div>
  182.             </div>
  183.         </div>
  184.     </div>
  185. </div>
  186. {% if is_granted('ROLE_USER') %}
  187.     {% set hasCredits = is_granted(constant('App\\Security\\Voter\\Bid\\HasCreditsVoter::ATTRIBUTE'), entity.createBid(app.user)) %}
  188.     {% set purchaseCredits = get_crud_action('App\\Controller\\Settings\\PurchaseCreditsController', {'shop_video_id': entity.stringId, 'returnUrl': app.request.requestUri}) %}
  189.     {% include 'settings/purchase_credits.html.twig' with purchaseCredits.params | merge({'reference': get_reference(entity), 'hasCredits': hasCredits}) %}
  190. {% endif %}
  191. {% if is_granted('ROLE_USER') and ((app.request.hasPreviousSession or app.session.started) and app.session.flashBag.get('purchase-success')) %}
  192.     {% include 'partials/base_overlay.html.twig' with {
  193.         icon: 'dp-icon-heart',
  194.         title: 'details.purchase.success'|trans,
  195.         subtitle: 'details.purchase.success_subtitle'|trans
  196.     } %}
  197. {% endif %}
  198. {% include 'partials/flash_message_popup.html.twig' %}
  199. {% endblock %}