{# {{ dump(estate) }} #}
{% if with_modal %}
{% set estate_url = path( 'show_agent_estate' , {slug:estate.agent.slug, refannonce:estate.refannonce}) %}
{% else%}
{% set estate_url = path( 'acheter_estate' , {refannonce:estate.refannonce}) %}
{% endif %}
{% if favorite is defined and favorite %}
{% set icon_favorite = 'icon-heart' %}
{% else%}
{% set icon_favorite = 'icon-heart-empty' %}
{% endif %}
{% if not_hover is not defined %}
{% set class_hover = 'hover' %}
{% else%}
{% set class_hover = '' %}
{% endif %}
{% if is_mine is not defined %}
{% set is_mine = false %}
{% endif%}
{% if with_stat is not defined %}
{% set with_stat = false %}
{% endif%}
{% if with_share is not defined %}
{% set with_share = true %}
{% endif%}
{% if with_title is not defined %}
{% set with_title = true %}
{% endif%}
{% if with_icone is not defined %}
{% set with_icone = true %}
{% endif%}
{% if with_carrousel is not defined %}
{% set with_carrousel = true %}
{% endif%}
<div class="{{ col|default('col-xl-6') }} tiny_ribbon listing_wrapper {{ class_hover }}" data-listid="{{ estate.id }}">
<div class="property_listing ">
{% if estate.siMandatexclusif %}
<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>
{% endif %}
{% if estate.statut in ['Sous offre', 'Sous compromis', 'Vendu'] %}
<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>
{% endif %}
<div class="listing-unit-img-wrapper">
<div class="prop_new_details">
<div class="prop_new_details_back"> </div>
{% if estate.statut in ['Sous offre', 'En vente'] %}
<a href="{{ path( 'toggle_favorite' , {refannonce:estate.refannonce}) }}" class="property_favorite" data-id="{{ estate.id }}"><i class="{{ icon_favorite }}"></i></a>
{% endif %}
{# <div class="property_media"><i class="icon-camera"></i>{{ estate.countPhotos }}</div> #}
{# <div class="property_location_image"><i class="icon-location"></i><a href="#/" rel="tag">{{ estate.features['localisation']['ville']|title }}</a></div> #}
</div>
{% if with_carrousel %}
<div class="estate_carousel">
{% for image in estate.photosCarousel %}
<div>
{% if estate.statut in ['Sous offre', 'En vente', 'En estimation'] or is_mine %}
<a class="{% if with_modal %}open_modal{% endif %}" href="{{ estate_url }}" data-id="{{ estate.refannonce }}">
<div class="featured_gradient"></div>
<img class="img-fluid coverLazyThumb" src="{{ image.lazy }}" data-src="{{ image.thumb }}" style="width:100%; aspect-ratio: 736 / 460" loading="lazy"/>
</a>
{% else %}
<div class="featured_gradient"></div>
<img class="img-fluid coverLazyThumb" src="{{ image.lazy }}" data-src="{{ image.thumb }}" style="width:100%; aspect-ratio: 736 / 460" loading="lazy"/>
{% endif %}
</div>
{% endfor %}
</div>
{% else %}
{% if estate.statut in ['Sous offre', 'En vente', 'En estimation'] or is_mine %}
<a class="{% if with_modal %}open_modal{% endif %}" href="{{ estate_url }}" data-id="{{ estate.refannonce }}">
<img class="img-fluid" src="{{ estate.cover|imagine_filter('stream_estate_thumb') }}" />
</a>
{% else %}
<img class="img-fluid" src="{{ estate.cover|imagine_filter('stream_estate_thumb') }}" />
{% endif %}
{% endif %}
</div>
<div class="property_listing_bottom px-3 pt-2 pb-3">
<div class="property_location_image mb-2">
<i class="icon-location"></i>{{ estate.features['localisation']['ville']|title }}
</div>
{% if with_title %}
<h4 class="mb-1">
{% if estate.statut in ['Sous offre', 'En vente', 'En estimation'] or is_mine %}
<a class="{% if with_modal %}open_modal{% endif %}" href="{{ estate_url }}" data-id="{{ estate.refannonce }}">{{ estate.libelleCourt|raw }}</a>
{% else %}
{{ estate.libelleCourt|raw }}
{% endif %}
</h4>
{% endif %}
<div class="estate_infos">
<div class="listing_unit_price_wrapper mb-1">
{% if estate.statut in ['Sous offre', 'En vente', 'En estimation'] or is_mine %}
{# {{ estate.prix|format_currency('EUR', {fraction_digit: 0}) }} #}
{{ estate.prix|number_format(0, ',', '.') }} €
{% elseif with_title %}
<a href="{{ path( 'show_agent' , {slug:estate.agent.slug}) }}">Nous consulter</a>
{% endif %}
</div>
{% if without_text is not defined %}
<div class="listing_details mb-2">
{{ estate.descriptifCourt|raw }}
</div>
{% endif %}
{% if with_icone %}
<div class="icones mb-2 clearfix">
<div class="float-left">
{{ estate.surface|icone('surface')|raw }}
{{ estate.nbchambres|icone('nbchambres')|raw }}
{{ estate.icones['nbsdeau_sdb']|icone('nbsdeau')|raw }}
</div>
{% if estate.statut in ['Sous offre', 'En vente', 'En estimation'] or is_mine %}
<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>
{% if with_stat and estate.numeromandat != 0 %}
<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>
{% endif %}
{% endif %}
</div>
{% endif %}
{% if with_agent %}
<div class="property_location mt-1 {% if with_title %}bordered pt-3{% endif %} px-0 clearfix">
<div class="property_agent_wrapper float-left d-flex">
<div>
<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>
</div>
<div>
<a href="{{ path( 'show_agent' , {slug:estate.agent.slug}) }}">{{ estate.agent }}</a>
{{ estate.agent.rating|stars('', estate.agent.countReviews) }}
</div>
</div>
{% if with_share %}
<div class="listing_actions float-right">
{# Default dropup button #}
<div class="desktop_share dropdown dropup d-none d-lg-block">
<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>
<ul class="dropdown-menu" aria-labelledby="dropdownShare_{{ estate.refannonce }}">
<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>
{# <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> #}
<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>
{# <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> #}
<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>
<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>
</ul>
{#
<button class="btn btn-icone" data-toggle-second="tooltip" data-placement="top" title="Favoris"><i class="icon-heart-empty"></i></button>
<button class="btn btn-icone" data-toggle-second="tooltip" data-placement="top" title="Comparer"><i class="icon-plus"></i></button>
#}
</div>
{# Pour mobile seulement #}
<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>
</div>
{% endif %}
</div>
{% endif %}
</div>
</div>
</div>
</div>