templates/front/search/accommodation-card.html.twig line 1

Open in your IDE?
  1. {% trans_default_domain 'front' %}
  2. {% set thumbFilter = (thumbFilterName is defined) ? thumbFilterName : ((hideSlider is not defined) ? 'accommodation_thumb' : 'accommodation_square_thumb') %}
  3. <div class="{{ (class is defined) ? class : ''}} card-ctn"
  4.      data-id="{{ accommodation.id }}"
  5.      data-lat="{{ accommodation.address.latitude }}"
  6.      data-lng="{{ accommodation.address.longitude }}"
  7. >
  8.     <div class="bg">
  9.         <div class="item">
  10.             {% if hideSlider is not defined %}
  11.                 <div class="owl-carousel carousel-homes" data-controller="carousel" data-type="homes">
  12.                     <div class="illu">
  13.                         {% if not accommodation.cover %}
  14.                             <img src="{{ asset('build/images/image_placeholder.jpg') }}" loading="lazy">
  15.                         {% else %}
  16.                             <img src="{{ accommodation.cover | imagine_filter(thumbFilter) }}" alt="" loading="lazy">
  17.                         {% endif %}
  18.                     </div>
  19.                     {% for image in accommodation.images %}
  20.                         <div class="illu">
  21.                             <img src="{{ image | imagine_filter(thumbFilter) }}" alt="" loading="lazy">
  22.                         </div>
  23.                     {% endfor %}
  24.                 </div> <!-- carousel -->
  25.             {% else %}
  26.                 <a href="{{ path('front_accommodation_single', {id: accommodation.id}) }}" class="illu">
  27.                     {% if not accommodation.cover %}
  28.                         <img src="{{ asset('build/images/image_placeholder.jpg') }}" loading="lazy">
  29.                     {% else %}
  30.                         <img src="{{ accommodation.cover | imagine_filter(thumbFilter) }}" alt="" loading="lazy">
  31.                     {% endif %}
  32.                 </a>
  33.             {% endif %}
  34.             <a class="content" href="{{ path('front_accommodation_single', {id: accommodation.id}) }}">
  35.                 {% if altText is not defined %}
  36.                     <h3>{{ accommodation.name }}</h3>
  37.                     <h4>
  38.                         {{ accommodation.address.address }}
  39.                         <br>{{ accommodation.address.zipcode ~ ' ' ~ accommodation.address.city }}
  40.                     </h4>
  41.                     <p class="notice-price">{{ 'label.priceFrom'|trans }}</p>
  42.                     <p class="price">{{ accommodation.lowestPrice|format_currency('EUR')|currency }} / {{ 'label.month'|trans }}</p>
  43.                     {% if hideSlider is not defined %}
  44.                         <ul class="small-list">
  45.                             {% if accommodation.totalAvailableRooms > 0 %}
  46.                                 <li>
  47.                                     <img src="{{ asset('build/images/icons/smiley-wink.png') }}">
  48.                                     <span class="green">{{ 'total.rooms_available'|trans({count: accommodation.totalAvailableRooms})|raw }}</span>
  49.                                     {% if accommodation.rooms|length > 1 %}
  50.                                         &nbsp;/ {{ accommodation.rooms|length }}
  51.                                     {% endif %}
  52.                                 </li>
  53.                             {% endif %}
  54.                             <li><img src="{{ asset('build/images/icons/logement.png') }}"> Logement de {{ accommodation.surface }}m²</li>
  55.                             {% if accommodation.transports|length > 0 %}
  56.                                 <li>
  57.                                     <img src="{{ asset('build/images/icons/metro.png') }}">
  58.                                     {{ accommodation.transports|map(t => t.label)|join(' / ') }}
  59.                                 </li>
  60.                             {% endif %}
  61.                         </ul>
  62.                     {% endif %}
  63.                 {% else %}
  64.                     <div class="content-alt">
  65.                         <h3>{{ accommodation.name }}</h3>
  66.                         <div class="total-rooms"><span class="text-primary">{{ accommodation.rooms|length }}</span> ch</div>
  67.                     </div>
  68.                 {% endif %}
  69.             </a> <!-- content -->
  70.         </div> <!-- item-->
  71.         {% if hideSlider is not defined %}
  72.             {% if accommodation.totalAvailableRooms == 0 %}
  73.                 {% set firstRoomAvailability = accommodation.firstRoomAvailability %}
  74.                 <div class="notice new">
  75.                     {% if firstRoomAvailability is not null %}
  76.                         <div class="text-ctn">{{ 'label.available_from'|trans({date: firstRoomAvailability|format_datetime('short', 'none')})|raw }}</div>
  77.                     {% else %}
  78.                         <div class="text-ctn">{{ 'label.not_available'|trans }}</div>
  79.                     {% endif %}
  80.                     <img src="{{ asset('build/images/homes/triangle-red.png') }}">
  81.                 </div>
  82.             {% elseif accommodation.totalAvailableRooms < accommodation.rooms|length %}
  83.                 <div class="notice available">
  84.                     <div class="text-ctn">{{ 'total.available_rooms_left'|trans({count: accommodation.totalAvailableRooms}) }}</div>
  85.                     <img src="{{ asset('build/images/homes/triangle-green.png') }}">
  86.                 </div>
  87.             {% endif %}
  88.         {% endif %}
  89.     </div> <!-- bg -->
  90. </div> <!-- card ctn-->