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

Open in your IDE?
  1. {% if not editmode %}
  2.     {% do elements_head_title().setTitle( demi_seoTitleForAcco(accommodation,document), true ) %}
  3.     {% do elements_head_meta().setDescription( demi_seoDescriptionforAcco(accommodation) ) %}
  4. {% endif %}
  5. {% set destinationPackages = destinationPackages is defined ? destinationPackages : null %}
  6. {#{% set canonicalUrl = demi_demiUrl({#}
  7. {#    'accommodation': accommodation#}
  8. {#},'demi_acco_detail_page',true) %}#}
  9. {% set canonicalUrl = linkGenerator().generate(accommodation, {canonical: true, relative: false, reset: true}) %}
  10. {% do elements_canonical().checkAllParams(false).setDomain(canonicalUrl)|raw %}
  11.  {% if not canonicalUrl is same as(app.request.pathInfo) %}
  12.      {% do elements_robots().setNoIndex(true) %}
  13.  {% endif %}
  14. {% extends '@ElementsDemiFrontend/Layout/layout.html.twig' %}
  15. {% block content %}
  16.     {% do demi_paymentSetDefaultCurrency(accommodation) %}
  17.     {% if not availabilityIsChecked %}
  18.         {% set fromDate = null %}
  19.     {% else %}
  20.         {% set fromDate = demi_getSearchFrom() %}
  21.     {% endif %}
  22.     {% set resultSetPresent = false %}
  23.     {% if accommodationResultSet is defined and accommodationResultSet is not null and accommodationResultSet.getMinPriceProductSets is not empty and accommodationResultSet.getMinPriceProductSets()|length > 0 %}
  24.         {% set resultSetPresent = true %}
  25.     {% endif %}
  26.     {% set ajaxUrl = demi_demiUrl({
  27.         'accommodation': accommodation
  28.     },'demi_acco_ajax') %}
  29.     {% if  '?' in ajaxUrl %}
  30.         {% set parts = ajaxUrl|split('?') %}
  31.         {% set ajaxUrl = parts[0] %}
  32.     {% endif %}
  33.     {% set liveDetailProductsUrl = ajaxUrl ~ "?ajaxRequestType=getLiveDetailProducts" %}
  34.     {% set corridorMatrixUrl = ajaxUrl ~ "?ajaxRequestType=getCorridorMatrix" %}
  35.     {% set productUrl = ajaxUrl ~ "?ajaxRequestType=getProductByIdAndMealcode" %}
  36.     {% set paymentInformationUrl = ajaxUrl ~ "?ajaxRequestType=getProductByIdAndMealcode" %}
  37.     {% set address = accommodation.getAddress() %}
  38.     {% set maxRatingValue = demi_core_configuration('getMaxRatingValue',[]) ?: 5 %}
  39.     {% set maxRatingNormalized = demi_core_configuration('getMaxRatingNormalized',[]) ?: 5 %}
  40.     {% set anchors = {
  41.         'detail': '#details',
  42.         'package': '#packages',
  43.         'rooms': '#rooms'
  44.     } %}
  45.     {% if activeTab is defined and activeTab not in anchors %}
  46.         {% set activeTab = '#details' %}
  47.     {% else %}
  48.         {% do jsConfig('_initialState').add({'activeTab': activeTab}) %}
  49.     {% endif %}
  50.     {% set step1Url = demi_demiUrl({
  51.         'path': demi_core_configuration('getCheckoutPath',[]).getFullPath(),
  52.         'controller': 'cart',
  53.         'action': 'step1'
  54.     },'demi_checkout',true) %}
  55.     {% set addToCartUrl = step1Url %}
  56.     {% set imagesTypes = demi_getAccoImagesTypesAsArray(accommodation) %}
  57.     {% set classifications = accommodation.getClassifications() %}
  58.     {% set hasClassificationsWithIcons = false %}
  59.     {% for classification in classifications %}
  60.         {% set group = classification.getClassificationGroup() %}
  61.         {% if group is not empty and group.getIconSmall() %}
  62.             {% set hasClassificationsWithIcons = true %}
  63.         {% endif %}
  64.     {% endfor %}
  65.     {% set jsonLdData = demi_getAccommodationJsonLdData(accommodation, options is defined ? options : [], packages is defined ? packages : null) %}
  66.     {% do jsonLd().add("accommodation", jsonLdData) %}
  67.     {# TODO @msteyrer breadcrumb helper bundle not in use atm
  68.            {% do breadcrumbHelper().set({
  69.                'parentId': document.getId(),
  70.                'url': accoUrlPlain,
  71.                'label': accommodation.getName()
  72.            }) %}
  73.            {{ include('@ElementsDemiFrontend/Navigation/breadcrumb.html.twig') }} #}
  74.     <script data-cookieconsent="ignore">
  75.         _config.viewType = "object";
  76.         _config.historyController = true;
  77.         _config.roomSelection = true;
  78.         _config.searchData = true;
  79.         _config.detailResultUrl = '{{ liveDetailProductsUrl }}';
  80.         _config.corridorSearchUrl = '{{ corridorMatrixUrl }}';
  81.         _config.detailPaymentInfoUrl = '{{ paymentInformationUrl }}';
  82.         _config.detailProductUrl = '{{ productUrl }}';
  83.         _config.addToCartUrl = '{{ addToCartUrl }}';
  84.         _config.addToCartUrl = '{{ addToCartUrl|raw }}';
  85.         _config.cartWarningOnMultipleAccoProducts = {{ demi_core_configuration('getWarningOnMultipleAccoProducts',[]) ? 'true': 'false' }};
  86.         _config.cartInfoUrl = '{{ demi_checkoutUrl('cart','hasAccoInCart')|raw }}';
  87.         _config.roomList = true;
  88.         _config.paramTabs = true;
  89.         _config.isWhitelabel = {{ demi_core_configuration("getIsWhitelabel",[]) ? 'true' : 'false' }};
  90.         _config.trackingCountingClicksUrl = '{{ countingClicksUriJs|raw }}';
  91.         _config.productData = {
  92.             id: {{ accommodation.getId() }},
  93.             name: "{{ demi_impressionName(accommodation) }}",
  94.             category: "{{ demi_impressionCategory(accommodation, null, searchParam) }}",
  95.             brand: "{{ demi_impressionBrand(accommodation) }}"
  96.         };
  97.         _config.acommodationMapHideBusinesses = {{ demi_core_configuration('getMapHideBusinesses',[]) ? 'true' : 'false' }};
  98.         {% set mealtypeId = searchParam.getMealTypeId() %}
  99.         {% if mealtypeId is not empty and mealtypeId[0] is not empty %}
  100.         _config.urlParams = _config.urlParams || [];
  101.         _config.urlParams.push({name: "mealtype", value: "{{ mealtypeId[0] }}"});
  102.         {% endif %}
  103.         {% if searchParam.getBookOnly() %}
  104.         _config.urlParams = _config.urlParams || [];
  105.         _config.urlParams.push({name: "bookonly", value: "on"});
  106.         {% endif %}
  107.     </script>
  108.     {{ include('@ElementsDemiFrontend/Includes/canonicalOverride.html.twig', {'object' : accommodation }) }}
  109.     {{ include('@ElementsDemiFrontend/Includes/tags/detail-acco.html.twig',
  110.         {
  111.             'isMobile': false,
  112.             'acco': accommodation,
  113.             'searchParam': searchParam,
  114.             'accoResultSet': accommodationResultSet,
  115.             'productResultSet': productResultSet,
  116.             'packages': packages is defined ? packages : null,
  117.             'sortedMarketingGroups': sortedMarketingGroups,
  118.             'sortedFacilities': sortedFacilities,
  119.             'sortedHealthMeasures':sortedHealthMeasures,
  120.             'hasHousePackages': hasHousePackages
  121.         }
  122.     ) }}
  123.     <main id="main" role="main">
  124.         <div>
  125.             <div class="js-search-data__show-if-submitted" {{ availabilityIsChecked ? '' : 'hidden' }}>
  126.                 {{ include('@ElementsDemiFrontend/Includes/ribbon.html.twig',{'searchParam': searchParam,'showBackButton': true, 'withFlag': false}) }}
  127.             </div>
  128.             <div class="js-search-data__hide-if-submitted" {{ availabilityIsChecked ? 'hidden' : '' }}>
  129.                 {{ include('@ElementsDemiFrontend/Includes/ribbon-price.html.twig',{'resultSet': accommodationResultSet ? accommodationResultSet.getMinPriceBase(true): null, 'accommodation': accommodation}) }}
  130.             </div>
  131.         </div>
  132.         <div class="container">
  133.             {% if accommodation.getIsTesthotel() %}
  134.                 <div class="demi-test-acco-notice mb-3 text-danger"><strong>Testbetrieb</strong> nur für Debug/aktive
  135.                     Pimcore User sichtbar
  136.                 </div>{% endif %}
  137.             <h1 class="h2 text-primary{{ hasClassificationsWithIcons ? ' mb-1' : '' }}">{{ demi_getAccoNameWithStars(accommodation) }}</h1>
  138.             {% for classification in classifications %}
  139.                 <div class="row row--gutter-width-20 mb-2">
  140.                     <div class="col col-auto">
  141.                         {% set count = classification.getClassificationGroupAmount() %}
  142.                         {% set group = classification.getClassificationGroup() %}
  143.                         {% if count is not empty and classification.getShowAsIcon() and classification.demiGetIcon() is not null %}
  144.                             <span class="classification_holder hidden-xs"
  145.                                   aria-label="{{ count }} {{ group.getName() }}">
  146.                             {% for c in 0..count %}
  147.                                 {% set thumbnail = classification.demiGetIcon().getThumbnail('demi-classification') %}
  148.                                 {{ thumbnail.getHTML()|raw }}
  149.                             {% endfor %}
  150.                                 {% if classification.getIsSuperior() %}
  151.                                     <span class="classification-superior">S</span>
  152.                                 {% endif %}
  153.                         </span>
  154.                         {% endif %}
  155.                     </div>
  156.                 </div>
  157.             {% endfor %}
  158.             <div class="row row--gutter-width-20 mb-2">
  159.                 <div class="col col-auto">
  160.                     {{ accommodation.getCategoryNames(2) }}
  161.                 </div>
  162.                 <div class="col">
  163.                     <div class="media text-muted">
  164.                         {% if accommodation.getTown() is not null and (accommodation.getTown().getNameLocalized(app.request.locale) is not empty or accommodation.getTown().getName() is not empty) %}
  165.                             <div class="demi-icon demi-icon-marker mr-1 icon-in-text"
  166.                                  title="{{ 'demi.list.town'|trans }}" aria-label="{{ 'demi.list.town'|trans }}"></div>
  167.                             <div class="media-body">
  168.                                 {{ accommodation.getTown().getNameLocalized(app.request.locale) is not empty ?  accommodation.getTown().getNameLocalized(app.request.locale) : accommodation.getTown().getName() }}
  169.                             </div>
  170.                         {% elseif accommodation.getDistrict() is not null and  (accommodation.getDistrict().getNameLocalized(app.request.locale) or accommodation.getDistrict().getName() is not empty) %}
  171.                             <div class="demi-icon demi-icon-marker mr-1 icon-in-text"
  172.                                  title="{{ 'demi.list.town'|trans }}" aria-label="{{ 'demi.list.town'|trans }}"></div>
  173.                             <div class="media-body">
  174.                                 {{ accommodation.getDistrict().getNameLocalized(app.request.locale) is not empty  ? accommodation.getDistrict().getNameLocalized(app.request.locale) : accommodation.getDistrict().getName() }}
  175.                             </div>
  176.                         {% elseif address is not null and address.getTown is not null %}
  177.                             <div class="demi-icon demi-icon-marker mr-1 icon-in-text"
  178.                                  title="{{ 'demi.detail.town'|trans }}"
  179.                                  aria-label="{{ 'demi.detail.town'|trans }}"></div>
  180.                             <div class="media-body">
  181.                                 {{ address.getTown() }}
  182.                             </div>
  183.                         {% endif %}
  184.                     </div>
  185.                 </div>
  186.             </div>
  187.             <div class="row row--gutter-width-20 mb-2">
  188.                 <div class="col">
  189.                     {% if accommodation.getRatingSystem()=="TrustYou" %}
  190.                         {% set normalizedRating = demi_ratingGetNormalized(accommodation, maxRatingValue, maxRatingNormalized) %}
  191.                         {% if normalizedRating is not empty %}
  192.                             <img src="/static/demi/debug/img/trustyou-logo.png" alt="Logo Trustyou" class="mb-1">
  193.                             {{ include('@ElementsDemiFrontend/Includes/rating.html.twig', {
  194.                                 "score": normalizedRating,
  195.                                 "text": accommodation.getRatingScoreDescription(),
  196.                                 "styleModifier": "mb-1",
  197.                                 "showReviewCount": true,
  198.                                 "ratingCount": accommodation.getRatingCountDirect()
  199.                             }) }}
  200.                         {% endif %}
  201.                     {% endif %}
  202.                 </div>
  203.                 <div class="col col-auto">
  204.                     {{ include('@ElementsDemiFrontend/Accommodation/includes/serviceprovider-logo.html.twig', {
  205.                         "logo": accommodation.getImages([constant('Elements\\Demi\\Deskline\\Constant\\DocumentInterface::DOCUMENT_TYPE_SERVICE_PROVIDER_LOGO')])|first
  206.                     }) }}
  207.                 </div>
  208.             </div>
  209.         </div>
  210.         <figure class="figure my-3">
  211.             {% set firstImage =  accommodation.getFirstImage(imagesTypes,fromDate) %}
  212.             {% if firstImage is not null %}
  213.                 {{ firstImage.getThumbnail('demi-mobile-header-img').getHTML({ 'imgAttributes': {'class': 'img-full-width' }})|raw }}
  214.             {% endif %}
  215.             {% set images = accommodation.getImages(imagesTypes, fromDate, true) %}
  216.             {% set photoCount = images|length %}
  217.             {% if photoCount > 1 %}
  218.                 <div class="figure__item figure__item--right figure__item--bottom m-3">
  219.                     <button class="btn btn-primary js-overlay__toggle js-tracking--click-piwik"
  220.                             data-target="#{{ accommodation.getId() }}-imgs-overlay"
  221.                             data-tracking-category="Gallery"
  222.                             data-tracking-action="open">
  223.                         {% set galleryString = photoCount > 1 ? 'demi.detail.images-gallery-button'|trans : 'demi.detail.image-gallery-button'|trans %}
  224.                         {% set galleryString = galleryString|replace({'[AMOUNT_IMAGES]': photoCount}) %}
  225.                         {% do elements_opengraph().setImages(elements_opengraph().getImages|merge( [app.request.getHost() ~ (images|first).getThumbnail('ogimages')])) %}
  226.                         {{ galleryString }}
  227.                     </button>
  228.                 </div>
  229.                 </div>
  230.             {% endif %}
  231.         </figure>
  232.         <div class="container" aria-live="polite">
  233.             <div class="js-room-list__loading js-corridor__search-info-loading" hidden>
  234.                 <div class="text-center py-3">
  235.                     {{ include('@ElementsDemiFrontend/Includes/elements/spinner/loading-spinner.html.twig') }}
  236.                 </div>
  237.             </div>
  238.             <div class="js-room-list__content js-corridor__search-info-content" id="searchInfo" data-list="searchInfo">
  239.                 {{ include('@ElementsDemiFrontend/Accommodation/searchInfoBox.mobile.html.twig', {
  240.                     "accommodationResultSet": accommodationResultSet,
  241.                     "isPackage": false,
  242.                 }) }}
  243.             </div>
  244.         </div>
  245.         <div class="mt-3">
  246.             <ul class="nav nav-border-tabs justify-content-center" role="tablist">
  247.                 <li class="nav-item">
  248.                     <a class="nav-link js-param-tab{{ activeTab == anchors['detail'] ? ' active' : '' }} js-tracking js-tracking--click"
  249.                        href="{{ anchors['detail'] }}"
  250.                        data-toggle="tab"
  251.                        role="tab"
  252.                        aria-expanded="{{ activeTab == anchors['detail'] ? 'true' : 'false' }}"
  253.                        data-tracking-category="button"
  254.                        data-tracking-action="detail"
  255.                        data-tracking-label="{{ accommodation.getName()|escape }}">
  256.                         {{ 'demi.detail.tab.accommodation-details'|trans }}
  257.                     </a>
  258.                 </li>
  259.                 <li class="nav-item" {{ hasHousePackages or (destinationPackages is not null and destinationPackages|length > 0  and  demi_core_configuration("getShowDestinationPackagesOnAccoDetail",[]))  ? "" : "hidden" }}>
  260.                     <a class="nav-link js-param-tab{{ activeTab == anchors['package'] ? ' active' : '' }} js-tracking js-tracking--click"
  261.                        href="{{ anchors['package'] }}"
  262.                        data-toggle="tab"
  263.                        role="tab"
  264.                        aria-expanded="{{ activeTab == anchors['package'] ? 'true' : 'false' }}"
  265.                        data-tracking-category="button"
  266.                        data-tracking-action="package"
  267.                        data-tracking-label="{{ accommodation.getName()|escape }}">
  268.                         {{ 'demi.detail.tab.packages'|trans }}
  269.                     </a>
  270.                 </li>
  271.                 <li class="nav-item">
  272.                     <a class="nav-link js-param-tab {{ activeTab == anchors['rooms'] ? ' active' : '' }} js-tracking js-tracking--click"
  273.                        href="{{ anchors['rooms'] }}"
  274.                        data-toggle="tab"
  275.                        role="tab"
  276.                        aria-expanded="{{ activeTab == anchors['rooms'] ? 'true' : 'false' }}"
  277.                        data-tracking-category="button"
  278.                        data-tracking-action="rooms"
  279.                        data-tracking-label="{{ accommodation.getName()|escape }}">
  280.                         {{ demi_getRoomsTabTranslationKey(accommodation)|trans }}
  281.                     </a>
  282.                 </li>
  283.             </ul>
  284.         </div>
  285.         <div class="bg-light-gray pb-4 pt-2">
  286.             <div class="tab-content">
  287.                 <div class="tab-pane{{ activeTab == anchors['detail'] ? ' active ' : '' }} pt-2" id="details"
  288.                      role="tabpanel">
  289.                     {{ include("@ElementsDemiFrontend/Accommodation/includes/acco-details.mobile.html.twig" ,{
  290.                         'package': false,
  291.                         'address': address,
  292.                         'photoCount': photoCount is defined ? photoCount : 0,
  293.                         'availabilityIsChecked':  availabilityIsChecked,
  294.                         'fromDate': fromDate
  295.                     }) }}
  296.                 </div>
  297.                 <div class="tab-pane{{ activeTab == anchors['package'] ? ' active ' : '' }} pt-2" id="packages"
  298.                      role="tabpanel">
  299.                     {{ include("@ElementsDemiFrontend/Accommodation/includes/acco-packages.mobile.html.twig" ,{
  300.                         'packages': packages is defined ? packages : null,
  301.                         'destinationPackages': destinationPackages is defined ? destinationPackages : null,
  302.                         'accommodation': accommodation
  303.                     }) }}
  304.                 </div>
  305.                 <div class="tab-pane{{ activeTab == anchors['rooms'] ? ' active ' : '' }} pt-2" id="rooms"
  306.                      role="tabpanel">
  307.                     {{ include("@ElementsDemiFrontend/Accommodation/includes/acco-rooms.html.twig" ,{
  308.                         'package': false,
  309.                         'availabilityIsChecked': availabilityIsChecked,
  310.                         'accommodation': accommodation,
  311.                         'housePackageMaster': null,
  312.                         'resultSetPresent': resultSetPresent,
  313.                         'tvbPackage': null,
  314.                     }) }}
  315.                 </div>
  316.             </div>
  317.             <div class="mt-4 text-center">
  318.                 {{ include("@ElementsDemiFrontend/Accommodation/includes/enquiry-button.html.twig", {
  319.                     "text": "demi.detail.enquiry-button"|trans,
  320.                     "trackingCategory": "Accommodation detail",
  321.                     "trackingAction": "click enquiry"
  322.                 }) }}
  323.             </div>
  324.         </div>
  325.     </main>
  326.     {% set contactSnippet = demi_core_configuration('getContactSnippet',[]) %}
  327.     {% if(contactSnippet is not empty) %}
  328.         {{ pimcore_inc(contactSnippet) }}
  329.     {% endif %}
  330.     {{ include('@ElementsDemiFrontend/Includes/overlays/search.html.twig',{
  331.         'filterSnippet':  pimcore_relation('filterSnippet').getData(),
  332.         'searchParam': searchParam,
  333.         'noDate': noDate is defined ? noDate : searchParam.getDateFrom() is not null,
  334.         'isSearch': true
  335.     }) }}
  336.     {{ include('@ElementsDemiFrontend/Includes/overlays/img-gallery.html.twig',{
  337.         'accommodation': accommodation,
  338.         'imagesTypes': imagesTypes
  339.     }) }}
  340.     {% if demi_core_configuration("getDisableEnquiry",[])!=true and accommodation.getAddress() is not empty and accommodation.getAddress().getEmail() is not empty %}
  341.         {{ include('@ElementsDemiFrontend/Includes/overlays/inquiry-overlay.html.twig', {
  342.             'accommodation': accommodation,
  343.             'searchParams': searchParam,
  344.             'user': user
  345.         }) }}
  346.     {% endif %}
  347.     {% if demi_core_configuration('getWarningOnMultipleAccoProducts',[]) %}
  348.         {{ include('@ElementsDemiFrontend/Includes/modals/warningOnMultipleAccoProductsModal.html.twig', {'cartUrl': step1Url}) }}
  349.     {% endif %}
  350. {% endblock %}