src/Package/Openform/Front/Templates/RelictPack/_templates/template-mobile.html.twig line 1

Open in your IDE?
  1. {% from '@openform_front_templates/_includes/_icons.html.twig' import fullscreen, zoomin, zoomout, sliderprev, slidernext, arrowright, copyrights, info %}
  2. {% set ImageSlides = entity.ImageSlide|filterVisibles(app.request.locale) %}
  3. <section class="collections-mobile js-collections">
  4.     <div class="collections-mobile__header" style="background: {{rootParent.headerBackground|default('#F8F7F0') }};">
  5.         {% if rootParent.isExhibition is defined %}
  6.             {% set href = toolkit_route_localizer.generate('exhibition_item', { 'slug': rootParent.Translation[app.request.locale].slug}, app.request.locale) %}    
  7.         {% endif %}
  8.         {% if href is defined %}
  9.             <a class="collections-mobile__header__title" href="{{href}}">{{rootParent.Translation[app.request.locale].titleHtml|raw}}</a>
  10.         {% endif %}
  11.         {% set href = toolkit_route_localizer.generate('relict_pack_item', { 'slug': parentPage.Translation[app.request.locale].slug}, app.request.locale) %} 
  12.                     
  13.         <a class="collections-mobile__header__title" href="{{href}}">{{parentPage.Translation[app.request.locale].titleHtml|raw}}</a>
  14.     </div>
  15.     <div class="collections-mobile__arrows" style="background: {{entity.background|default('#F1ECC5') }};">
  16.         {% for key, Relict in entity.RelictPack.getVisibleRelicts(app.request.locale) %}
  17.                     {% if entity.id == Relict.id  %}
  18.                         {% if entity.RelictPack.getVisibleRelicts(app.request.locale)[key - 1] is defined %}
  19.                             {% set prevElement = entity.RelictPack.getVisibleRelicts(app.request.locale)[key - 1] %}
  20.                             {% set href = toolkit_route_localizer.generate('relict_item',{ slug : prevElement.Translation[app.request.locale].slug }, app.request.locale) %}
  21.                             <a href="{{href}}" class="slider-nav__btn slider-nav__btn--prev">
  22.                                 {{ sliderprev('PREV_Relict'|trans({}, 'openform_front', app.request.locale)) }}
  23.                             </a>
  24.                         {% else %}
  25.                                     <div>
  26.                                         
  27.                                     </div>
  28.                         {% endif%}
  29.                         {% if entity.Translation[app.request.locale].titleHtml is defined and entity.Translation[app.request.locale].titleHtml %}
  30.                             <div class="collections-mobile__arrows__title">
  31.                                 {{ entity.Translation[app.request.locale].titleHtml|raw }}
  32.                             </div>
  33.                         {% endif %}
  34.                         {% if entity.RelictPack.getVisibleRelicts(app.request.locale)[key + 1] is defined %}
  35.                             {% set nextElement = entity.RelictPack.getVisibleRelicts(app.request.locale)[key + 1] %}
  36.                             {% set href = toolkit_route_localizer.generate('relict_item',{ slug : nextElement.Translation[app.request.locale].slug }, app.request.locale) %}
  37.                             <a href="{{href}}" class="slider-nav__btn slider-nav__btn--next">
  38.                                 {{ slidernext('Next_Relict'|trans({}, 'openform_front', app.request.locale)) }}
  39.                             </a>
  40.                         {% else %}
  41.                                     <div>
  42.                                         
  43.                                     </div>
  44.                         {% endif%}
  45.                     {% endif %}
  46.         {% endfor %}
  47.     </div>
  48.     <div class="collections-mobile__gallery" style="background:{{entity.imageBackgroundColor|default('#FFFFFF') }};">
  49.     {% if ImageSlides|length > 0 %}
  50.         <div class="js-collection-gallery-standard" >
  51.                     <div class="splide js-collections-gallery-mobile collection-gallery" aria-label="Galeria" >
  52.                         <div class="splide__track">
  53.                             <ul class="splide__list" >
  54.                                 {% for key, image in ImageSlides %}
  55.                                         {% set img = openform_front_util.getImagePathByType(image.Thumb ?? '','original') %}
  56.                                         {# {% set img = openform_front_util.getImagePathByType(image.Thumb ?? '','template8') %} #}
  57.                                         {% set imgPagination = openform_front_util.getImagePathByType(image.Thumb ?? '','list') %}
  58.                                         <li class="splide__slide" >
  59.                                             <div class="js-zoom" data-alt="{{image.Translation[app.request.locale].alt}}">
  60.                                                 <div class="collection-gallery__item" style="width: 100%; aspect-ratio: 431 / 317;">
  61.                                                     <div class="my-zoomist" data-zoomist-src="{{img}}" data-alt="{{image.Translation[app.request.locale].alt}}"></div>
  62.                                                 </div>
  63.                                                 
  64.                                                 <div class="collection-gallery__wrap">
  65.                                                     <div class="collection-gallery__buttons">
  66.                                                         {% if image.Translation[app.request.locale].text is defined and image.Translation[app.request.locale].text %}
  67.                                                             <div class="object__info-wrap">
  68.                                                                 <button class="collection-gallery__buttons__btn" tabindex="0" aria-expanded="false" data-expanded="js-desc-{{key}}" data-efecthover=".js-desc-{{key}}">{{info(('T_DESC')|trans({}, 'openform_front', app.request.locale))}}</button>
  69.                                                                 <div class="object__info object__info--desc block__text js-desc-{{key}}" data-lenis-prevent>{{image.Translation[app.request.locale].text|raw}}</div>
  70.                                                             </div>
  71.                                                         {% endif %}
  72.                                                         {% if image.Translation[app.request.locale].copyrights is defined and image.Translation[app.request.locale].copyrights %}
  73.                                                             <div class="object__info-wrap">
  74.                                                                 <button class="collection-gallery__buttons__btn" tabindex="0" aria-expanded="false" data-expanded="js-info-{{key}}" data-efecthover=".js-info-{{key}}">{{copyrights(('T_INFO')|trans({}, 'openform_front', app.request.locale))}}</button>
  75.                                                                 <div class="object__info block__text js-info-{{key}}">{{image.Translation[app.request.locale].copyrights}}</div>
  76.                                                             </div>
  77.                                                         {% endif %}
  78.                                                         <button class="collection-gallery__buttons__btn js-fullscreen" data-alt="{{image.Translation[app.request.locale].alt}}" tabindex="0" data-color="{{image.imageBackgroundColor is defined and image.imageBackgroundColor ? image.imageBackgroundColor }}"
  79.                                                         data-image="{{img}}"
  80.                                                         data-description="{{image.Translation[app.request.locale].text}}"
  81.                                                         data-copyrights="{{image.Translation[app.request.locale].copyrights}}"
  82.                                                         data-start="{{key}}"
  83.                                                                         data-imagestyle="{% if image.imageBorderColor and image.imageBorderWidth %}border: {{image.imageBorderColor}} solid {{image.imageBorderWidth}}px;{% endif %}"
  84.                                                         >
  85.                                                             {{fullscreen(('T_FULLSCREEN')|trans({}, 'openform_front', app.request.locale))}}
  86.                                                         </button>
  87.                                                         <button class="collection-gallery__buttons__btn js-zoom-out">{{zoomout(('T_ZOOMOUT')|trans({}, 'openform_front', app.request.locale))}}</button>
  88.                                                         <button class="collection-gallery__buttons__btn js-zoom-in">{{zoomin(('T_ZOOMIN')|trans({}, 'openform_front', app.request.locale))}}</button>
  89.                                                     </div>
  90.                                                 </div>
  91.                                             </div>
  92.                                         </li>
  93.                                 {% endfor %}                               
  94.                             </ul>
  95.                             <div class="splide__arrows js-slider-nav">
  96.                                 <div class="slider-nav collections-mobile__gallery__nav">
  97.                                     <button class="splide__arrow splide__arrow--prev slider-nav__btn slider-nav__btn--prev" disabled>
  98.                                         {{ sliderprev('PREV_SLIDE'|trans({}, 'openform_front', app.request.locale)) }}
  99.                                     </button>
  100.                                     <div class="slider-nav__info">
  101.                                         <span class="slider-nav__info__current js-slider-nav-current" aria-label="{{ 'CURRENT_PAGE'|trans({}, 'openform_front', app.request.locale) }}"></span><span class="slider-nav__info__all">/</span><span aria-label="{{ 'ALL_PAGE'|trans({}, 'openform_front', app.request.locale) }}" class="js-slider-nav-all slider-nav__info__all"></span>
  102.                                     </div>
  103.                                     <button class="splide__arrow splide__arrow--next slider-nav__btn slider-nav__btn--next">
  104.                                         {{ slidernext('NEXT_SLIDE'|trans({}, 'openform_front', app.request.locale)) }}
  105.                                     </button>
  106.                                 </div>
  107.                             </div>
  108.                         </div>
  109.                     </div>
  110.                 </div> 
  111.         {% endif %}
  112.     </div>
  113.     <div class="collections-mobile__content" style="background: {{rootParent.headerBackground|default('#F1ECC5') }};">
  114.         {% if entity.link is defined and entity.link %}
  115.             <a href="{{entity.link}}" class="block-text__btns__btn button-read-more button-read-more--black">
  116.                 <span>{{('T_RELICT_LINK')|trans({}, 'openform_front', app.request.locale)}}</span>
  117.                 {{arrowright()}}
  118.             </a>
  119.         {% endif %}
  120.         
  121.         {% if entity.Translation[app.request.locale].text is defined and entity.Translation[app.request.locale].text %}
  122.             <div class="collections__content__text block__text">
  123.                 {{ entity.Translation[app.request.locale].text|raw }}
  124.             </div>
  125.         {% endif %}
  126.         {% if entity.Translation[app.request.locale].description is defined and entity.Translation[app.request.locale].description %}
  127.             <div class="collections__content__text block__text">
  128.                 {{ entity.Translation[app.request.locale].description|raw }}
  129.             </div>
  130.         {% endif %}
  131.         {% if entity.filePath is defined and entity.filePath and openform_front_util.isMp3File(entity.filePath) %}
  132.             <div class="block-image__image__audio">
  133.                 <div class="block-audio__player">
  134.                     <audio controls class="js-audio-player block-audio__inner">
  135.                         <source src="{{ entity.filePath }}">
  136.                         Your browser does not support the audio element.
  137.                      </audio>
  138.                 </div>
  139.             </div>
  140.         {% endif %}
  141.         {% if entity.Translation[app.request.locale].attributesText is defined and entity.Translation[app.request.locale].attributesText %}
  142.             <div class="collections__content__text block__text">
  143.                 {{ entity.Translation[app.request.locale].attributesText|raw }}
  144.             </div>
  145.         {% endif %}
  146.         
  147.     </div>
  148. </section>