src/Elements/Bundle/DemiFrontendBundle/Resources/views/Includes/elements/search-info.desktop.html.twig line 1

Open in your IDE?
  1. {% set showSearchData = false %}
  2. {% set from = elements_customDateFormat(app.request.get('from')) %}
  3. {% set to = elements_customDateFormat(app.request.get('to')) %}
  4. {% set units = 0 %}
  5. {% set guests = 0 %}
  6. {% set roomrows = searchParam.getRoomrows() %}
  7. {% set hasPackageContainer = hasPackageContainer is defined ? hasPackageContainer : false %}
  8. {% if isAffiliate is not defined %}
  9.     {% set isAffiliate = false %}
  10. {% endif %}
  11. {% if roomrows is iterable %}
  12.     {% for roomrow in roomrows %}
  13.         {% set units = units + roomrow.getUnits() %}
  14.         {% set guests = guests + roomrow.getAdults() %}
  15.         {% if roomrow.getChildAges() is iterable %}
  16.             {% set guests = guests + roomrow.getChildAges() | length %}
  17.         {% endif %}
  18.         {% if roomrow.getChildBirthdays() is iterable %}
  19.             {% set guests = guests + roomrow.getChildBirthdays() | length %}
  20.         {% endif %}
  21.     {% endfor %}
  22. {% endif %}
  23. <script data-cookieconsent="ignore">
  24.     _config.searchData = true;
  25. </script>
  26. <section class="search-info {{ accommodation is defined ? 'acco-detail' :  '' }} {{ isSearch ? '' : 'js-search-data__show-if-submitted' }}" {{ not isSearch and not availabilityIsChecked ? 'hidden' : '' }}>
  27.     <div class="row row--gutter-width-0">
  28.         {% if historyBack is defined %}
  29.             <div class="col col-auto">
  30.                 <button type="button" onclick="history.back()" class="search-info__back-btn btn-no-styling ">
  31.                     <span class="demi-icon demi-icon-chevron-left f17" aria-label="{{ 'demi.back' | trans }}" title="{{ 'demi.back' | trans }}"></span>
  32.                 </button>
  33.             </div>
  34.         {% endif %}
  35.         <div class="col">
  36.             <div class="search-info__data">
  37.                 <div class="row row--gutter-width-xl-60 align-items-center js-search-data__show-if-submitted" {{ availabilityIsChecked ? '' : 'hidden' }}>
  38.                     <div class="col col-auto search-info-item js-overlay__toggle" data-target="#search-overlay">
  39.                         <div class="row">
  40.                             <div class="col col-auto">
  41.                                 <span class="demi-icon demi-icon-calendar-insert mr-1 icon-in-text text-primary" title="{{ 'demi.search.travel-period' | trans }}" aria-label="{{ 'demi.search.travel-period' | trans }}"></span>
  42.                                 {% if from is not instanceof("\\Carbon\\Carbon") %}
  43.                                     {% set from = carbon() %}
  44.                                 {% endif %}
  45.                                 {% if to is not instanceof("\\Carbon\\Carbon") %}
  46.                                     {% set to = date('+7days') %}
  47.                                 {% endif %}
  48.                                 <time datetime="2017-06-16" class="js-search-data__arrival">{{ elements_dateFormat(from, "date-day_date_long") }}</time>
  49.                                 <span class="search-info__from-to-icon demi-icon demi-icon-arrow-from-to mx-2 text-primary"></span>
  50.                                 <time datetime="2017-06-22" class="js-search-data__departure">{{ elements_dateFormat(to, "date-day_date_long") }}</time>
  51.                             </div>
  52.                         </div>
  53.                     </div>
  54.                     {% if not document.property("demi_hideVacancySearch") %}
  55.                     <div class="col col-auto search-info-item js-overlay__toggle" data-target="#search-overlay">
  56.                         <div class="search-info-item__data">
  57.                             <span class="demi-icon demi-icon-nights mr-1 icon-in-text text-primary" title="{{ "demi.nights" | trans }}" aria-label="{{ "demi.nights" | trans }}"></span>
  58.                             <span class="js-search-data__nights">{{ units }}</span>
  59.                         </div>
  60.                     </div>
  61.                     <div class="col col-auto search-info-item js-overlay__toggle" data-target="#search-overlay">
  62.                         <div class="search-info-item__data">
  63.                             <span class="demi-icon demi-icon-bed mr-1 icon-in-text text-primary" title="{{ "demi.search.rooms" | trans }}" aria-label="{{ "demi.search.rooms" | trans }}"></span>
  64.                             <span class="js-search-data__rooms">{{ units }}</span>
  65.                         </div>
  66.                     </div>
  67.                     <div class="col col-auto search-info-item js-overlay__toggle" data-target="#search-overlay">
  68.                         <div class="search-info-item__data">
  69.                             <span class="demi-icon demi-icon-person mr-1 icon-in-text text-primary" title="{{ "demi.search.persons" | trans }}" aria-label="{{ "demi.search.persons" | trans }}"></span>
  70.                             <span class="js-search-data__persons">{{ guests }}</span>
  71.                         </div>
  72.                     </div>
  73.                     <div class="col col-auto">
  74.                         <button type="button" class="btn btn-{{ accommodation is defined ? 'default' : 'success' }} js-overlay__toggle search-info-search-button" data-target="#search-overlay">
  75.                             {{ "demi.search.change" | trans }}
  76.                         </button>
  77.                     </div>
  78.                     {% endif %}
  79.                 </div>
  80.                 <div class="js-search-data__hide-if-submitted row row--gutter-width-20 align-items-center" {{ availabilityIsChecked ? 'hidden' : '' }}>
  81.                     {% if isSearch and not hasPackageContainer and not isAffiliate %}
  82.                         <div class="col col-auto">
  83.                             <h1 class="m-0 h2">{{ not editmode ? pimcore_input('headline') : '' }}</h1>
  84.                         </div>
  85.                     {% endif %}
  86.                     {% if not document.property("demi_hideVacancySearch") %}
  87.                     <div class="col{{ isAffiliate ? ' text-center' : '' }}">
  88.                         <button type="button" class="btn btn-success js-overlay__toggle{{ isAffiliate ? ' btn-lg' : '' }}" data-target="#search-overlay">
  89.                             {{ "demi.list.search-vacancies-button" | trans }}
  90.                         </button>
  91.                     </div>
  92.                     {% endif %}
  93.                 </div>
  94.             </div>
  95.         </div>
  96.     {% if not isAffiliate %}
  97.         <div class="col col-auto search-info__hotline d-none d-lg-block">
  98.             {{ pimcore_inc(demi_core_configuration("getContactSnippet", []), {"headerVersion" : true}) }}
  99.         </div>
  100.     {% endif %}
  101.     </div>
  102. </section>
  103. {% set showMoreOptions = not pimcore_relation('filterSnippet').empty ? demi_showMoreFilterOptions(pimcore_relation('filterSnippet').getElement()) %}
  104. {% set showMoreOptions = accommodation is defined ? false : showMoreOptions %}
  105. {% if noSearchOverlay is not defined and not editmode %}
  106.     {{ include('@ElementsDemiFrontend/Includes/overlays/search.html.twig', {
  107.         'filterSnippet' : pimcore_relation('filterSnippet').getData(),
  108.         'searchParam' : searchParam,
  109.         'noDate' : noDate is defined ? noDate : searchParam.isNoDate(),
  110.         'isSearch' : true,
  111.         'modifierClass' : isAffiliate ? 'overlay--centered-top' : 'overlay--centered',
  112.         'showMoreOptions' : showMoreOptions
  113.     }) }}
  114. {% endif %}