templates/properties/show.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %} Détail de la propriété : {{ property.title }} {% endblock %}
  3. {% block body %}
  4. <div class="text-right mr-5">
  5.     <h3 style="color:red;">Partager</h3>
  6.                         
  7.                         <div class="text-right" style="display:flex; flex-direction:row; margin-bottom:2em; justify-content: flex-end;">
  8.                             <button class="btn btn-light  mr-2 text-primary" style="width:2em; height:2em;display:flex;flex-direction: column; align-items: center;" aria-label="Partager sur Facebook" onclick="window.open('https://www.facebook.com/sharer/sharer.php?u=https://coupdcoeurimmo.fr/properties/{{ property.id }}', 'facebook-share-dialog', 'width=626,height=626'); return false;">
  9.                                 <i class="fab fa-facebook" style="font-size: 1.5em; color:#4267B2"></i>
  10.                             </button>
  11.                             <button class="btn btn-light mr-2 text-primary" style="width:2em; height:2em;display:flex;flex-direction: column; align-items: center; " aria-label="Partager sur Twitter" onclick="window.open('https://twitter.com/share?url=https://coupdcoeurimmo.fr/properties/{{ property.id }}', 'twitter-share-dialog', 'width=626,height=626'); return false;">
  12.                                 <i class="fab fa-twitter" style="font-size: 1.5em; color:#1DA1F2;"></i>
  13.                             </button>
  14.              </div>                 
  15.       
  16.                 <a href="{{ path('app_pdf_generate', {'id': property.id}) }}" target="_blank" class="btn btn-dark mr-2" style=";margin-left: 2rem">G&eacute;n&eacute;rer une fiche PDF</a>
  17.                 {% if property.category.name matches '/location/i' %}
  18.                     <a href="{{ path('app_rental_application_new', {'id': property.id}) }}" class="btn btn-dark" >Soumettre un dossier pour cette location</a>
  19.                 {% else %}
  20.                     <a href="{{ path('app_home_interest_new', {'id': property.id}) }}" class="btn btn-dark" >Remplir la fiche d'int&eacute;r&ecirc;t</a>
  21.                 {% endif %}
  22.            
  23.     </div>
  24.     
  25.     <div class="container">
  26.         <h1 class="text-center my-5">{{ property.title }}</h1>
  27.         <div class="row">
  28.             <div class="col-md-8">
  29.                 {# Image principale avec changement via JavaScript #}
  30.                 <div id="mainImageContainer" class="d-flex justify-content-center align-items-center" style="height: 500px; background-color: #ffffff;">
  31.             {% if property.images is not empty %}
  32.                     <img id="mainImage" src="{{ asset('images/properties/' ~ property.images[0].imagename) }}" class="img-fluid" alt="Image principale" style="height: -webkit-fill-available;" >
  33.             {% endif %}
  34.                 </div>
  35.                 </div>
  36.         
  37.             <div class="col-md-4">
  38.                 {# Galerie des miniatures d'images #}
  39.                 <div class="row mt-3" id="thumbnailGallery">
  40.                     {% for image in property.images %}
  41.                         <div class="col-4 mb-3">            
  42.                             <img src="{{ asset('images/properties/' ~ image.imagename) }}" alt="Image {{ loop.index }}" class="img-thumbnail smallImage" style="height: 70px;">
  43.                         </div>
  44.                     {% endfor %}
  45.                 </div>
  46.             </div>
  47.         
  48.         </div>
  49.     <hr class="text-danger bg-danger w-75 ">
  50.         <div class="row mt-5">
  51.                 <div class=" col d-flex flex-row">
  52.                                 <i class="fa-solid fa-user mr-2 mt-1 text-secondary "></i>  
  53.                 
  54.                                 <div class="">
  55.                 <h5 class="text-secondary" >Propriétaire  </h5>
  56.                 <h4 class="text-danger p-2 fs-3 text-white font-weight-bold"> {{ property.user.name }}</h4>
  57.                 </div>
  58.                             </div>
  59.                 
  60.                 <div class=" col d-flex flex-row">
  61.                                 <i class="fa-solid fa-bed-front mr-2 mt-1 text-secondary "></i>  
  62.                 
  63.                                 <div class="">
  64.                 <h5 class="text-secondary" ><i class="fa-solid fa-bed"></i> Nombre de pièces  </h5>
  65.                 <h4 class="text-danger p-2 fs-3 text-white font-weight-bold"> {{ property.roomNumber }}</h4>
  66.                 </div>
  67.                             </div>
  68.                 <div class=" col d-flex flex-row ">
  69.                                 <i class="fa-solid fa-euro-sign mr-2 mt-1 text-secondary"></i>  
  70.                 
  71.                                 <div class="">
  72.                 <h5 class="text-secondary" >Loyer </h5>
  73.                 <h4 class="text-danger p-2 fs-3 text-white font-weight-bold"> {{ property.rent|number_format }} &euro;</h4>
  74.                 </div>
  75.                             </div>
  76.         </div>
  77.         <div class="row mt-3">
  78.                 <div class=" col d-flex flex-row">
  79.                                 <i class="fa-solid fa-euro-sign mr-2 mt-1 text-secondary"></i>  
  80.                 
  81.                                 <div class="">
  82.                 <h5 class="text-secondary" >Prix </h5>
  83.                 <h4 class="text-danger p-2 fs-3 text-white font-weight-bold">{{ property.price|number_format }} &euro;</h4>
  84.                 </div>
  85.                             </div>
  86.                 
  87.                 <div class=" col d-flex flex-row">
  88.                                 <i class="fa-solid fa-tree mr-2 mt-1 text-secondary"></i>  
  89.                 
  90.                                 <div class="">
  91.                 <h5 class="text-secondary" >Ce bien dispose d'un jardin  </h5>
  92.                 <h4 class="text-danger p-2 fs-3 text-white font-weight-bold"> {{ property.garden ? 'Oui' : 'Non' }}</h4>
  93.                 </div>
  94.                             </div>
  95.                 <div class=" col d-flex flex-row">
  96.                                 <i class="fa-solid fa-building mr-2 mt-1 text-secondary "></i>  
  97.                 
  98.                                 <div class="">
  99.                 <h5 class="text-secondary" >Type du logement </h5>
  100.                 <h4 class="text-danger p-2 fs-3 text-white font-weight-bold"> {{ property.housingType == 'house' ? "Maison" : "Appartement" }}</h4>
  101.                 </div>
  102.                             </div>
  103.         </div>
  104.         <div class="row mt-3">
  105.                 <div class=" col d-flex flex-row">
  106.                                 <i class="fa-solid fa-money-bill-transfer mr-2 mt-1 text-secondary "></i>  
  107.                 
  108.                                 <div class="">
  109.                 <h5 class="text-secondary" >Type de transaction </h5>
  110.                 <h4 class="text-danger p-2 fs-3 text-white font-weight-bold"> {{ property.category.name }}</h4>
  111.                 </div>
  112.                             </div>
  113.                 
  114.                 <div class=" col d-flex flex-row">
  115.                                 <i class="fa-solid fa-calendar-days mr-2 mt-1 text-secondary"></i>  
  116.                 
  117.                                 <div class="">
  118.                 <h5 class="text-secondary" >Date de publication  </h5>
  119.                 <h4 class="text-danger p-2 fs-3 text-white font-weight-bold"> {{ property.createdAt|date('d/m/Y') }}</h4>
  120.                 </div>
  121.                             </div>
  122.                 <div class=" col d-flex flex-row">
  123.                                 <i class="fa-solid fa-location-dot mr-2 mt-1 text-secondary "></i>  
  124.                 
  125.                                 <div class="">
  126.                 <h5 class="text-secondary" >Ville </h5>
  127.                 <h4 class="text-danger p-2 fs-3 text-white font-weight-bold">{{ property.address.city }}</h4>
  128.                 </div>
  129.                             </div>
  130.         </div>
  131.         <div class="row mt-3">
  132.                 <div class=" col d-flex flex-row">
  133.                                 <i class="fa-solid fa-temperature-arrow-up mr-2 mt-1 text-secondary "></i>  
  134.                 
  135.                                 <div class="">
  136.                 <h5 class="text-secondary">Chauffage</h5>
  137.                 <h4 class="text-danger p-2 fs-3 text-white font-weight-bold">{{ property.heating }}</h4>
  138.                 </div>
  139.                             </div>
  140.                 
  141.                 <div class=" col d-flex flex-row">
  142.                                 <i class="fa-solid fa-calendar-days mr-2 mt-1 text-secondary "></i>  
  143.                 
  144.                                 <div class="">
  145.                 <h5 class="text-secondary"> Année de construction  </h5>
  146.                 <h4 class="text-danger p-2 fs-3 text-white font-weight-bold"> {{ property.yearBuilt|date('Y') }}</h4>
  147.                 </div>
  148.                             </div>
  149.                 <div class="col">
  150.                 </div>
  151.         </div>
  152.                             
  153.                             
  154.             
  155.                 <div class="card mt-4 mb-5">
  156.                     <div class="card-body mb-4">
  157.                         <h4 class="card-title mb-4">Description</h4>
  158.                         <p class="card-text fs-3">{{ property.content|raw }}</p>
  159.                     </div>
  160.                 </div>
  161.             </div>
  162.       
  163.     <!-- Scripts spécifiques à la page Property Show -->
  164.     <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  165.     <script>
  166.         var $jq = jQuery.noConflict();
  167.     </script>
  168.     <script>
  169.         $jq(document).ready(function() {
  170.             // Script pour changer l'image principale au clic sur une miniature
  171.             $jq('.smallImage').click(function() {
  172.                 var newSrc = $jq(this).attr('src');
  173.                 $jq('#mainImage').attr('src', newSrc);
  174.             });
  175.         });
  176.     </script>
  177. {% endblock %}