templates/components/sectionAccommodationCountry.html.twig line 1
<div class="relative overflow-hidden" id="recent-carousel"><div class="grid grid-cols-1 md:grid-cols-4 gap-4">{% for building in recentBuildings %}{% set filteredFiles2 = building.buildingDocuments|filter(item => item.name starts with 'file' or item.name starts with 'base' or item.name starts with 'cover' or item.name starts with 'imageComplexe') %}<div class="flex-shrink-0 w-full bg-white shadow-md rounded-lg overflow-hidden z-10"><div class="relative w-full h-56 overflow-hidden max-lg:h-48">{% if filteredFiles2 is not empty %}<div class="absolute inset-0 flex transition-transform duration-500 ease-in-out" id="carousel-{{ building.id }}">{% for bd in filteredFiles2 %}<a href="{{ path('detail_building', {id: building.id}) }}" class="w-full flex-shrink-0 bg-cover bg-no-repeat bg-center"style="background-image: url('{{ asset('images/files/' ~ bd.imageFile) }}'); height: 14rem;"></a>{% if building.propertyManager.lessorType and building.propertyManager.lessorType == "Gestionnaire" %}<img src="{{ asset('/images/site/bandeau-pro.png') }}" alt="Bandeau pro" class="absolute bottom-2 right-2 h-6 opacity-90">{% endif %}{% endfor %}</div><div class="flex absolute bottom-2 left-1/2 z-30 space-x-2 -translate-x-1/2" id="carousel-indicators-{{ building.id }}">{% for document in filteredFiles2 %}<button type="button" class="w-3 h-3 rounded-full border border-gray-400 bg-gray-300 opacity-50" aria-label="Slide {{ loop.index0 }}" data-carousel-slide-to="{{ loop.index0 }}"></button>{% endfor %}</div>{% if filteredFiles2|length > 1 %}<button type="button" class="absolute top-1/2 left-2 z-40 transform -translate-y-1/2 bg-gray-300 p-2 rounded-full shadow-md" data-carousel-prev="{{ building.id }}"><svg class="w-5 h-5 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path></svg></button><button type="button" class="absolute top-1/2 right-2 z-40 transform -translate-y-1/2 bg-gray-300 p-2 rounded-full shadow-md" data-carousel-next="{{ building.id }}"><svg class="w-5 h-5 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path></svg></button>{% endif %}{% endif %}</div><div class="p-4 flex justify-between items-start max-lg:p-2"><div>{% if building.cityEntity is not null %}<a href="{{ path('detail_building', {id: building.id}) }}" class="block text-sm font-bold">{{ building.cityEntity.city }}, {{ building.cityEntity.country }}</a>{% else %}<span class="block text-sm font-bold text-red-500">{{ 'City information not available'|trans }}</span>{% endif %}<a href="{{ path('detail_building', {id: building.id}) }}" class="block text-sm font-bold">{{ building.rent / 100 }} € {{ 'accueil.parmois'|trans }}</a>{# <a href="{{ path('detail_building', {id: building.id}) }}" class="block text-gray-500 text-sm">{{ 'accueil.add'|trans }}{{ building.createdAt|date('d/m/y') }}</a> #}{% if building.status == 'Disponible' %}{% if building.dateStartAt %}<p class="text-gray-500 text-sm">{{ 'accueil.availableDate'|trans }} {{ building.dateStartAt|date('d/m/y') }}</p>{% else %}<p class="text-gray-500 text-sm">{{ 'accueil.availableDateNow'|trans }}</p>{% endif %}{% elseif building.dateStartAt %}<p class="text-gray-500 text-sm">{{ 'accueil.dateStartAt'|trans }} {{ building.dateStartAt|date('d/m/y') }}</p>{% endif %}</div><a class="flex items-center justify-center p-3 cursor-pointer rounded-lg mt-2" id="like-button-{{ building.id }}">{% if likedBuildings[building.id] is defined and likedBuildings[building.id] %}<i style="color: #ffcc00" class="fa-solid fa-heart pl-3 fa-2x like-button" data-image-id="{{ building.id }}"></i>{% else %}<i style="color: #ffcc00" class="fa-regular fa-heart pl-3 fa-2x like-button" data-image-id="{{ building.id }}"></i>{% endif %}</a></div></div>{% endfor %}</div>{% if recentBuildings is empty %}<p class="text-gray-500 text-center">{{ 'accueil.noAccommodationAvailable'|trans }}</p>{% endif %}</div>