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.                     <a href="{{ path('front_accommodation_single', {id: accommodation.id}) }}" 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.                     </a>
  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.                     <div class="d-flex justify-content-between">
  42.                         <div>
  43.                             <p class="notice-price">{{ 'label.priceFrom'|trans }}</p>
  44.                             <p class="price">{{ accommodation.lowestPrice|format_currency('EUR')|currency }} / {{ 'label.month'|trans }}</p>
  45.                         </div>
  46.                         {% if accommodation.eco %}
  47.                             <div class="citizens-eco" title="Petits prix">
  48.                                 <span>Citizens</span>
  49.                                 <strong>Eco</strong>
  50.                             </div>
  51.                         {% endif %}
  52.                     </div>
  53.                     {% if hideSlider is not defined %}
  54.                         <ul class="small-list">
  55.                             {% if accommodation.totalAvailableRooms > 0 %}
  56.                                 <li>
  57.                                     <img src="{{ asset('build/images/icons/smiley-wink.png') }}">
  58.                                     <span class="green">{{ 'total.rooms_available'|trans({count: accommodation.totalAvailableRooms})|raw }}</span>
  59.                                     {% if accommodation.rooms|length > 1 %}
  60.                                         &nbsp;/ {{ accommodation.rooms|length }}
  61.                                     {% endif %}
  62.                                 </li>
  63.                             {% endif %}
  64.                             <li><img src="{{ asset('build/images/icons/logement.png') }}"> Logement de {{ accommodation.surface }}m²</li>
  65.                             {% if accommodation.transports|length > 0 %}
  66.                                 <li>
  67.                                     <img src="{{ asset('build/images/icons/metro.png') }}">
  68.                                     {{ accommodation.transports|map(t => t.label)|join(' / ') }}
  69.                                 </li>
  70.                             {% endif %}
  71.                         </ul>
  72.                     {% endif %}
  73.                 {% else %}
  74.                     <div class="content-alt">
  75.                         <h3>{{ accommodation.name }}</h3>
  76.                         <div class="total-rooms"><span class="text-primary">{{ accommodation.rooms|length }}</span> ch</div>
  77.                     </div>
  78.                 {% endif %}
  79.             </a> <!-- content -->
  80.         </div> <!-- item-->
  81.         {% if hideSlider is not defined %}
  82.             {% if accommodation.totalAvailableRooms == 0 %}
  83.                 {% set firstRoomAvailability = accommodation.firstRoomAvailability %}
  84.                 {% if firstRoomAvailability is not null %}
  85.                     <div class="notice available">
  86.                         <div class="text-ctn">{{ 'label.available_from'|trans({date: firstRoomAvailability|format_datetime('short', 'none')})|raw }}</div>
  87.                         <img src="{{ asset('build/images/homes/triangle-green.png') }}">
  88.                     </div>
  89.                 {% else %}
  90.                     <div class="notice new">
  91.                         <div class="text-ctn">{{ 'label.not_available'|trans }}</div>
  92.                         <img src="{{ asset('build/images/homes/triangle-red.png') }}">
  93.                     </div>
  94.                 {% endif %}
  95.             {% elseif accommodation.totalAvailableRooms < accommodation.rooms|length %}
  96.                 <div class="notice available">
  97.                     <div class="text-ctn">{{ 'total.available_rooms_left'|trans({count: accommodation.totalAvailableRooms}) }}</div>
  98.                     <img src="{{ asset('build/images/homes/triangle-green.png') }}">
  99.                 </div>
  100.             {% endif %}
  101.         {% endif %}
  102.     </div> <!-- bg -->
  103. </div> <!-- card ctn-->