templates/front/accommodation/blocks/description-1.html.twig line 1

Open in your IDE?
  1. {% trans_default_domain 'front' %}
  2. {% import "front/_shared/macros.html.twig" as macro %}
  3. {% set isMobile = isMobile() %}
  4. {% set account = account is defined %}
  5. {% if not isMobile %}
  6.     <h1><span>{{ accommodation.name }}</span></h1>
  7.     <h2 class="subtitle">{{ accommodation.address }}</h2>
  8. {% else %}
  9.     <h2 class="detail-title">
  10.         Description <span>du logement</span>
  11.     </h2>
  12. {% endif %}
  13. <div class="icon-list">
  14.     <ul>
  15.         {% if not account %}
  16.             <li>
  17.                 <img src="{{ asset('build/images/icons/smiley-wink.png') }}" alt="chambres">
  18.                 {% if accommodation.totalAvailableRooms > 0 %}
  19.                     <span class="green-txt">{{ 'total.rooms_available'|trans({count: accommodation.totalAvailableRooms})|raw }}</span>
  20.                     {% if accommodation.rooms|length > 1 %}
  21.                         &nbsp;/ {{ accommodation.rooms|length }}
  22.                     {% endif %}
  23.                 {% else %}
  24.                     <span class="text-primary">{{ 'label.room_not_available'|trans }}</span>
  25.                 {% endif %}
  26.             </li>
  27.         {% endif %}
  28.         <li><img src="{{ asset('build/images/icons/logement.png') }}" alt="logement"> {{ 'label.accommodation_surface'|trans({value: accommodation.surface}) }}</li>
  29.         {% if accommodation.transports|length > 0 %}
  30.             <li>
  31.                 <img src="{{ asset('build/images/icons/metro.png') }}">
  32.                 {{ accommodation.transports|map(t => t.label)|join(' / ') }}
  33.             </li>
  34.         {% endif %}
  35.     </ul>
  36. </div>
  37. {% if account %}
  38.     <div class="card mb-4 p-3">
  39.         {% if accommodation.info.netflix %}
  40.             <div class="d-flex flex-row align-items-center">
  41.                 <img src="{{ asset('build/images/detail/netflix.svg') }}" width="20" alt="" class="mr-2">
  42.                 <div>
  43.                     <strong>Netflix :</strong>
  44.                     {{ accommodation.info.netflix }}
  45.                 </div>
  46.             </div>
  47.         {% endif %}
  48.     </div>
  49. {% endif %}
  50. <p>{{ accommodation.description|nl2br|raw }}</p>
  51. {% if accommodation.equipments|length > 0 %}
  52.     {% if not isMobile %}
  53.         <h3>{{ 'title.accommodation_equipments'|trans|raw }}</h3>
  54.     {% else %}
  55.         <h2 class="detail-title">
  56.             {{ 'title.accommodation_equipments'|trans|raw }}
  57.         </h2>
  58.     {% endif %}
  59.     <div class="equipment-list equip-list" data-controller="equipment-list">
  60.         {% set totalEquipment = 0 %}
  61.         <ul>
  62.             {% if accommodation.girlsOnly %}
  63.                 {% set totalEquipment = totalEquipment+1 %}
  64.                 <li><img src="{{ asset('build/images/icons/girls.svg') }}" alt=""> {{ 'label.girlsOnly'|trans }}</li>
  65.             {% endif %}
  66.             {% if accommodation.garden %}
  67.                 {% set totalEquipment = totalEquipment+1 %}
  68.                 <li><img src="{{ asset('build/images/icons/garden.svg') }}" alt=""> {{ 'label.garden'|trans }}</li>
  69.             {% endif %}
  70.             {% if accommodation.petFriendly %}
  71.                 {% set totalEquipment = totalEquipment+1 %}
  72.                 <li><img src="{{ asset('build/images/icons/petfriendly.svg') }}" alt=""> {{ 'label.petFriendly'|trans }}</li>
  73.             {% endif %}
  74.             {% set totalEquipment = totalEquipment + accommodation.equipments|length %}
  75.             {% for equipment in accommodation.equipments %}
  76.                 <li>
  77.                     {% if equipment.image %}
  78.                         <img src="{{ equipment.image.getUrl() }}" alt="{{ equipment.label }}">
  79.                     {% else %}
  80.                         <img src="{{ asset('build/images/icons/icon-layers.png') }}" alt="{{ equipment.label }}">
  81.                     {% endif %}
  82.                     {{ equipment.label }}
  83.                 </li>
  84.             {% endfor %}
  85.         </ul>
  86.         {% if totalEquipment > 9 %}
  87.             <a href="" class="seemore open-list" data-action="equipment-list#more">Voir tous les équipements</a>
  88.             <a href="" class="seemore close-list" data-action="equipment-list#less">Réduire les équipements</a>
  89.         {% endif %}
  90.     </div>
  91. {% endif %}
  92. {% if accommodation.services|length > 0 %}
  93.     <div id="services" class="services">
  94.         {% if not isMobile %}
  95.             <h3>{{ 'title.accommodation_services'|trans|raw }}</h3>
  96.         {% else %}
  97.             <h2 class="detail-title">
  98.                 {{ 'title.accommodation_services'|trans|raw }}
  99.             </h2>
  100.         {% endif %}
  101.         <div class="accordion accordion-service" id="accordionRoom">
  102.             {% for service in accommodation.services %}
  103.                 <div class="card">
  104.                     <div class="card-header">
  105.                         <h2 class="mb-0">
  106.                             <button class="btn btn-link btn-block text-left collapsed" type="button" data-toggle="collapse" data-target="#collapseService-{{ service.id }}">
  107.                                 <span class="w-icon">
  108.                                     {% if service.image %}
  109.                                         <img src="{{ service.image.getUrl() }}" alt="{{ service.label }}">
  110.                                     {% endif %}
  111.                                     {{ service.label }}
  112.                                 </span>
  113.                                 <span class="chevron"><img src="{{ asset('build/images/icons/chevron-down-dark.svg') }}"></span>
  114.                             </button>
  115.                         </h2>
  116.                     </div>
  117.                     <div id="collapseService-{{ service.id }}" class="collapse" data-parent="#accordionRoom">
  118.                         <div class="card-body">
  119.                             {{ service.description }}
  120.                         </div>
  121.                     </div>
  122.                 </div>
  123.             {% endfor %}
  124.         </div> <!-- accordion -->
  125.     </div> <!-- services -->
  126. {% endif %}
  127. {% if accommodation.universities|length > 0 %}
  128.     {% if not isMobile %}
  129.         <h3>{{ 'title.accommodation_universities'|trans|raw }}</h3>
  130.     {% else %}
  131.         <h2 class="detail-title">
  132.             {{ 'title.accommodation_universities'|trans|raw }}
  133.         </h2>
  134.     {% endif %}
  135.     <div class="mb-4">
  136.         <ul>
  137.             {% for university in accommodation.universities %}
  138.                 <li>
  139.                     {{ university.label }}
  140.                 </li>
  141.             {% endfor %}
  142.         </ul>
  143.     </div>
  144. {% endif %}
  145. {% if accommodation.getTotalAvailableRooms < accommodation.rooms|length %}
  146.     {% if not isMobile %}
  147.         <h3 id="colocataires">{{ 'title.accommodation_roommates'|trans|raw }}</h3>
  148.     {% else %}
  149.         <h2 class="detail-title">
  150.             {{ 'title.accommodation_roommates'|trans|raw }}
  151.         </h2>
  152.     {% endif %}
  153.     <div class="owl-carousel residents" data-controller="carousel" data-type="roommates">
  154.         {% for room in accommodation.rooms %}
  155.             {% if not room.available and room.occupancy is not null %}
  156.                 {% set occupant = room.occupancy.user %}
  157.                 <div class="resident">
  158.                     <h4>{{ room.name }}</h4>
  159.                     {{ macro.avatar(occupant) }}
  160.                     <h5>{{ occupant.firstname }}</h5>
  161.                     {% if occupant.birthday %}
  162.                         <p class="age">
  163.                             {{ 'label.user_age'|trans({value: date('now').diff(occupant.birthday).format('%y')}) }}
  164.                         </p>
  165.                     {% endif %}
  166.                     {% if occupant.job %}
  167.                         <p class="status">{{ occupant.job }}</p>
  168.                     {% endif %}
  169.                 </div> <!-- résident -->
  170.             {% endif %}
  171.         {% endfor %}
  172.     </div> <!-- residents -->
  173. {% endif %}
  174. {% if not isMobile %}
  175.     {% include 'front/accommodation/blocks/geolocation.html.twig' %}
  176. {% endif %}