{% if listing.slug %}
{% set LISTING_URL = path("listing_slug", {id: listing.id, slug: listing.slug, 'ref': ref is defined ? ref : null, 'source': source is defined ? source : null }) %}
{% else %}
{% set LISTING_URL = path('listing_view', {'id': listing.id, 'ref': ref is defined ? ref : null , 'source': source is defined ? source : null }) %}
{% endif %}
<div class="listing-card clearfix">
<a href="{{ LISTING_URL }}" target="_blank">
<div class="img-container">
{% if listing.mainPhoto %}
<img class="lazyload" src="/images/placeholder.svg" data-src="{{ custom_vich_uploader_asset(listing.mainPhoto.file, 'file') | thumbnail('search-thumb') }}" alt="{{ listing.title|excludeNumbers }}" width="368">
{% else %}
<img src="/images/placeholder.svg" data-src="{{ asset('https://placehold.it/368x250/FCFCFC/B6B6B6&text=No+Photo') }}" alt="{{ listing.title }}" width="368">
{% endif %}
{% if app.request.attributes.get("_route") != 'aqarmap_user_listings' %}
{% if listing.logo %}
<div class="listing-Logo">
<img class="lazyload" src="/images/placeholder.svg"
data-src="{{ custom_vich_uploader_asset(listing.logo.file, 'file') | thumbnail('logo') }}" alt="user-logo">
</div>
{% elseif listing.validUserLogo %}
<div class="listing-Logo">
<a href="{{ path('aqarmap_user_listings',{'id': listing.user.id}) }}" target="_blank">
<img class="lazyload" src="/images/placeholder.svg"
data-src="{{ custom_vich_uploader_asset(listing.validUserLogo, 'file') | thumbnail('logo') }}" alt="user-logo">
</a>
</div>
{% endif %}
{% endif %}
<div class="thumbnail-details">
<div class="photos-number top">
{{ listing.photos|length }}
<span class="fa fa-image"> </span>
</div>
</div>
</div>
</a>
<p class="card-title"><a href="{{ LISTING_URL }}" target="_blank">{{ listing.title|fixArabicNumbers|raw }}</a></p>
<p>
{{ listing.address }}
</p>
<div class="listing-footer">
{% if listing.price %}
<div class="price-container"><span class="integer">{{ listing.price|number_format }}</span> {{ get_setting('general', 'currency')|trans }}</div>
{% elseif listing.section.searchable %}
<h2>{{ 'listing.call_for_price'|trans }}</h2>
{% endif %}
<a href="{{ LISTING_URL }}" target="_blank" class="detailsButton">{{ 'layout.details_button'|trans }}</a>
</div>
</div><!-- end .listing.clearfix -->