src/Aqarmap/Bundle/ListingBundle/Resources/views/ListingSearch/listingCardVertical.html.twig line 1

Open in your IDE?
  1. {# Constants #}
  2. {% set FIRST_LISTING_FOR_FREE_LISTING_CATEGORY = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingCategories::FIRST_LISTING_FOR_FREE') %}
  3. {% set EBAWAB_LISTING_CATEGORY = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingCategories::EBAWAB') %}
  4. {% set UNLIMITED_LISTING_CATEGORY = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingCategories::UNLIMITED') %}
  5. {% set PAID_LISTING_CATEGORY = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingCategories::PAID') %}
  6. {% set PROJECT_LISTING_CATEGORY = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingCategories::PROJECTS') %}
  7. {% set SCRAPPED_LISTING_CATEGORY = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingCategories::SCRAPPED') %}
  8. {% set SPONSORED_TYPE = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingFeaturedTypes::SPONSORED') %}
  9. {% set FEATURE_TYPE = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingFeaturedTypes::FEATURED') %}
  10. {% set PREMIUM_CONSTANT = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingFeaturedTypes::PREMIUM') %}
  11. {% set SPOTLIGHT_CONSTANT = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingFeaturedTypes::SPOTLIGHT') %}
  12. {% set SOLD_BY_OWNER_TYPE = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingFeaturedTypes::SOLD_BY_OWNER') %}
  13. {% set SOLD_BY_OWNER_SPONSORED_TYPE = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingFeaturedTypes::SOLD_BY_OWNER_SPONSORED') %}
  14. {% set SCRAPPED_LISTING_CATEGORY = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingCategories::SCRAPPED') %}
  15. {% set SHOW_PHONE_CONSTANT = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\LeadTypes::SHOW_PHONE') %}
  16. {% set SEND_WHATSAPP_CONSTANT = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\LeadTypes::WHATSAPP') %}
  17. {% set CALL_REQUEST_CONSTANT = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\LeadTypes::CALL_REQUEST') %}
  18. {% set TOP_VIEWED_CONST = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingLabel::TOP_VIEWED') %}
  19. {% set TOP_FAVOURITAED_CONST = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingLabel::TOP_FAVORITE')  %}
  20. {% set VALID_PRICE_CONST = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingLabel::VALID_PRICE')  %}
  21. {# Toggles #}
  22. {% set isEnabledSearchResultsActivity = (isEnabledFeature('web.activity.app') and isEnabledFeature('web.search.results.activities')) %}
  23. {% set isTopCustomerListingsPage = app.request.attributes.get('_route') == 'aqarmap_user_listings' %}
  24. {% set hideCtaButtons = hideCta is defined and hideCta %}
  25. {% set isCtaButtonsEnabled = isEnabledFeature('listing_card.lead.button') and not hideCtaButtons %}
  26. {% set showCtaButtons = isCtaButtonsEnabled %}
  27. {% set isEnabledElasticScoringDebug = elasticScoringDebug is defined and elasticScoringDebug and app.request.get('esdebug') %}
  28. {# inFeed #}
  29. {% set inFeedAdAppearance = 6 %}
  30. {% set isInFeedAdAappeared = false %}
  31. {% set scrappedUserName =  "Aqarmap" %}
  32. {# user logo macro #}
  33. {% macro userLogo(imgLink, disableLazyLoadImgIndex, listingUserPhotoSize, listingId, classList = "") %}
  34.     <div class="search-listing-card__logo {{ classList }}">
  35.         <img
  36.             {% if disableLazyLoadImgIndex %}
  37.                 src="{{ imgLink }}"
  38.             {% else %}
  39.                 class="lazyload"
  40.                 src=""
  41.                 data-src="{{ imgLink }}"
  42.             {% endif %}
  43.             width="{{ listingUserPhotoSize }}"
  44.             height="{{ listingUserPhotoSize }}"
  45.             alt="user-logo-{{ listingId }}"
  46.             fetchpriority="low"
  47.         >
  48.     </div>
  49. {% endmacro %}
  50. {% for listing in listings %}
  51.     {% if agent is defined %}
  52.         {% set listing = listing['listing'] %}
  53.     {% endif %}
  54.     {# Listing Toggles #}
  55.     {% set isCompoundSearchResultsCard = isCompoundSearchResults is defined ? isCompoundSearchResults : false %}
  56.     {% set isVerified = ((listing.featured == SPONSORED_TYPE) or (listing.featured == SPOTLIGHT_CONSTANT)) and isEnabledFeature('web.show.verified.sign') %}
  57.     {% set isEligibleForMortgage = isEnabledFeature('web.mortgage.options') and listing.isMortgageApproved  %}
  58.     {% set isSponsoredCard = loop.index == 1 and not topSellersResults and not isRelatedResults and (listing.featured == SPONSORED_TYPE or listing.featured == SOLD_BY_OWNER_SPONSORED_TYPE) %}
  59.     {% set isListingPhotosDefined = listingPhotos[listing.id] is defined and listingPhotos[listing.id].main is defined %}
  60.     {% set isListingLogoDefined = listingPhotos[listing.id] is defined and listingPhotos[listing.id].logo is defined %}
  61.     {% set disableLazyLoadImgIndex = loop.index in [1, 2] %}
  62.     {% set searchedByOneLocation = isSearchedByOneLocation is defined and isSearchedByOneLocation %}
  63.     {% if not isCompoundSearchResultsCard %}
  64.         {% set isPricesWidgetToggledOn = isUXVersion and isEnabledFeature('web.seo.prices.widget') %}
  65.         {% set isPricesWidgetListingTypes = not defaultResults and not topSellersResults and searchedByOneLocation %}
  66.         {% set isEnabledPricesWidget = isPricesWidgetToggledOn and isPricesWidgetListingTypes %}
  67.         {% set mobileFeedadsScreenLocation = loop.index == inFeedAdAppearance %}
  68.         {% set isMobileFeedadsToggledOn = isEnabledFeature('web.search.mobile.feedads') and isMobile and isUXVersion %}
  69.         {% set isFeedAdsWithinListingTypes = not defaultResults and not isInFeedAdAappeared %}
  70.         {% set showMobileFeedads = isMobileFeedadsToggledOn and isFeedAdsWithinListingTypes and mobileFeedadsScreenLocation %}
  71.     {% endif %}
  72.     {# Listing Vars #}
  73.     {% set listingCategory =   listing.category %}
  74.     {% set urlSource = app.request.query.get("source") ? app.request.query.get("source") : ''%}
  75.     {% set containerSource = source is defined ? source : null %}
  76.     {% set leadSources = containerSource ? [containerSource] : [urlSource] %}
  77.     {% set financeFeatureValue = get_setting('features', 'finance_service') %}
  78.     {% set isRelatedToMainListing = isRelatedToListing is defined ? isRelatedToListing : false %}
  79.     {% set mainListingObj = (isRelatedToMainListing and mainListing is defined) ? mainListing : {} %}
  80.     {% if isEnabledFeature('listing_card.lead.button') %}
  81.         {% set listingPhones = isEnabledFeature('listing_user_phones') ? listing.phones : listing.listingPhones %}
  82.     {% else %}
  83.         {% set listingPhones = [] %}
  84.     {% endif %}
  85.     {% set listingPhone = null %}
  86.     {% if listingPhones is not empty %}
  87.         {% set listingPhone = listingPhones|first %}
  88.     {% endif %}
  89.     {% if listing.slug %}
  90.         {% set LISTING_URL = isRelatedResults ? path("listing_slug", {id: listing.id, slug: listing.slug}|merge({'relatedseaarchlisting': true})) :  path("listing_slug", {id: listing.id, slug: listing.slug}) %}
  91.     {% else %}
  92.         {% set LISTING_URL = isRelatedResults ? path('listing_view', {'id': listing.id}|merge({'relatedseaarchlisting': true})) : path('listing_view', {'id': listing.id}) %}
  93.     {% endif %}
  94.     {% if isRelatedToMainListing %}
  95.             {% set LISTING_URL = LISTING_URL ~ '?source=listing-related' %}
  96.     {% endif %}
  97.     {% set relatedListingAnalytics = isRelatedResults ? 'gtm-btn-related-result-listing-click' : '' %}
  98.     {% set relatedListingClass = isRelatedResults ? 'related-listing__card' : '' %}
  99.     {% set searchListingCardClass = isTopPicksResults is defined and isTopPicksResults ? 'search-listing-card  top-picks-card' : 'search-listing-card search-listing-card_mb-xl' %}
  100.     {% set listingEvents = [{'isFired':isVerified , 'trigger': 'gtm-btn-verified-listing-click' }] %}
  101.     {% set listingPhotoSize = 110 %}
  102.     {% set iconSize = 24 %}
  103.     {% set listingUserPhotoSize = 32 %}
  104.     {% set neighborhoodAppearance = 9 %}
  105.     {% set isExcludeWhatsappFromListing = isEnabledFeature('web.whatsapp.chat.exclude') and listing.getIsExcludedFromWhatsApp %}
  106.     {% set acceptedWhatsAppFeature = not isExcludeWhatsappFromListing or not isEnabledFeature('web.whatsapp.chat.exclude') %}
  107.     {% set isEnabledSendByWhatsapp = isEnabledFeature('web.whats.app.chat') and acceptedWhatsAppFeature %}
  108.     {% if isEnabledSendByWhatsapp %}
  109.         {% if (listing.user.getWhatsAppNumber) %}
  110.             {% set whatsAppNumber = listing.user.getWhatsAppNumber.getPhone.getNumber %}
  111.         {% endif %}
  112.         {% set hasWhatsapp = listing.user.getWhatsAppNumber %}
  113.     {% else %}
  114.         {% set hasWhatsapp = false %}
  115.     {% endif %}
  116.     {% set callBtnClass = not hasWhatsapp ? 'big': '' %}
  117.     {% set callBtnText = not hasWhatsapp ? 'listing.show_seller_phone'|trans : "" %}
  118.     {% set isProject = listingCategory == PROJECT_LISTING_CATEGORY %}
  119.     {% set projectListingChild = listing.parent != null %}
  120.     {% set notProjectListing = not isProject and not projectListingChild %}
  121.     {% set strictQuickRegistration = get_setting('features', 'strict_to_quick_registration') %}
  122.     {% set autoShowPhone = not strictQuickRegistration and notProjectListing  %}
  123.     {% set isSoldByOwnerType = listing.featured == SOLD_BY_OWNER_TYPE or listing.featured == SOLD_BY_OWNER_SPONSORED_TYPE %}
  124.     {% set listing_attributes = listing.getAttributesList() %}
  125.     {% set listing_rooms = (listing_attributes["rooms"]) is defined ? getRoomsLabel(listing_attributes["rooms"]) : '' %}
  126.     {% set listing_baths = (listing_attributes["baths"]) is defined ? getBathsLabel(listing_attributes["baths"]) : '' %}
  127.     {% set backgroundClass = 'listing-phone-container_bg-white listing-phone-container_number-gray'%}
  128.     {% set cardGridSize = cardGridSize is defined ? cardGridSize : 'col-sm-6 col-12' %}
  129.     {% set showPhotosCount = disablePhotosCount is not defined or not disablePhotosCount %}
  130.     {% set sellerName = '' %}
  131.     {% set listingUser = listing.user %}
  132.     {% set sellerName =  listingUser.fullName %}
  133.     {% set userLogo = listingUser.logo ? listingUser.logo.file : null %}
  134.     {% set logo = listing.validUserLogo %}
  135.     {% set sellerLogo = logo ? logo : userLogo %}
  136.     {% set sellerUrl = path('aqarmap_user_listings', {'id': listingUser.id})%}
  137.     {% set joinedData = listingUser.createdAt|date('Y')%}
  138.     {% set activeListingsCount = liveListingsPerUser[listing.user.id] is defined ? liveListingsPerUser[listing.user.id] : 0 %}
  139.     {% set leadsCount = listingUser.getClientServedCount() %}
  140.     {% set encodedSellerPhones = []%}
  141.     {% for phone in listingPhones %}
  142.         {% set encodedSellerPhones = encodedSellerPhones | merge([{'number': phone.number|phoneNumberEncode}]) %}
  143.     {% endfor %}
  144.     {% set listingLabelType = listing.label %}
  145.     {% set isListingTopPicks = listing.isTopPicks %}
  146.     {% set allowListingLabel = isSearchResultsPage and not isListingTopPicks %}
  147.     {% set isTopFavourited = listingLabelType == TOP_FAVOURITAED_CONST %}
  148.     {% set isValidPrice = listingLabelType == VALID_PRICE_CONST %}
  149.     {% set isTopViewed = listingLabelType == TOP_VIEWED_CONST %}
  150.     {% set labelLeadSource = '' %}
  151.     {% if isTopFavourited %}
  152.         {% set labelLeadSource = 'top-favourite' %}
  153.         {% set leadSources = leadSources|merge([labelLeadSource]) %}
  154.     {% elseif isValidPrice %}
  155.         {% set labelLeadSource = 'valid-price' %}
  156.          {% set leadSources = leadSources|merge([labelLeadSource]) %}
  157.     {% elseif isTopViewed %}
  158.         {% set labelLeadSource = 'top-viewed' %}
  159.         {% set leadSources = leadSources|merge([labelLeadSource]) %}
  160.     {% endif %}
  161.     {% set listingPrice = listing.price ?? null  %}
  162.     {% set listingFeatured = listing.featured  %}
  163.     {% set isSpotLight = listingFeatured == SPOTLIGHT_CONSTANT %}
  164.     {% set isSponserd = listingFeatured == SPONSORED_TYPE %}
  165.     {% set isPremium = listingFeatured == PREMIUM_CONSTANT %}
  166.     {% set isFeatured = listingFeatured == FEATURE_TYPE %}
  167.     {% set isPaid = listingCategory == PAID_LISTING_CATEGORY %}
  168.     {% set isScrapped = listingCategory == SCRAPPED_LISTING_CATEGORY %}
  169.     {% set isEBawab = listingCategory == EBAWAB_LISTING_CATEGORY %}
  170.     {% set isUnlimited = listingCategory == UNLIMITED_LISTING_CATEGORY %}
  171.     {% set isFlf2 = listingCategory == FIRST_LISTING_FOR_FREE_LISTING_CATEGORY %}
  172.     {# Compounds Listing Vars #}
  173.     {% if isCompoundSearchResultsCard %}
  174.         {% set compoundAveragePrices = listing.compoundAveragePrices is defined ? listing.compoundAveragePrices : [] %}
  175.         {% set isCompoundAveragePrices = compoundAveragePrices is not empty %}
  176.         {% set showCompoundAveragePrices = false %}
  177.         {% set compoundField = listing.CompoundField ? listing.CompoundField :{}  %}
  178.         {% set isEnabledDdeveloperCardData = isCompoundSearchResultsCard and isEnabledFeature('web.developer.card.data') %}
  179.         {% set isCompoundPlannerPage = isCompoundPlanner is defined and isCompoundPlanner %}
  180.         {% set elasticScore = isCompoundPlannerPage ? listing.compoundElasticScore|round(2, 'floor') : null %}
  181.         {% set compoundPrice = listing.CompoundField ? listing.CompoundField.minPrice : null %}
  182.         {% set listingPrice = compoundPrice ?? listingPrice %}
  183.     {% endif %}
  184.     {# gtm events variables #}
  185.     {% set leadSourcePage = leadSourcePage is defined ? leadSourcePage : "search_results"%}
  186.     {% set propertySectionSlug = isProject ? "projects" :  section is defined ? section.slug: listing.section.slug %}
  187.     {% set propertyCategory = isProject ? "projects" :  isScrapped ? "scrapped" :
  188.     isPaid ? "paid" : isEBawab ? "bawab" : isUnlimited ? "unlimited" :
  189.     isFlf2 ? "flf2" : "free" %}
  190.     {% set depthProduct = isFeatured ? "featured" : isPremium ? "premium" :
  191.     isSponserd ? "sponsored": isSpotLight ? "spotlight" : "regular" %}
  192.     {% set insideCompound = isProject or listing.parent != null  %}
  193.     <div id="{{listing.id}}" class="{{ cardGridSize }} {{relatedListingClass}} {{searchListingCardClass}}"
  194.          ng-init='setSourceRoute("{{ app.request.attributes.get('_route') }}");'
  195.         itemscope itemtype="https://schema.org/SingleFamilyResidence">
  196.          <div class="search-listing-card__container" ng-content-loaded
  197.                 callback='setListingDetail("{{listing.id}}",{
  198.                     "section": "{{listing.section.id}}",
  199.                     "sellerPhones": {{encodedSellerPhones|serialize('json')}},
  200.                     "sellerPhone": "{{hasWhatsapp  ? whatsAppNumber|phoneNumberEncode : listingPhone ? listingPhone.number|phoneNumberEncode : "" }}",
  201.                     "financeUrl":"{{listing.getFinancialAidURL()}}",
  202.                     "userEmail": {{currentUserEmail|json_encode()}},
  203.                     "financeFeatureValue": "{{financeFeatureValue}}",
  204.                     "listingName" : {{listing.customSlug|default(listing.id)|serialize()}},
  205.                     "listingTitle" : {{listing.title|serialize()}},
  206.                     "listingUser": {
  207.                         "sellerName" : {{sellerName|serialize()}},
  208.                         "sellerLogo": "",
  209.                         "sellerUrl": "{{sellerUrl}}",
  210.                         "joinedData":"{{joinedData}}",
  211.                         "activeListingsCount": "{{activeListingsCount}}",
  212.                         "leadsCount":"{{leadsCount}}"
  213.                     }
  214.                 })'>
  215.             <div class="search-listing-card__wrapper">
  216.                 <a class="search-listing-card__container__link {{ relatedListingAnalytics }}"
  217.                     onclick="elementEvents.fireGTM( 'listingId',{{ listing.id }}, {{ listingEvents|json_encode() }})"
  218.                     href="{{ LISTING_URL }}"></a>
  219.                 <div class="search-listing-card__labels">
  220.                     {% if isUserHasActiveSubscription %}
  221.                         {% if listing.featured == PREMIUM_CONSTANT %}
  222.                             <span class="search-listing-card__labels_card search-listing-card__labels_card_sponsored">
  223.                                 {{ 'search_results.premium_small'|trans }}
  224.                             </span>
  225.                         {% elseif listing.featured == SPOTLIGHT_CONSTANT %}
  226.                             <span class="search-listing-card__labels_card search-listing-card__labels_card_sponsored">
  227.                                 {{ 'search_results.spotlight'|trans }}
  228.                             </span>
  229.                         {% elseif listing.featured == SPONSORED_TYPE %}
  230.                             <span class="search-listing-card__labels_card search-listing-card__labels_card_sponsored">
  231.                                 {{ 'search_results.sponsored'|trans }}
  232.                             </span>
  233.                         {% elseif isCompoundSearchResultsCard and listing.featured %}
  234.                             <span class="search-listing-card__labels_card search-listing-card__labels_card_sponsored">
  235.                                 {{ 'search_results.featured_small'|trans }}
  236.                             </span>
  237.                         {% endif %}
  238.                         {% if listing.featured == FEATURE_TYPE %}
  239.                             <span class="search-listing-card__labels_card search-listing-card__labels_card_featured">
  240.                                 {{ 'search_results.featured_capital'|trans }}
  241.                             </span>
  242.                         {% elseif isSoldByOwnerType %}
  243.                             <span class="search-listing-card__labels_card search-listing-card__labels_card_featured">
  244.                                 {{ 'search_results.sold_by_owner'|trans }}
  245.                             </span>
  246.                         {% endif %}
  247.                     {% endif %}
  248.                         {% if isVerified %}
  249.                         <span class="search-listing-card__labels_card search-listing-card__labels_card_verified">
  250.                             {{ 'search_results.verified'|trans }}
  251.                         </span>
  252.                     {% endif %}
  253.                     {% if isEligibleForMortgage %}
  254.                         <span class="search-listing-card__labels_card search-listing-card__labels_card_mortgage">
  255.                             {{ 'search_results.is_mortgage'|trans }}
  256.                         </span>
  257.                     {% endif %}
  258.                     {% if isRelatedToMainListing %}
  259.                         <span class="search-listing-card__labels_card search-listing-card__labels_card_featured">
  260.                             {{ getSimilarLabel(mainListingObj, listing)|trans }}
  261.                         </span>
  262.                     {% endif %}
  263.                 </div>
  264.                 <div class="search-listing-card__img embed-responsive embed-responsive-4by3">
  265.                     <div class="search-listing-card__img__wrapper embed-responsive-item">
  266.                         {% if isListingPhotosDefined %}
  267.                             {% if disableLazyLoadImgIndex %}
  268.                                 <picture>
  269.                                     <source  srcset="{{ custom_vich_uploader_asset(listingPhotos[listing.id].main.file, 'file')|thumbnail('search-thumb-webp') }}"
  270.                                         type="image/webp">
  271.                                     <source srcset="{{ custom_vich_uploader_asset(listingPhotos[listing.id].main.file, 'file')|thumbnail('search-thumb') }}"
  272.                                         type="image/jpg">
  273.                                     <img
  274.                                         alt="{{ listing.title|excludeNumbers }}"
  275.                                         width="{{ listingPhotoSize }}" height="{{ listingPhotoSize }}"
  276.                                         fetchpriority="high" />
  277.                                 </picture>
  278.                             {% else %}
  279.                                 <picture>
  280.                                     <source  data-srcset="{{ custom_vich_uploader_asset(listingPhotos[listing.id].main.file, 'file')|thumbnail('search-thumb-webp') }}"
  281.                                         type="image/webp">
  282.                                     <source  data-srcset="{{ custom_vich_uploader_asset(listingPhotos[listing.id].main.file, 'file')|thumbnail('search-thumb') }}"
  283.                                         type="image/jpg">
  284.                                     <img
  285.                                         src="/images/placeholder.svg"
  286.                                         class="lazyload"
  287.                                         alt="{{ listing.title|excludeNumbers }}"
  288.                                         width="{{ listingPhotoSize }}" height="{{ listingPhotoSize }}"
  289.                                         fetchpriority="low" />
  290.                                 </picture>
  291.                             {% endif %}
  292.                         {% elseif listing.mainPhoto %}
  293.                             {% if disableLazyLoadImgIndex %}
  294.                                 <picture>
  295.                                     <source  srcset="{{ custom_vich_uploader_asset(listing.mainPhoto.file, 'file')|thumbnail('search-thumb-webp') }}"
  296.                                         type="image/webp">
  297.                                     <source  srcset="{{ custom_vich_uploader_asset(listing.mainPhoto.file, 'file')|thumbnail('search-thumb') }}"
  298.                                         type="image/jpg">
  299.                                     <img
  300.                                         alt="{{ listing.title|excludeNumbers }}"
  301.                                         width="{{ listingPhotoSize }}" height="{{ listingPhotoSize }}"
  302.                                         fetchpriority="high" />
  303.                                 </picture>
  304.                             {% else %}
  305.                                 <picture>
  306.                                     <source  data-srcset="{{ custom_vich_uploader_asset(listing.mainPhoto.file, 'file')|thumbnail('search-thumb-webp') }}"
  307.                                         type="image/webp">
  308.                                     <source  data-srcset="{{ custom_vich_uploader_asset(listing.mainPhoto.file, 'file')|thumbnail('search-thumb') }}"
  309.                                         type="image/jpg">
  310.                                     <img
  311.                                         src="/images/placeholder.svg"
  312.                                         class="lazyload"
  313.                                         alt="{{ listing.title|excludeNumbers }}"
  314.                                         width="{{ listingPhotoSize }}" height="{{ listingPhotoSize }}"
  315.                                         fetchpriority="low" />
  316.                                 </picture>
  317.                             {% endif %}
  318.                         {% else %}
  319.                             <div class="search-listing-card__img__no-photo">{{ 'layout.no_listing_photo'|trans }}</div>
  320.                         {% endif %}
  321.                         {% if showPhotosCount %}
  322.                             <div class="search-listing-card__img__thumbnail search-listing-card__img__thumbnail_bottom">
  323.                                 <div class="search-listing-card__img__count">
  324.                                     <span class="fa fa-image"></span>
  325.                                     {% if listingPhotosCount[listing.id] is defined %}
  326.                                         {{ listingPhotosCount[listing.id] }}
  327.                                     {% else %}
  328.                                         0
  329.                                     {% endif %}
  330.                                 </div>
  331.                             </div>
  332.                         {% endif %}
  333.                     </div>
  334.                 </div>
  335.                 <div class="search-listing-card__details">
  336.                     {% if app.request.attributes.get("_route") != 'aqarmap_user_listings'  %}
  337.                         {% if isListingLogoDefined %}
  338.                             {{ _self.userLogo(
  339.                                 custom_vich_uploader_asset(listingPhotos[listing.id].logo.file, 'file')  | thumbnail('logo'),
  340.                                 disableLazyLoadImgIndex,
  341.                                 listingUserPhotoSize,
  342.                                 listing.id
  343.                             ) }}
  344.                         {% elseif listing.validUserLogo %}
  345.                             {{ _self.userLogo(
  346.                                 custom_vich_uploader_asset(listing.validUserLogo, 'file')  | thumbnail('logo'),
  347.                                 disableLazyLoadImgIndex,
  348.                                 listingUserPhotoSize,
  349.                                 listing.id
  350.                             ) }}
  351.                         {% endif %}
  352.                     {% endif %}
  353.                     <div class="search-listing-card__details__wrapper" >
  354.                         {% if isCompoundSearchResultsCard %}
  355.                             {% if elasticScore is defined and elasticScore %}
  356.                                 {% if elasticScore > 80 %}
  357.                                     <div class="matching-score matching-score_high" role="alert">{{ elasticScore }}% {{ 'listing.compounds_adviser.matching'|trans }}
  358.                                     </div>
  359.                                 {% elseif elasticScore < 40 %}
  360.                                     <div class="matching-score matching-score_low" role="alert">{{ elasticScore }}% {{ 'listing.compounds_adviser.matching'|trans }}
  361.                                     </div>
  362.                                 {% else %}
  363.                                     <div class="matching-score matching-score_mid" role="alert">{{ elasticScore }}% {{ 'listing.compounds_adviser.matching'|trans }}
  364.                                     </div>
  365.                                 {% endif %}
  366.                             {% endif %}
  367.                             <div class="search-listing-card__compound-title">
  368.                                 <span> {{ listing.title|fixArabicNumbers|raw }}</span>
  369.                             </div>
  370.                             <p class="search-listing-card__address search-listing-card__address_compound">
  371.                                 <img
  372.                                     fetchpriority="low"
  373.                                     src="/images/BrandsIcons/listing/ic_location.svg"
  374.                                     class="search-listing-card__attributes_icon"
  375.                                     alt="{{ listing.address }}"
  376.                                     width="{{ iconSize }}" height="{{ iconSize }}"
  377.                                 />
  378.                                 <span> {{ listing.address }} </span>
  379.                             </p>
  380.                             {% if showCompoundAveragePrices %}
  381.                                 <div class="search-listing-card__units__wrapper">
  382.                                     {% if isCompoundAveragePrices%}
  383.                                         {% include '@AqarmapListingBundle/Listing/compoundAveragePrices.html.twig' with {'units': compoundAveragePrices} %}
  384.                                     {% endif %}
  385.                                 </div>
  386.                             {% endif %}
  387.                             <div class="search-listing-card__starting-price">
  388.                                 {% if listingPrice %}
  389.                                     {{ 'listing.starting_from'|trans }}
  390.                                     <span class="integer">{{ listingPrice |number_format }}</span>
  391.                                     <span>{{ get_setting('general', 'currency')|trans }}</span>
  392.                                 {% elseif listing.section.searchable %}
  393.                                     {{ 'listing.call_for_price'|trans }}
  394.                                 {% endif %}
  395.                             </div>
  396.                         {% else %}
  397.                             {% if allowListingLabel %}
  398.                                 <div class="search-listing-card__best-label">
  399.                                     {% if isValidPrice %}
  400.                                         <img fetchpriority="low" width="{{ iconSize }}" height="{{ iconSize }}"
  401.                                         src="{{ asset('images/picks/ic_money_blue.svg') }}" alt="{{'listing.valid_price'|trans }}" />
  402.                                         {{'listing.valid_price'|trans }}
  403.                                     {% elseif isTopViewed %}
  404.                                         <img fetchpriority="low" width="{{ iconSize }}" height="{{ iconSize }}"
  405.                                         src="{{ asset('images/picks/analytics-arrow-up_blue.svg') }}" alt="{{'listing.top_viewed'|trans }}" />
  406.                                         {{'listing.top_viewed'|trans }}
  407.                                     {% elseif isTopFavourited %}
  408.                                         <img fetchpriority="low" width="{{ iconSize }}" height="{{ iconSize }}"
  409.                                         src="{{ asset('images/picks/ic_heart_blue.svg') }}" alt="{{'listing.top_favourite'|trans }}" />
  410.                                         {{'listing.top_favourite'|trans }}
  411.                                     {% endif %}
  412.                                 </div>
  413.                             {% endif %}
  414.                             <div class="search-listing-card__price">
  415.                                 {% if listing.price %}
  416.                                     <span class="integer">{{ listing.price|number_format }}</span>
  417.                                     <span class="mx-2">{{ get_setting('general', 'currency')|trans }}</span>
  418.                                 {% elseif listing.section.searchable %}
  419.                                     {{ 'listing.call_for_price'|trans }}
  420.                                 {% endif %}
  421.                             </div>
  422.                             <h2 class="search-listing-card__title">
  423.                                 {{ listing.title|fixArabicNumbers|raw }}
  424.                             </h2>
  425.                             <p class="search-listing-card__address" >
  426.                                 <img
  427.                                     fetchpriority="low"
  428.                                     src="/images/BrandsIcons/listing/ic_location.svg"
  429.                                     class="search-listing-card__attributes_icon"
  430.                                     alt="{{ listing.address }}"
  431.                                     width="{{ iconSize }}" height="{{ iconSize }}"
  432.                                 />
  433.                                 <span>{{ listing.address }}</span>
  434.                             </p>
  435.                             <div class="search-listing-card__attributes">
  436.                                 <label class="search-listing-card__attributes_item">
  437.                                     <img
  438.                                         fetchpriority="low"
  439.                                         src="/images/BrandsIcons/listing/ic_size.svg"
  440.                                         class="search-listing-card__attributes_icon"
  441.                                         alt="Listing attributes"
  442.                                         width="{{ iconSize }}" height="{{ iconSize }}"
  443.                                     />
  444.                                     {{ listing.area}} {{ get_setting('general', 'measurement_unit')|trans }}
  445.                                 </label>
  446.                                 {% if listing_attributes|length > 0 %}
  447.                                     {% if listing_rooms %}
  448.                                         <label class="search-listing-card__attributes_item">
  449.                                             <img
  450.                                                 fetchpriority="low"
  451.                                                 src="/images/BrandsIcons/listing/ic_bedroom.svg"
  452.                                                 class="search-listing-card__attributes_icon"
  453.                                                 alt="Listing attributes"
  454.                                                 width="{{ iconSize }}" height="{{ iconSize }}"
  455.                                             />
  456.                                             {{ listing_rooms }}
  457.                                         </label>
  458.                                     {% endif %}
  459.                                     {% if listing_baths %}
  460.                                         <label class="search-listing-card__attributes_item">
  461.                                             <img
  462.                                                 fetchpriority="low"
  463.                                                 src="/images/BrandsIcons/listing/ic_bathroom.svg"
  464.                                                 class="search-listing-card__attributes_icon"
  465.                                                 alt="Listing attributes"
  466.                                                 width="{{ iconSize }}" height="{{ iconSize }}"
  467.                                             />
  468.                                             {{ listing_baths }}
  469.                                         </label>
  470.                                     {% endif %}
  471.                                 {% endif %}
  472.                             </div>
  473.                         {% endif %}
  474.                     </div>
  475.                 </div>
  476.             </div>
  477.             {% if isEnabledDdeveloperCardData is defined and isEnabledDdeveloperCardData %}
  478.                 <div class="search-listing-card__user-properties__container">
  479.                     <hr class="desktop-separator">
  480.                     <div class="search-listing-card__user-properties user-properties-container">
  481.                         {% include '@AqarmapListingBundle/Listing/compoundCardDeveloperData.html.twig' with {'compound': compoundField} %}
  482.                     </div>
  483.                 </div>
  484.             {% endif %}
  485.             {% if showCtaButtons %}
  486.                 <div class="search-listing-card__footer">
  487.                     <hr class="desktop-separator">
  488.                     <div class="search-listing-card__cta w-100">
  489.                         {% if listingPhones is not empty and not listing.isCallRequest %}
  490.                             {% if hasWhatsapp %}
  491.                                 <button aria-label="text seller by whatsapp"
  492.                                     class="search-listing-card__cta-button search-listing-card__cta-button_whatsapp whatsapp big"
  493.                                     ng-click="onSendLead($event,{
  494.                                         leadType:'whatsapp' ,
  495.                                         actionType:'{{ SEND_WHATSAPP_CONSTANT }}' ,
  496.                                         {# listingType:  {{leadSources|serialize('json')}} , #}
  497.                                         propertySection: '{{propertySectionSlug}}' ,
  498.                                         propertyCategory: '{{propertyCategory}}',
  499.                                         leadSourcePage: '{{leadSourcePage}}' ,
  500.                                         depthProduct: '{{depthProduct}}',
  501.                                         listingId: '{{ listing.id }}' ,
  502.                                         insideCompound : '{{insideCompound}}'
  503.                                     });"
  504.                                     >
  505.                                     <img
  506.                                         fetchpriority="low"
  507.                                         src="/images/BrandsIcons/listing/ic_whatsapp.svg"
  508.                                         class="search-listing-card__cta-button_whatsapp_icon"
  509.                                         alt="{{ 'label.lead.whatsApp'|trans }}"
  510.                                         width="{{ iconSize }}" height="{{ iconSize }}"
  511.                                     />
  512.                                     {{ 'label.lead.whatsApp'|trans }}
  513.                                 </button>
  514.                                 <div class="vertical-separator"></div>
  515.                             {% endif %}
  516.                             {% set phoneBtnClass = 'search-listing-card__cta-button search-listing-card__cta-button_call ' ~ callBtnClass %}
  517.                             <button class="{{ phoneBtnClass }}" aria-label="show seller phone"
  518.                                 submit-text="{{ 'listing.show_seller_phone'|trans }}"
  519.                                 ng-click="searchActionType = 'showNumber';
  520.                                         onSendLead($event,{
  521.                                             leadType:'call' ,
  522.                                             actionType:'{{ SHOW_PHONE_CONSTANT }}' ,
  523.                                             leadSourcePage: '{{leadSourcePage}}' ,
  524.                                             propertySection: '{{propertySectionSlug}}' ,
  525.                                             propertyCategory: '{{propertyCategory}}',
  526.                                             depthProduct: '{{depthProduct}}',
  527.                                             {# listingType:  {{leadSources|serialize('json')}} , #}
  528.                                             listingId: '{{ listing.id }}' ,
  529.                                             insideCompound : '{{insideCompound}}'
  530.                                         });"
  531.                                 ng-if="!phoneShowed[{{listing.id}}]"
  532.                                 data-gtm-listing-id="{{ listing.id }}">
  533.                                 <img
  534.                                     fetchpriority="low"
  535.                                     src="/images/BrandsIcons/listing/ic_phone.svg"
  536.                                     class="search-listing-card__cta-button_call_icon"
  537.                                     alt="{{ 'listing.show_seller_phone'|trans }}"
  538.                                     width="{{ iconSize }}" height="{{ iconSize }}"
  539.                                 />
  540.                                 <span class="cta-button-text"> {{ 'listing.show_seller_phone'|trans }}</span>
  541.                             </button>
  542.                             <button class="{{ phoneBtnClass }}" aria-label="seller phone"
  543.                                 ng-cloak
  544.                                 ng-click="showPhoneModalByListingId({{listing.id}})"
  545.                                 ng-if="phoneShowed[{{listing.id}}]">
  546.                                 <img
  547.                                     fetchpriority="low"
  548.                                     src="/images/BrandsIcons/listing/ic_phone.svg"
  549.                                     class="search-listing-card__cta-button_call_icon"
  550.                                     alt="{{ 'listing.show_seller_phone'|trans }}"
  551.                                     width="{{ iconSize }}" height="{{ iconSize }}"
  552.                                 />
  553.                                 <span class="cta-button-text"> {{ 'listing.show_seller_phone'|trans }}</span>
  554.                             </button>
  555.                         {% else %}
  556.                             <button aria-label="request seller call"
  557.                                 class="search-listing-card__cta-button search-listing-card__cta-button_call-request big m-0"
  558.                                 ng-hide="callRequested[{{listing.id}}]"
  559.                                 ng-click="searchActionType = 'sendRequest';
  560.                                     onSendLead($event,{
  561.                                         leadType:'request_call' ,
  562.                                         actionType:'{{ CALL_REQUEST_CONSTANT }}' ,
  563.                                         {# listingType:  {{leadSources|serialize('json')}} , #}
  564.                                         leadSourcePage: '{{leadSourcePage}}' ,
  565.                                         propertySection: '{{propertySectionSlug}}' ,
  566.                                         propertyCategory: '{{propertyCategory}}',
  567.                                         depthProduct: '{{depthProduct}}',
  568.                                         listingId: '{{ listing.id }}' ,
  569.                                         insideCompound : '{{insideCompound}}'
  570.                                     });"
  571.                                 >
  572.                                 <img
  573.                                     fetchpriority="low"
  574.                                     src="/images/BrandsIcons/listing/ic_phone.svg"
  575.                                     class="search-listing-card__cta-button_call_icon"
  576.                                     alt="{{ 'label.lead.call_request'|trans }}"
  577.                                     width="{{ iconSize }}" height="{{ iconSize }}"
  578.                                 />
  579.                                 <span ng-hide="callRequested[{{listing.id}}]" class="cta-button-text"> {{ 'label.lead.call_request'|trans }} </span>
  580.                             </button>
  581.                             <button  aria-label="seller call requested"
  582.                                 class="search-listing-card__cta-button big success ng-hide"
  583.                                 ng-show="callRequested[{{listing.id}}]"
  584.                                 type= "button"
  585.                                 disabled
  586.                                 >
  587.                                 <i class="fa fa-check circle-badge success"></i>
  588.                                 <span class="mx-1"> {{ 'label.lead.call_requested'|trans }}  </span>
  589.                             </button>
  590.                         {% endif %}
  591.                     </div>
  592.                 </div>
  593.             {% endif %}
  594.         </div>
  595.         {# elastic scoring debug #}
  596.         {% if isEnabledElasticScoringDebug %}
  597.             {% include "@AqarmapListing/ListingSearch/listingElasticScore.html.twig" %}
  598.         {% endif %}
  599.     </div>
  600.     {% if showMobileFeedads is defined and showMobileFeedads %}
  601.         <div class="text-center col-12 visible-sm visible-xs" style="margin-bottom: 24px;">
  602.             {% if get_setting('general', 'country') == 'SA' %}
  603.                 <div id='div-gpt-ad-1611049193067-0' style='width: 320px; height: 320px;  margin: 0 auto 10px;'>
  604.                     <script>
  605.                         setTimeout(function() {
  606.                             if (typeof googletag !== 'undefined') {
  607.                                 googletag.cmd.push(function() { googletag.display('div-gpt-ad-1611049193067-0'); });
  608.                             }
  609.                         }, 3000);
  610.                     </script>
  611.                 </div>
  612.             {% else %}
  613.                 <div id='div-gpt-ad-1588541966744-0' style='width: 320px; height: 320px; margin: 0 auto 10px;'>
  614.                     <script type="application/javascript" v-pre defer>
  615.                         setTimeout(function() {
  616.                             if (typeof googletag !== 'undefined') {
  617.                                 googletag.cmd.push(function() { googletag.display('div-gpt-ad-1588541966744-0'); });
  618.                             }
  619.                         }, 3000);
  620.                     </script>
  621.                 </div>
  622.             {% endif %}
  623.         </div>
  624.         {% set isInFeedAdAappeared = true  %}
  625.     {% endif %}
  626.     {% if isEnabledPricesWidget is defined and isEnabledPricesWidget %}
  627.         {% if loop.index == neighborhoodAppearance %}
  628.             <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 simple-neighborhoods pb-3">
  629.                 {% include "@AqarmapListing/ListingSearch/neighborhoodsInSearch.html.twig" %}
  630.             </div>
  631.         {% endif %}
  632.     {% endif %}
  633.     {% set listingPhoto = isListingPhotosDefined ? custom_vich_uploader_asset(listingPhotos[listing.id].main.file, 'file')|thumbnail('search-thumb-webp')  : listing.mainPhoto  ? custom_vich_uploader_asset(listing.mainPhoto.file, 'file')|thumbnail('search-thumb-webp')  : "" %}
  634.     {% block headScripts %}
  635.         <script type="application/ld+json">
  636.             {
  637.                 "@context": "https://schema.org",
  638.                 "@type": "SingleFamilyResidence",
  639.                 "name" : "{{listing.title}}",
  640.                 "image": "{{listingPhoto}}",
  641.                 "url": "{{ absolute_url(LISTING_URL) }}",
  642.                 "address": {
  643.                     "@type": "PostalAddress",
  644.                     "name": "{{ listing.location.title }}"
  645.                 },
  646.                 "geo": {
  647.                     "@type": "GeoCoordinates",
  648.                     "latitude": "{{ listing.location.centerLat }}",
  649.                     "longitude": "{{ listing.location.centerLng }}"
  650.                 },
  651.                 "floorSize": {
  652.                     "@type": "QuantitativeValue",
  653.                     "value": "{{ listing.area }}"
  654.                 }
  655.             }
  656.         </script>
  657.     {% endblock %}
  658. {% endfor %}