src/Elements/Bundle/DemiFrontendBundle/Resources/views/AdditionalService/detail.html.twig line 1

Open in your IDE?
  1. {% do jsConfig().add('inputStates', true) %}
  2. {% do jsConfig().add('datepicker', true) %}
  3. {% do jsConfig().add('numberSpinner', true) %}
  4. {% set language = app.request.locale %}
  5. {% set viewdata = demi_additionalPrepareDateForDetailFile(offeritem, language, document) %}
  6. {% do demi_paymentSetDefaultCurrency(viewdata.provider) %}
  7. {% set currency = demi_paymentGetCurrency() %}
  8. {% set metaTitle = offeritem.metaTitle %}
  9. {% if metaTitle is empty %}
  10.     {% set metaTitle = offeritem.name %}
  11.     {% set metaTitle = metaTitle ~ (viewdata.provider.getTown() ? ( ' ' ~ 'demi.seo.in'|trans ~ " " ~ viewdata.provider.getTown().getName() ~ ' ') : '') %}
  12. {% endif %}
  13. {% if not editmode %}
  14.     {% do elements_head_title().setTitle(metaTitle, true) %}
  15.     {% do elements_head_meta(chooseDescription(offeritem.metaDescription, offeritem.getDescription(constant('Elements\\Demi\\Deskline\\Constant\\DescriptionInterface::DESCRIPTION_SERVICE_DESCRIPTION'))|striptags), true )  %}
  16. {% endif %}
  17. {% set breadcrumbUrl = app.request.pathInfo %}
  18. {% do elements_canonical().checkAllParams(false).setDomain(viewdata.canonicalUrl)|raw %}
  19. {% if not viewdata.canonicalUrl is same as(app.request.pathInfo) %}
  20.     {% do elements_robots().setNoIndex(true) %}
  21. {% endif %}
  22. {% set fromDate = fromDate|default(carbon().now) %}
  23. {% set images = offeritem.getImages(null, fromDate) %}
  24. {% if viewdata.photoCount > 0 %}
  25.     {% do elements_opengraph().setImages([hostUrl() ~ images[0]]|merge(elements_opengraph().getImages())) %}
  26. {% endif %}
  27. {% set  generalDocuments = [] %}
  28. {% for doc in offeritem.getDocuments() %}
  29.     {% if doc is not instanceof("\\Pimcore\\Model\\DataObject\\DemiDocumentImage") %}
  30.         {% set generalDocuments = generalDocuments|merge([doc]) %}
  31.     {% endif %}
  32. {% endfor %}
  33. {% extends '@ElementsDemiFrontend/Layout/layout.html.twig' %}
  34. {% block content %}
  35. {#    TODO @msteyrer breadcrumb helper bundle not in use atm#}
  36. {#    {% do breadcrumbHelper().set({#}
  37. {#        'parentId': document.id,#}
  38. {#        'url': breadcrumbUrl,#}
  39. {#        'label': offeritem.name(language)|default('')#}
  40. {#    }) %}#}
  41. {#    {{ include('@ElementsDemiFrontend/Navigation/breadcrumb.html.twig') }}#}
  42.     {% do jsonLd().add("AdditionalService", demi_additionalJsonlDData(offeritem, viewdata.fromToRanges, {locale: language})) %}
  43. {#    {% do jsConfig().add('tracking', true) %}#}
  44. {#    {% do jsConfig().add('activityList', true) %}#}
  45. {#    {% do jsConfig('_config').add('initialTracking', [{#}
  46. {#        type:  'detailView',#}
  47. {#        data: {#}
  48. {#            id: viewdata.provider.id,#}
  49. {#            name: demi_impressionName(viewdata.provider),#}
  50. {#            category: demi_impressionCategory(viewdata.provider, null, null, null, offeritem),#}
  51. {#            brand: demi_impressionBrand(viewdata.provider),#}
  52. {#            price: demi_getFirstPrice(offeritem),#}
  53. {#        }#}
  54. {#    }]) %}#}
  55. {#    {{ dump(jsConfig()) }}#}
  56. {#    {% do jsConfig().add('ajaxModal', true) %}#}
  57.     {% do jsConfig().add({
  58.         tracking: true,
  59.         activityList: true,
  60.         initialTracking: [{
  61.             type:  'detailView',
  62.             data: {
  63.                 id: viewdata.provider.id,
  64.                 name: demi_impressionName(viewdata.provider),
  65.                 category: demi_impressionCategory(viewdata.provider, null, null, null, offeritem),
  66.                 brand: demi_impressionBrand(viewdata.provider),
  67.                 price: demi_additionalGetFirstPrice(offeritem),
  68.             }
  69.         }],
  70.         ajaxModal: true,
  71.         ajaxOverlay: true,
  72.         offerOverlay: true,
  73.         additionalOffersJson: {},
  74.         overlay: true
  75.     }) %}
  76.     {{ include("@ElementsDemiFrontend/Includes/canonicalOverride.html.twig", {
  77.         object: offeritem
  78.     }) }}
  79.     {% if not activeTab|default('') in viewdata.anchors %}
  80.         {% set activeTab = '#details' %}
  81.     {% else %}
  82.         {% do jsConfig('_initialState').add('activeTab', activeTab|default('')) %}
  83.     {% endif %}
  84. <main id="main" role="main" class="js-affix__container">
  85.     <div class="ribbon row row--gutter-width-1 d-md-none">
  86.         <div class="col col-auto d-flex flex-column">
  87.             <button type="button" onclick="history.back()"
  88.                     class="ribbon__item py-3 btn-no-styling px-3 flex-auto flex-row">
  89.                 <span class="demi-icon demi-icon-chevron-left f17" aria-label="{{ 'demi.back'|trans }}"
  90.                       title="{{ 'demi.back'|trans }}"></span>
  91.             </button>
  92.         </div>
  93.         <div class="col">
  94.             <div class="ribbon__item py-3 font-medium h-100">
  95.                 <div class="row  row--gutter-width-10 align-items-baseline">
  96.                     <a href="#" onclick="history.back()">{{ 'demi.back'|trans }}</a>
  97.                 </div>
  98.             </div>
  99.         </div>
  100.     </div>
  101.     {{ include('@ElementsDemiFrontend/Includes/modals/warningOnMultipleAccoProductsModal.html.twig', {
  102.         cartUrl: viewdata.cartUrl,
  103.     }) }}
  104.     <div hidden>
  105.         {{ include('@ElementsDemiFrontend/Accommodation/lightboxTopbar.html.twig') }}
  106.     </div>
  107.     {% if viewdata.photoCount >= 1 %}
  108.         {% do jsConfig().add('lightbox', true) %}
  109.         {% if pimcore_device().isDesktop() %}
  110.             {{ include('@ElementsDemiFrontend/AdditionalService/includes/additionalservice-header-multi-image.desktop.html.twig', {
  111.                 photoCount: viewdata.photoCount,
  112.                 imageList: viewdata.detailSlides
  113.             }) }}
  114.         {% endif %}
  115.         {% if not pimcore_device().isDesktop() %}
  116.             <figure class="figure">
  117.                 {% if offeritem.getFirstImage(null, fromDate) %}
  118.                     {{ offeritem.getFirstImage(null, fromDate).thumbnail('demi-mobile-header-img').html({
  119.                         class: 'img-full-width'
  120.                     })|raw }}
  121.                 {% endif %}
  122.                 {% if viewdata.photoCount > 1 %}
  123.                     <div class="figure__item figure__item--right figure__item--bottom m-3">
  124.                         <button class="btn btn-primary js-overlay__toggle js-tracking--click-piwik"
  125.                                 data-target="#{{ offeritem.id }}-imgs-overlay"
  126.                                 data-tracking-category="Gallery"
  127.                                 data-tracking-action="open">
  128.                             {% set galleryString = (viewdata.photoCount > 1 ? 'demi.detail.images-gallery-button'|trans : 'demi.detail.image-gallery-button'|trans)|replace({'[AMOUNT_IMAGES]': viewdata.photoCount}) %}
  129.                             {{ galleryString }}
  130.                         </button>
  131.                     </div>
  132.                 {% endif %}
  133.             </figure>
  134.         {% endif %}
  135.     {% endif %}
  136.     {{ include('@ElementsDemiFrontend/Includes/elements/breadcrumb.html.twig') }}
  137.     <div class="container container--additional-service-detail pt-4 pt-md-5">
  138.         <div class="row mb-md-3">
  139.             <div class="col">
  140.                 {{ include('@ElementsDemiFrontend/AdditionalService/detail/intro.html.twig', {
  141.                     detailHeadline: offeritem.name(language),
  142.                 }) }}
  143.                 {% if viewdata.serviceTown|default(null) %}
  144.                     <div class="media text-muted mb-md-0 mb-3">
  145.                         <div class="demi-icon demi-icon-marker mr-1 icon-in-text"
  146.                              title="{{ 'demi.detail.town'|trans }}"
  147.                              aria-label="{{ 'demi.detail.town'|trans }}"></div>
  148.                         <div class="media-body">
  149.                             {{ viewdata.serviceTown }}
  150.                         </div>
  151.                     </div>
  152.                 {% endif %}
  153.             </div>
  154.             <div class="col col-auto">
  155.                 <div>
  156.                     {% set logos = viewdata.provider.getImages([constant('\\Elements\\Demi\\Deskline\\Constant\\DocumentInterface::DOCUMENT_TYPE_SERVICE_PROVIDER_LOGO')]) %}
  157.                     {% if not logos is empty %}
  158.                         {{ include('@ElementsDemiFrontend/Accommodation/includes/serviceprovider-logo.html.twig', {
  159.                             logo: logos[0]
  160.                         }) }}
  161.                     {% endif %}
  162.                 </div>
  163.             </div>
  164.         </div>
  165.         <div class="row">
  166.             <div class="col-xl-9 col-md-8 col-12 order-2 order-md-1">
  167.                 <script data-cookieconsent="ignore">
  168.                     _config.paramTabs = true;
  169.                     _config.loadAccoImages = true;
  170.                 </script>
  171.                 <div class="mt-md-3">
  172.                     <ul class="nav nav-border-tabs d-none d-md-flex" role="tablist">
  173.                         <li class="nav-item">
  174.                             <a class="nav-link js-param-tab {{ activeTab|default('') == viewdata.anchors['details'] ? ' active' : '' }} js-tracking js-tracking--click"
  175.                                href="{{ viewdata.anchors['details'] }}"
  176.                                data-toggle="tab"
  177.                                role="tab"
  178.                                aria-expanded="{{ activeTab|default('') == viewdata.anchors['details'] ? 'true' : 'false' }}"
  179.                                data-tracking-category="button"
  180.                                data-tracking-action="additionalservice-details"
  181.                                data-tracking-label="{{ offeritem.name|escape('html') }}">
  182.                                 {{ "demi.additionalservice.detail.tab.description"|trans }}
  183.                             </a>
  184.                         </li>
  185.                         {% if viewdata.photoCount > 3 %}
  186.                             <li class="nav-item">
  187.                                 <a class="nav-link js-param-tab js-acco-images__tab {{ activeTab|default('') == viewdata.anchors['pictures'] ? ' active' : '' }} js-tracking js-tracking--click"
  188.                                    href="{{ viewdata.anchors['pictures'] }}"
  189.                                    data-toggle="tab"
  190.                                    role="tab"
  191.                                    aria-expanded="{{ activeTab|default('') == viewdata.anchors['pictures'] ? 'true' : 'false' }}"
  192.                                    data-tracking-category="button"
  193.                                    data-tracking-action="additionalservice-pictures"
  194.                                    data-tracking-label="{{ offeritem.name|escape('html') }}">
  195.                                     {% if viewdata.videoCount|default(0) == 0 %}
  196.                                         {{ "demi.detail.tab.photos"|trans }}
  197.                                     {% else %}
  198.                                         {{ "demi.detail.tab.photos-videos"|trans }}
  199.                                     {% endif %}
  200.                                 </a>
  201.                             </li>
  202.                         {% endif %}
  203.                     </ul>
  204.                 </div>
  205.                 <div class="pt-md-2">
  206.                     <div class="tab-content">
  207.                         <div class="tab-pane pt-md-2{{ activeTab == viewdata.anchors['details'] ? ' active' : '' }}"
  208.                              id="details" role="tabpanel">
  209.                             {% set infoTemplateName = viewdata.descriptionTypes|length + viewdata.localDescriptions|length > 4 ? "serviceInfoCollapse" : "serviceInfo" %}
  210.                             {{ include('@ElementsDemiFrontend/AdditionalService/detail/' ~ infoTemplateName ~'.html.twig', {
  211.                                 detailHeadline: 'demi.additionalservice.detail.service-headline-description'|trans,
  212.                                 detailText: viewdata.serviceDescription|default(''),
  213.                                 moreDescriptions: viewdata.descriptionTypes,
  214.                                 localDescriptions: viewdata.localDescriptions,
  215.                                 offerItem: offeritem
  216.                             }) }}
  217.                             {% if not viewdata.providerDescription is empty %}
  218.                                 {{ include('@ElementsDemiFrontend/AdditionalService/detail/serviceproviderInfo.html.twig', {
  219.                                     detailHeadline: 'demi.additionalservice.detail.serviceprovider-headline-description'|trans,
  220.                                     detailText: viewdata.providerDescription,
  221.                                 }) }}
  222.                             {% endif %}
  223.                             {% if not viewdata.datesAndTimes is empty and (not viewdata.datesAndTimes.dates is empty or not viewdata.datesAndTimes.times is empty) %}
  224.                                 {{ include('@ElementsDemiFrontend/AdditionalService/detail/date.html.twig', {
  225.                                     detailDate: viewdata.datesAndTimes.dates|join("<br>"),
  226.                                     detailTime: viewdata.datesAndTimes.times
  227.                                 }) }}
  228.                             {% endif %}
  229.                             {{ include('@ElementsDemiFrontend/AdditionalService/detail/contact.html.twig', {
  230.                                 service: offeritem,
  231.                                 addressOwner: addressOwner|default(null),
  232.                                 addressObject: addressObject|default(null)
  233.                             }) }}
  234.                             {% if not viewdata.linkArray is empty %}
  235.                                 {{ include('@ElementsDemiFrontend/AdditionalService/detail/links.html.twig', {
  236.                                     detailHeadline: templateData|default(null) ? templateData.detailLinkHeader : '',
  237.                                     detailLinks: viewdata.linkArray,
  238.                                 }) }}
  239.                             {% endif %}
  240.                             {% if generalDocuments is not empty %}
  241.                                 {{ include('@ElementsDemiFrontend/AdditionalService/includes/documents.html.twig', {
  242.                                     'detailDocuments' : generalDocuments
  243.                                 }) }}
  244.                             {% endif %}
  245.                         </div>
  246.                         {% if viewdata.photoCount > 3 %}
  247.                             <div class="tab-pane pt-md-2{{ activeTab == viewdata.anchors.pictures ? ' active' : '' }}" id="pictures" role="tabpanel">
  248.                                 {{ include('@ElementsDemiFrontend/Accommodation/includes/acco-pictures.desktop.html.twig', {
  249.                                     additionalService: true,
  250.                                     photoCount: viewdata.photoCount,
  251.                                     fromDate: fromDate,
  252.                                     imageList: viewdata.detailSlides,
  253.                                     package: null
  254.                                 }) }}
  255.                             </div>
  256.                         {% endif %}
  257.                     </div>
  258.                 </div>
  259.             </div>
  260.             <script>_config.affix = true;</script>
  261. {#            DEMI ADJUSTMENTS: styling #}
  262.             <div class="col-12 col-md-4 col-xl-3 order-1 order-md-2">
  263.                 <div class="js-affix__placeholder">
  264.                     <div class="card bordered additional-offer-card" data-affix-offset="149">
  265.                         <div class="card-body additional-offer-card__body p-md-4 p-2">
  266.                             <div>
  267.                                 <div class="container" id="vacancysearch">
  268.                                     <div class="py-2">
  269.                                         <div class="js-ajax-form js-additional-services">
  270.                                             <div aria-live="polite">
  271.                                                 {% if viewdata.latest.gte(carbon().now) %}
  272.                                                     {{ include('@ElementsDemiFrontend/AdditionalService/detail/vacancysearch.html.twig', {
  273.                                                         detailHeadline: 'demi.additionalservice.detail.datepicker-notice'|trans,
  274.                                                         dateFromLabel: 'demi.additionalservice.detail.from'|trans,
  275.                                                         dateToLabel: 'demi.additionalservice.detail.to'|trans,
  276.                                                         detailEarliest: viewdata.earliest,
  277.                                                         detailLatest: viewdata.latest,
  278.                                                     }) }}
  279.                                 
  280.                                                 {% else %}
  281.                                                     {{ include('@ElementsDemiFrontend/AdditionalService/detail/serviceover.html.twig', {
  282.                                                         detailHeadline: 'demi.additionalservice.detail.offer-over'|trans
  283.                                                     }) }}
  284.                                                 {% endif %}
  285.                                             </div>
  286.                                         </div>
  287.                                     </div>
  288.                                 </div>
  289.                             </div>
  290.                         </div>
  291.                     </div>
  292.                 </div>
  293.             </div>
  294.         </div>
  295.     </div>
  296.     <div class="container container--additional-service-related">
  297.         <div class="pt-2">
  298.             {% if false and relatedItems and relatedItems|length %}
  299.                 {{ include('@ElementsDemiFrontend/AdditionalService/detail/relatedItems.html.twig', {
  300.                     detailRelatedItems: relatedItems,
  301.                     detailHeadline: 'demi.additionalservice.detail.headline-relatedservices'|trans
  302.                 }) }}
  303.             {% endif %}
  304.             {% if not offeritem.getDemiExtension() is empty %}
  305.                 {{ include('@ElementsDemiFrontend/AdditionalService/detail/demiExtension.html.twig', {
  306.                     detailExtension: offeritem.getDemiExtension(),
  307.                 }) }}
  308.             {% endif %}
  309.         </div>
  310.     </div>
  311. </main>
  312. {{ include('@ElementsDemiFrontend/Includes/overlays/img-gallery.html.twig', {
  313.     additionalService: offeritem,
  314.     tvbPackage: null,
  315.     destinationPackage: null,
  316.     imagesTypes: []
  317. }) }}
  318. {% if pimcore_device().isPhone() %}
  319.     {{ include('@ElementsDemiFrontend/Includes/overlays/date.html.twig', {
  320.         'date': carbon().now()
  321.     }) }}
  322. {% endif %}
  323. {% endblock %}