src/Aqarmap/Bundle/ListingBundle/Resources/views/Listing/card.html.twig line 1

  1. {% if listing.slug %}
  2. {% set LISTING_URL = path("listing_slug", {id: listing.id, slug: listing.slug, 'ref': ref is defined ? ref : null, 'source': source is defined ? source : null }) %}
  3. {% else %}
  4. {% set LISTING_URL = path('listing_view', {'id': listing.id, 'ref': ref is defined ? ref : null , 'source': source is defined ? source : null }) %}
  5. {% endif %}
  6. <div class="listing-card clearfix">
  7. <a href="{{ LISTING_URL }}" target="_blank">
  8. <div class="img-container">
  9. {% if listing.mainPhoto %}
  10. <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">
  11. {% else %}
  12. <img src="/images/placeholder.svg" data-src="{{ asset('https://placehold.it/368x250/FCFCFC/B6B6B6&text=No+Photo') }}" alt="{{ listing.title }}" width="368">
  13. {% endif %}
  14. {% if app.request.attributes.get("_route") != 'aqarmap_user_listings' %}
  15. {% if listing.logo %}
  16. <div class="listing-Logo">
  17. <img class="lazyload" src="/images/placeholder.svg"
  18. data-src="{{ custom_vich_uploader_asset(listing.logo.file, 'file') | thumbnail('logo') }}" alt="user-logo">
  19. </div>
  20. {% elseif listing.validUserLogo %}
  21. <div class="listing-Logo">
  22. <a href="{{ path('aqarmap_user_listings',{'id': listing.user.id}) }}" target="_blank">
  23. <img class="lazyload" src="/images/placeholder.svg"
  24. data-src="{{ custom_vich_uploader_asset(listing.validUserLogo, 'file') | thumbnail('logo') }}" alt="user-logo">
  25. </a>
  26. </div>
  27. {% endif %}
  28. {% endif %}
  29. <div class="thumbnail-details">
  30. <div class="photos-number top">
  31. {{ listing.photos|length }}
  32. <span class="fa fa-image"> </span>
  33. </div>
  34. </div>
  35. </div>
  36. </a>
  37. <p class="card-title"><a href="{{ LISTING_URL }}" target="_blank">{{ listing.title|fixArabicNumbers|raw }}</a></p>
  38. <p>
  39. {{ listing.address }}
  40. </p>
  41. <div class="listing-footer">
  42. {% if listing.price %}
  43. <div class="price-container"><span class="integer">{{ listing.price|number_format }}</span> {{ get_setting('general', 'currency')|trans }}</div>
  44. {% elseif listing.section.searchable %}
  45. <h2>{{ 'listing.call_for_price'|trans }}</h2>
  46. {% endif %}
  47. <a href="{{ LISTING_URL }}" target="_blank" class="detailsButton">{{ 'layout.details_button'|trans }}</a>
  48. </div>
  49. </div><!-- end .listing.clearfix -->