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

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