templates/front/_common/_estate.html.twig line 1

Open in your IDE?
  1. {# {{ dump(estate) }}  #}
  2. {% if with_modal %}
  3.     {% set estate_url = path( 'show_agent_estate' , {slug:estate.agent.slug, refannonce:estate.refannonce}) %}
  4. {% else%}
  5.     {% set estate_url = path( 'acheter_estate' , {refannonce:estate.refannonce}) %}
  6. {% endif %}
  7. {% if favorite is defined and favorite %}
  8.     {% set icon_favorite = 'icon-heart' %}
  9. {% else%}
  10.     {% set icon_favorite = 'icon-heart-empty' %}
  11. {% endif %}
  12. {% if not_hover is not defined %}
  13.     {% set class_hover = 'hover' %}
  14. {% else%}
  15.     {% set class_hover = '' %}
  16. {% endif %}
  17. {% if is_mine is not defined  %}
  18.     {% set is_mine = false %}
  19. {% endif%}
  20. {% if with_stat is not defined  %}
  21.     {% set with_stat = false %}
  22. {% endif%}
  23. {% if with_share is not defined  %}
  24.     {% set with_share = true %}
  25. {% endif%}
  26. {% if with_title is not defined  %}
  27.     {% set with_title = true %}
  28. {% endif%}
  29. {% if with_icone is not defined  %}
  30.     {% set with_icone = true %}
  31. {% endif%}
  32. {% if with_carrousel is not defined  %}
  33.     {% set with_carrousel = true %}
  34. {% endif%}
  35. <div class="{{ col|default('col-xl-6')  }} tiny_ribbon listing_wrapper {{ class_hover }}" data-listid="{{ estate.id }}">
  36.     <div class="property_listing ">
  37.         {% if estate.siMandatexclusif %}
  38.             <div class="ribbon ribbon-top-left {% if estate.statut  in ['Sous offre', 'En vente', 'En estimation']  or is_mine %}pointer{% endif %}"><span>Exclusivité</span></div>
  39.         {% endif %}
  40.         {% if  estate.statut  in ['Sous offre', 'Sous compromis', 'Vendu'] %}
  41.             <div class="ribbon ribbon-top-right {% if estate.statut  in ['Sous offre', 'En vente', 'En estimation'] or is_mine %}pointer{% endif %}"><span>{{ estate.statut }}</span></div>
  42.         {% endif %}
  43.         <div class="listing-unit-img-wrapper">
  44.             <div class="prop_new_details">
  45.                 <div class="prop_new_details_back"> </div>
  46.                 {% if estate.statut in ['Sous offre', 'En vente'] %} 
  47.                     <a href="{{ path( 'toggle_favorite' , {refannonce:estate.refannonce}) }}" class="property_favorite" data-id="{{ estate.id }}"><i class="{{ icon_favorite }}"></i></a>
  48.                 {% endif %} 
  49.                 {# <div class="property_media"><i class="icon-camera"></i>{{ estate.countPhotos }}</div> #}
  50.                 {# <div class="property_location_image"><i class="icon-location"></i><a href="#/" rel="tag">{{ estate.features['localisation']['ville']|title }}</a></div> #}
  51.                 
  52.             </div>
  53.             {% if with_carrousel %}
  54.                 <div class="estate_carousel">
  55.                     {% for image in estate.photosCarousel %}
  56.                         <div>
  57.                             {% if estate.statut  in ['Sous offre', 'En vente', 'En estimation'] or is_mine %}      
  58.                                 <a  class="{% if with_modal %}open_modal{% endif %}" href="{{ estate_url }}" data-id="{{ estate.refannonce }}">
  59.                                     <div class="featured_gradient"></div>
  60.                                     <img class="img-fluid coverLazyThumb" src="{{ image.lazy }}" data-src="{{ image.thumb }}" style="width:100%; aspect-ratio: 736 / 460" loading="lazy"/>
  61.                                 </a>
  62.                             {% else %}
  63.                                 <div class="featured_gradient"></div>
  64.                                 <img class="img-fluid coverLazyThumb" src="{{ image.lazy }}" data-src="{{ image.thumb }}" style="width:100%; aspect-ratio: 736 / 460" loading="lazy"/>
  65.                             {% endif %}
  66.                         </div>
  67.                     {% endfor %}  
  68.                 </div>
  69.             {% else %}    
  70.                 {% if estate.statut  in ['Sous offre', 'En vente', 'En estimation'] or is_mine %}      
  71.                 <a  class="{% if with_modal %}open_modal{% endif %}" href="{{ estate_url }}" data-id="{{ estate.refannonce }}">
  72.                     <img class="img-fluid" src="{{ estate.cover|imagine_filter('stream_estate_thumb') }}" />
  73.                 </a>
  74.                 {% else %}
  75.                     <img class="img-fluid" src="{{ estate.cover|imagine_filter('stream_estate_thumb') }}" />
  76.                 {% endif %}
  77.             {% endif %} 
  78.         </div>
  79.         <div class="property_listing_bottom px-3 pt-2 pb-3">
  80.             <div class="property_location_image mb-2">
  81.                 <i class="icon-location"></i>{{ estate.features['localisation']['ville']|title }}
  82.             </div>
  83.             {% if with_title  %}    
  84.             <h4 class="mb-1">
  85.                 {% if estate.statut  in ['Sous offre', 'En vente', 'En estimation'] or is_mine %}     
  86.                     <a  class="{% if with_modal %}open_modal{% endif %}" href="{{ estate_url }}" data-id="{{ estate.refannonce }}">{{ estate.libelleCourt|raw }}</a>
  87.                 {% else %}
  88.                     {{ estate.libelleCourt|raw }}
  89.                 {% endif %}
  90.             </h4>
  91.             {% endif %}
  92.             <div class="estate_infos">
  93.                 <div class="listing_unit_price_wrapper mb-1">
  94.                     {% if estate.statut  in ['Sous offre', 'En vente', 'En estimation'] or is_mine %}    
  95.                         {# {{ estate.prix|format_currency('EUR', {fraction_digit: 0}) }} #}
  96.                         {{ estate.prix|number_format(0, ',', '.') }} €
  97.                     {% elseif with_title %}
  98.                         <a href="{{ path( 'show_agent' , {slug:estate.agent.slug}) }}">Nous consulter</a>
  99.                     {% endif %}
  100.                 </div>
  101.                 {% if without_text is not defined %}
  102.                 <div class="listing_details mb-2">
  103.                     {{ estate.descriptifCourt|raw }} 
  104.                 </div>
  105.                 {% endif %}
  106.                 {% if with_icone  %}
  107.                     <div class="icones mb-2 clearfix">
  108.                         <div class="float-left">
  109.                         {{ estate.surface|icone('surface')|raw }}
  110.                         {{ estate.nbchambres|icone('nbchambres')|raw }}
  111.                         {{ estate.icones['nbsdeau_sdb']|icone('nbsdeau')|raw }}
  112.                         </div>
  113.                         {% if estate.statut  in ['Sous offre', 'En vente', 'En estimation'] or is_mine %}    
  114.                                 <a class="float-right btn btn-primary btn-xs{% if with_modal %} open_modal{% endif %}" href="{{ estate_url }}" data-id="{{ estate.refannonce }}">détails</a>
  115.                             {% if with_stat and estate.numeromandat != 0 %}
  116.                                 <a class="float-right btn btn-secondary btn-xs open_stat mr-2" href='https://lookerstudio.google.com/reporting/98ede889-1db0-4d95-a416-0e5a7c645a49/page/lhaF?params=%7B"df659":"include%25EE%2580%25800%25EE%2580%2580IN%25EE%2580%2580Annonce%20{{estate.numeromandat}}"%7D' target="_blank" data-id="{{ estate.refannonce }}">stats</a>
  117.                             {% endif %}                    
  118.                         {% endif %}
  119.                     </div>
  120.                 {% endif %}
  121.                 {% if with_agent %}
  122.                     <div class="property_location mt-1 {% if with_title %}bordered pt-3{% endif %} px-0 clearfix">
  123.                         <div class="property_agent_wrapper float-left d-flex">
  124.                             <div>
  125.                             <a href="{{ path( 'show_agent' , {slug:estate.agent.slug}) }}"><img class="mr-3 rounded-circle border" width="50px" height="50px" src="{{ vich_uploader_asset(estate.agent, 'imageFile')|imagine_filter('agent_thumb_small') }}"></a>
  126.                             </div>
  127.                             <div>
  128.                                 <a href="{{ path( 'show_agent' , {slug:estate.agent.slug}) }}">{{ estate.agent }}</a>
  129.                                 {{ estate.agent.rating|stars('', estate.agent.countReviews) }}
  130.                             </div>
  131.                         </div>
  132.                         {% if with_share %}
  133.                         <div class="listing_actions float-right">
  134.                             {# Default dropup button #}
  135.                             <div class="desktop_share dropdown dropup d-none d-lg-block">
  136.                                 <button type="button" class="btn btn-icone dropdown-toggle" id="dropdownShare_{{ estate.refannonce }}" data-toggle="dropdown" aria-expanded="false" data-toggle-second="tooltip" data-placement="left" title="Partager"><i class="icon-share"></i></button>
  137.                                 <ul class="dropdown-menu"  aria-labelledby="dropdownShare_{{ estate.refannonce }}">
  138.                                     <li><a class="dropdown-item" href="http://www.facebook.com/sharer.php?u={{ absolute_url(estate_url) }}&t={{ estate.libelle|capitalize|url_encode }}" target="_blank"><i class="icon-facebook"></i></a></li>
  139.                                     {# <li><a class="dropdown-item" href="http://twitter.com/intent/tweet?text={{ estate.libelle|capitalize|url_encode }}+{{ absolute_url(estate_url) }}" class="social_tweet" target="_blank"><i class="icon-twitter"></i></a></li> #}
  140.                                     <li><a class="dropdown-item" href="https://www.linkedin.com/sharing/share-offsite/?url={{ absolute_url(estate_url)|url_encode }}" target="_blank" class="social_linkedin"><i class="icon-linkedin"></i></a></li>
  141.                                     {# <li><a class="dropdown-item" href="http://pinterest.com/pin/create/button/?url={{ absolute_url(estate_url)|url_encode }}&media={{ estate.cover|imagine_filter('stream_estate_thumb') }}&description={{ estate.libelle|capitalize|url_encode }}" target="_blank" class="social_pinterest"><i class="icon-pinterest"></i></a></li> #}
  142.                                     <li><a class="dropdown-item" href="http://api.whatsapp.com/send?text={{ estate.libelle|capitalize|url_encode }}+{{  absolute_url(estate_url) }}" class="social_whatsup" target="_blank"><i class="icon-whatsapp"></i></a></li> 
  143.                                     <li><a class="dropdown-item" href="mailto:email@email.com?subject={{ estate.libelle|capitalize|url_encode }}&body={{ absolute_url(estate_url) }}" data-action="share email" class="social_email"><i class="icon-mail"></i></a></li> 
  144.                                 </ul>
  145.                                 {#    
  146.                                 <button class="btn btn-icone"  data-toggle-second="tooltip" data-placement="top" title="Favoris"><i class="icon-heart-empty"></i></button>
  147.                                 <button class="btn btn-icone"  data-toggle-second="tooltip" data-placement="top" title="Comparer"><i class="icon-plus"></i></button>
  148.                                 #}              
  149.                             </div> 
  150.                             {# Pour mobile  seulement #}
  151.                             <button type="button" class="mobile_share btn btn-icone d-block d-lg-none" data-url="{{ absolute_url(estate_url) }}" data-name="{{ estate.libelle|capitalize }}" data-image="{{ estate.cover|imagine_filter('stream_estate_thumb') }}" title="Partager"><i class="icon-share"></i></button>
  152.                         </div>
  153.                         {% endif %}
  154.                     </div>
  155.                 {% endif %}
  156.             </div>
  157.         </div>
  158.     </div>
  159. </div>