src/Elements/Bundle/DemiFrontendBundle/Resources/views/Accommodation/includes/acco-details.mobile.html.twig line 1

Open in your IDE?
  1. {% set hasRatingWidget = demi_ratingGetHasRatingWidgetTrustYou(accommodation) %}
  2. {% set extension = accommodation.getDemiExtension().getDemiEnrichAcco() %}
  3. {% set hasBookingLink = false %}
  4. {% if extension and extension.getDemiEnrichAccoObject() is instanceof("\\Pimcore\\Model\\DataObject\\DemiEnrichAcco") and extension.getDemiEnrichAccoObject().getBookingUrl() %}
  5.     {% set hasBookingLink = true %}
  6.     {% set bookingLink = demi_findNiceUrl(extension.getDemiEnrichAccoObject().getBookingUrl()) %}
  7. {% endif %}
  8. <section class="container">
  9.     {% if impressionLinks is not empty %}
  10.         {{  include("@ElementsDemiFrontend/Accommodation/includes/detail-templates/impressions.mobile.html.twig", {
  11.             "package": package,
  12.             'impressionLinks': impressionLinks,
  13.             "photoCount": photoCount,
  14.             "trackingLabel": accommodation.getId()
  15.         }) }}
  16.     {% endif %}
  17.     <section class="mt-4" data-track-content
  18.              data-content-name="{{ package is defined and package is not null ? 'package-' : '' }}accommodation-description">
  19.         <h2 class="h3 mb-2">{{ 'demi.detail.headline.acco-details'|trans }}</h2>
  20.         <div class="card box-shadow js-expandable expandable-block">
  21.             <script data-cookieconsent="ignore">
  22.                 _config.expandable = true;
  23.             </script>
  24.             <div class="expandable-block__content-wrapper js-expandable__content-wrapper">
  25.                 <div class="card-body js-expandable__content expandable-block__content">
  26.                     <div class="wysiwyg">
  27.                         {{ include('@ElementsDemiFrontend/Accommodation/includes/detail-templates/acco-current-information.html.twig', {'accommodation': accommodation}) }}
  28.                         {{ accommodation.getDescription(null, app.request.locale, fromDate)|raw }}
  29.                     </div>
  30.                     {% set marketingLogos = [] %}
  31.                     {% set noLogoMarketingGroups = [] %}
  32.                     {% if sortedMarketingGroups is not empty %}
  33.                         {% for marketingGroup in  sortedMarketingGroups %}
  34.                             {% set marketingGroupId = marketingGroup.getId() %}
  35.                             {% if marketingGroup.getName(app.request.locale) is not empty %}
  36.                                 {% if marketingGroup.demiGetIcon() is not empty %}
  37.                                     {% set marketingLogos = marketingLogos | merge({marketingGroupId: {
  38.                                         'name': marketingGroup.getName(app.request.locale),
  39.                                         'icon': marketingGroup.demiGetIcon(),
  40.                                         'text': marketingGroup.getTooltip()
  41.                                     }}) %}
  42.                                 {% else %}
  43.                                     {% if marketingGroup.getId() not in (marketingLogos|keys) %}
  44.                                         {% set noLogoMarketingGroups = noLogoMarketingGroups | merge([marketingGroup]) %}
  45.                                     {% endif %}
  46.                                 {% endif %}
  47.                             {% endif %}
  48.                         {% endfor %}
  49.                         {{ include("@ElementsDemiFrontend/Accommodation/includes/detail-templates/marketinggroups.mobile.html.twig",{
  50.                             "noLogoMarketingGroups": noLogoMarketingGroups,
  51.                             "marketingLogos": marketingLogos
  52.                         }) }}
  53.                     {% endif %}
  54.                     {{ include("@ElementsDemiFrontend/Accommodation/includes/detail-templates/classifications.html.twig", []) }}
  55.                 </div>
  56.             </div>
  57.             {{ include('@ElementsDemiFrontend/Includes/elements/read-more.mobile.html.twig') }}
  58.         </div>
  59.     </section>
  60.     {% if sortedHealthMeasures is not empty %}
  61.         {{ include("@ElementsDemiFrontend/Accommodation/includes/detail-templates/health-and-security.mobile.html.twig", {
  62.             "package": package,
  63.             "sortedFacilities": sortedHealthMeasures,
  64.             "headlineKey": "demi.detail.headline.health-facilities"
  65.         }) }}
  66.     {% endif %}
  67.     {% set hostInfo = demi_getHostInformation(accommodation) %}
  68.     {% set hostImages = hostInfo["hostImages"] %}
  69.     {% set hostDescriptions = hostInfo["hostDescriptions"] %}
  70.     {{ include("@ElementsDemiFrontend/Accommodation/includes/detail-templates/hostdescriptions.mobile.html.twig", {
  71.         "package": package,
  72.         "hostImages": hostImages,
  73.         "hostDescriptions": hostDescriptions
  74.     }) }}
  75.     {% set links = accommodation.getLinks([
  76.         constant("Elements\\Demi\\Deskline\\Constant\\LinkTypeInterface::DESKLINE_LINK_URL"),
  77.         constant("Elements\\Demi\\Deskline\\Constant\\LinkTypeInterface::DESKLINE_LINK_NOTDEFINED")]) %}
  78.     {% set lt = accommodation.getDescription(constant("\\Elements\\Demi\\Deskline\\Constant\\DescriptionInterface::DESCRIPTION_SERVICE_PROVIDER_CONDITIONS"), app.request.locale, fromDate) %}
  79.     {% if lt is empty %}
  80.         {% set lt = accommodation.getDescription(constant("\\Elements\\Demi\\Deskline\\Constant\\DescriptionInterface::DESCRIPTION_SERVICE_PROVIDER_CONDITIONS"), "en", fromDate) %}
  81.     {% endif %}
  82.     {% if sortedFacilities is not empty or links is not empty or lt is not empty %}
  83.         {{ include("@ElementsDemiFrontend/Accommodation/includes/detail-templates/facilities.mobile.html.twig", {
  84.             "package": package,
  85.             "sortedFacilities": sortedFacilities,
  86.             "links": links,
  87.             "lt": lt
  88.         }) }}
  89.     {% endif %}
  90.     {% if accommodation.getDemiExtension() is not empty %}
  91.         {{ include("@ElementsDemiFrontend/Accommodation/includes/detail-templates/demiExtensions.mobile.html.twig", {
  92.             "extensions": accommodation.getDemiExtension(),
  93.             "package": package
  94.         }) }}
  95.     {% endif %}
  96.     {% set lat = "" %}
  97.     {% set lng = "" %}
  98.     {% if accommodation.getPosition() is not empty and address is not empty %}
  99.         {% set pos = accommodation.getPosition() %}
  100.         {% if pos.getLatitude() is not empty and pos.getLongitude() is not empty %}
  101.             {% set lat = pos.getLatitude %}
  102.             {% set lng = pos.getLongitude() %}
  103.         {% endif %}
  104.         {% set googleMapLink = demi_getGoogleMapsUrl(
  105.             accommodation.getName() ~ demi_getStars(accommodation, true),
  106.             address,
  107.             app.request.locale,
  108.             lat,
  109.             lng,
  110.             accommodation.getProperty('google_place_id')
  111.         ) %}
  112.     {% endif %}
  113.     {% if address is not empty or  accommodation.getServiceProviderArrivalVoucher() is not empty %}
  114.         <section class="mt-4 accommodation-contact" data-track-content
  115.                  data-content-name="{{ package ? 'package-' : 'accommodation-' }}contact">
  116.             <h2 class="h3 mb-2">{{ 'demi.detail.headline.contact-and-getting-there'|trans }}</h2>
  117.             <div class="card box-shadow">
  118.                 <div class="card-body">
  119.                     {% if address is not empty %}
  120.                         {{ include("@ElementsDemiFrontend/Accommodation/includes/detail-templates/contactaddress.mobile.html.twig", {
  121.                             'headlineText': demi_getAccoNameWithStars(accommodation),
  122.                             'address': address,
  123.                             'googleMapLink': googleMapLink is defined ? googleMapLink : null,
  124.                             'trackingLabel': accommodation.getName(),
  125.                             'lat': lat,
  126.                             'lng': lng,
  127.                             'acco': accommodation
  128.                         }) }}
  129.                     {% endif %}
  130.                     {% if accommodation.getServiceProviderArrivalVoucher() is not empty %}
  131.                         {{ include("@ElementsDemiFrontend/Accommodation/includes/detail-templates/arrivalvoucher.mobile.html.twig", {
  132.                             'accommodation': accommodation
  133.                         }) }}
  134.                     {% endif %}
  135.                 </div>
  136.             </div>
  137.         </section>
  138.     {% endif %}
  139.     {% if accommodation.getRatingSystem() == "TrustYou" and hasRatingWidget == true %}
  140.         {{ include("@ElementsDemiFrontend/Accommodation/includes/detail-templates/rating.mobile.html.twig", {
  141.             'package': package,
  142.             'accommodation': accommodation
  143.         }) }}
  144.     {% endif %}
  145.     <div class="mt-4">
  146.         {% if package  %}
  147.             {% set id = "booking" %}
  148.         {% else %}
  149.             {% set id = "rooms" %}
  150.         {% endif %}
  151.         {% if hasBookingLink or accommodation.getSystemIdentifier() is same as "Deskline" %}
  152.             <div class="js-search-data__show-if-submitted " {{ availabilityIsChecked ? 'hidden' : '' }} >
  153.                 <a href="#{{ id }}"
  154.                    data-target="#{{ id }}"
  155.                    aria-controls="{{ id }}"
  156.                    class="btn btn-success btn-block btn-lg js-open-tab-and-scroll js-tracking--click"
  157.                    data-tracking-category="{{ package ? 'Package detail': 'Accommodation detail' }}"
  158.                    data-tracking-action="click booking detail bottom"
  159.                 >
  160.                     <script data-cookieconsent="ignore">
  161.                         _config.openTabAndSroll = true;
  162.                     </script>
  163.                     <span class="btn__icon demi-icon demi-icon-cart mr-2" aria-hidden="true"></span>
  164.                     {{ "demi.detail.booking-button"|trans }}
  165.                 </a>
  166.                 <div class="mt-2 text-center text-success small">
  167.                     {{ "demi.detail.promote-booking-speed"|trans }}
  168.                 </div>
  169.             </div>
  170.             {% if hasBookingLink %}
  171.                 <a class="btn btn-success btn-block btn-lg my-3"
  172.                    href="{{ bookingLink }}" target="_blank">
  173.                     <span class="demi-icon demi-icon-person btn__icon"></span>
  174.                     {{ "demi.detail.external-booking.cta" | trans }}
  175.                 </a>
  176.             {% else %}
  177.                 {% set resultSet =  accommodationResultSet is defined ? accommodationResultSet : null %}
  178.                 {% if demi_accoBookableOrOfferable(accommodation, resultSet ,demi_core_configuration("getDisableEnquiry",[])) and not document.property("demi_hideVacancySearch") %}
  179.                     <button type="button"
  180.                             class="btn btn-success btn-block btn-lg js-overlay__toggle my-3 js-open-tab-and-scroll js-search-data__hide-if-submitted"
  181.                             data-tab-target="#{{ id }}"
  182.                             data-target="#search-overlay" {{ availabilityIsChecked ? 'hidden' : '' }}>
  183.                         <span class="demi-icon demi-icon-person btn__icon"></span>
  184.                         {{ 'demi.detail.search-vacancies-button'|trans }}
  185.                     </button>
  186.                 {% endif %}
  187.             {% endif %}
  188.         {% endif %}
  189.     </div>
  190. </section>