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

Open in your IDE?
  1. {% set  from = elements_customDateFormat(app.request.get('from')) %}
  2. {% set to = elements_customDateFormat(app.request.get('to')) %}
  3. {% set units = 0 %}
  4. {% set guests = 0 %}
  5. {% set roomrows = searchParam.getRoomrows() %}
  6. {% if roomrows is iterable %}
  7.     {% for roomrow in roomrows %}
  8.         {% set units = units + roomrow.getUnits() %}
  9.         {% set guests = guests + roomrow.getAdults() %}
  10.         {% if roomrow.getChildAges() is not empty %}
  11.             {% set guests = guests + roomrow.getChildAges()|length %}
  12.         {% elseif roomrow.getChildBirthdays() is not empty %}
  13.             {% set guests = guests + roomrow.getChildBirthdays()|length %}
  14.         {% endif %}
  15.     {% endfor %}
  16. {% endif %}
  17. {% set nights = app.request.get('nights') %}
  18. {% if nights is null and to is not empty and from is not empty %}
  19.     {% set nights = searchParam.getPeriod() %}
  20. {% endif %}
  21. <section class="card box-shadow">
  22.     <div class="card-body">
  23.         <script data-cookieconsent="ignore">
  24.             _config.search = true;
  25.         </script>
  26.         <div>
  27.             <time datetime="" class="js-search-data__arrival">{{ elements_dateFormat(from, 'date-long') }}</time>
  28.             -
  29.             <time datetime="" class="js-search-data__departure">{{ elements_dateFormat(to, 'date-long') }}</time>
  30.             (<span class="js-search-data__nights">{{ nights }}</span>)
  31.         </div>
  32.         <div class="js-search-data__occupancy"></div>
  33.         <div class="mt-2">
  34.             <button type="button" class="text-primary js-overlay__toggle btn-no-styling increased-click-area js-tracking--click-piwik"
  35.                     data-target="#search-overlay"
  36.                     data-tracking-category="Product list"
  37.                     data-tracking-action="change search"
  38.             >
  39.                 <span class="demi-icon demi-icon-edit icon-in-text"></span>
  40.                 <span class="text-underline">{{ 'demi.search.change'|trans }}</span>
  41.             </button>
  42.         </div>
  43.     </div>
  44. </section>