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 compoundPrice = listing.CompoundField ? listing.CompoundField.minPrice : null %}
  179. {% set listingPrice = compoundPrice ?? listingPrice %}
  180. {% endif %}
  181. {# gtm events variables #}
  182. {% set leadSourcePage = leadSourcePage is defined ? leadSourcePage : "search_results"%}
  183. {% set propertySectionSlug = isProject ? "projects" : section is defined ? section.slug: listing.section.slug %}
  184. {% set propertyCategory = isProject ? "projects" : isScrapped ? "scrapped" :
  185. isPaid ? "paid" : isEBawab ? "bawab" : isUnlimited ? "unlimited" :
  186. isFlf2 ? "flf2" : "free" %}
  187. {% set depthProduct = isFeatured ? "featured" : isPremium ? "premium" :
  188. isSponserd ? "sponsored": isSpotLight ? "spotlight" : "regular" %}
  189. {% set insideCompound = isProject or listing.parent != null %}
  190. <div id="{{listing.id}}" class="{{ cardGridSize }} {{relatedListingClass}} {{searchListingCardClass}}"
  191. ng-init='setSourceRoute("{{ app.request.attributes.get('_route') }}");'
  192. itemscope itemtype="https://schema.org/SingleFamilyResidence">
  193. <div class="search-listing-card__container" ng-content-loaded
  194. callback='setListingDetail("{{listing.id}}",{
  195. "section": "{{listing.section.id}}",
  196. "sellerPhones": {{isCtaButtonsEnabled ? encodedSellerPhones|serialize('json') : []}},
  197. "sellerPhone": "{{ isCtaButtonsEnabled ? (hasWhatsapp ? whatsAppNumber|phoneNumberEncode : (listingPhone ? listingPhone.number|phoneNumberEncode : '')) :''}}",
  198. "financeUrl":"{{listing.getFinancialAidURL()}}",
  199. "userEmail": {{currentUserEmail|json_encode()}},
  200. "financeFeatureValue": "{{financeFeatureValue}}",
  201. "listingName" : {{listing.customSlug|default(listing.id)|serialize()}},
  202. "listingTitle" : {{listing.title|serialize()}},
  203. "listingUser": {
  204. "sellerName" : {{sellerName|serialize()}},
  205. "sellerLogo": "",
  206. "sellerUrl": "{{sellerUrl}}",
  207. "joinedData":"{{joinedData}}",
  208. "activeListingsCount": "{{activeListingsCount}}",
  209. "leadsCount":"{{leadsCount}}"
  210. }
  211. })'>
  212. <div class="search-listing-card__wrapper">
  213. <a class="search-listing-card__container__link {{ relatedListingAnalytics }}"
  214. onclick="elementEvents.fireGTM( 'listingId',{{ listing.id }}, {{ listingEvents|json_encode() }})"
  215. href="{{ LISTING_URL }}"></a>
  216. <div class="search-listing-card__labels">
  217. {% if isUserHasActiveSubscription %}
  218. {% if listing.featured == PREMIUM_CONSTANT %}
  219. <span class="search-listing-card__labels_card search-listing-card__labels_card_sponsored">
  220. {{ 'search_results.premium_small'|trans }}
  221. </span>
  222. {% elseif listing.featured == SPOTLIGHT_CONSTANT %}
  223. <span class="search-listing-card__labels_card search-listing-card__labels_card_sponsored">
  224. {{ 'search_results.spotlight'|trans }}
  225. </span>
  226. {% elseif listing.featured == SPONSORED_TYPE %}
  227. <span class="search-listing-card__labels_card search-listing-card__labels_card_sponsored">
  228. {{ 'search_results.sponsored'|trans }}
  229. </span>
  230. {% elseif isCompoundSearchResultsCard and listing.featured %}
  231. <span class="search-listing-card__labels_card search-listing-card__labels_card_sponsored">
  232. {{ 'search_results.featured_small'|trans }}
  233. </span>
  234. {% endif %}
  235. {% if listing.featured == FEATURE_TYPE %}
  236. <span class="search-listing-card__labels_card search-listing-card__labels_card_featured">
  237. {{ 'search_results.featured_capital'|trans }}
  238. </span>
  239. {% elseif isSoldByOwnerType %}
  240. <span class="search-listing-card__labels_card search-listing-card__labels_card_featured">
  241. {{ 'search_results.sold_by_owner'|trans }}
  242. </span>
  243. {% endif %}
  244. {% endif %}
  245. {% if isVerified %}
  246. <span class="search-listing-card__labels_card search-listing-card__labels_card_verified">
  247. {{ 'search_results.verified'|trans }}
  248. </span>
  249. {% endif %}
  250. {% if isEligibleForMortgage %}
  251. <span class="search-listing-card__labels_card search-listing-card__labels_card_mortgage">
  252. {{ 'search_results.is_mortgage'|trans }}
  253. </span>
  254. {% endif %}
  255. {% if isRelatedToMainListing %}
  256. <span class="search-listing-card__labels_card search-listing-card__labels_card_featured">
  257. {{ getSimilarLabel(mainListingObj, listing)|trans }}
  258. </span>
  259. {% endif %}
  260. </div>
  261. <div class="search-listing-card__img embed-responsive embed-responsive-4by3">
  262. <div class="search-listing-card__img__wrapper embed-responsive-item">
  263. {% if isListingPhotosDefined %}
  264. {% if disableLazyLoadImgIndex %}
  265. <picture>
  266. <source srcset="{{ custom_vich_uploader_asset(listingPhotos[listing.id].main.file, 'file')|thumbnail('search-thumb-webp') }}"
  267. type="image/webp">
  268. <source srcset="{{ custom_vich_uploader_asset(listingPhotos[listing.id].main.file, 'file')|thumbnail('search-thumb') }}"
  269. type="image/jpg">
  270. <img
  271. alt="{{ listing.title|excludeNumbers }}"
  272. width="{{ listingPhotoSize }}" height="{{ listingPhotoSize }}"
  273. fetchpriority="high" />
  274. </picture>
  275. {% else %}
  276. <picture>
  277. <source data-srcset="{{ custom_vich_uploader_asset(listingPhotos[listing.id].main.file, 'file')|thumbnail('search-thumb-webp') }}"
  278. type="image/webp">
  279. <source data-srcset="{{ custom_vich_uploader_asset(listingPhotos[listing.id].main.file, 'file')|thumbnail('search-thumb') }}"
  280. type="image/jpg">
  281. <img
  282. src="/images/placeholder.svg"
  283. class="lazyload"
  284. alt="{{ listing.title|excludeNumbers }}"
  285. width="{{ listingPhotoSize }}" height="{{ listingPhotoSize }}"
  286. fetchpriority="low" />
  287. </picture>
  288. {% endif %}
  289. {% elseif listing.mainPhoto %}
  290. {% if disableLazyLoadImgIndex %}
  291. <picture>
  292. <source srcset="{{ custom_vich_uploader_asset(listing.mainPhoto.file, 'file')|thumbnail('search-thumb-webp') }}"
  293. type="image/webp">
  294. <source srcset="{{ custom_vich_uploader_asset(listing.mainPhoto.file, 'file')|thumbnail('search-thumb') }}"
  295. type="image/jpg">
  296. <img
  297. alt="{{ listing.title|excludeNumbers }}"
  298. width="{{ listingPhotoSize }}" height="{{ listingPhotoSize }}"
  299. fetchpriority="high" />
  300. </picture>
  301. {% else %}
  302. <picture>
  303. <source data-srcset="{{ custom_vich_uploader_asset(listing.mainPhoto.file, 'file')|thumbnail('search-thumb-webp') }}"
  304. type="image/webp">
  305. <source data-srcset="{{ custom_vich_uploader_asset(listing.mainPhoto.file, 'file')|thumbnail('search-thumb') }}"
  306. type="image/jpg">
  307. <img
  308. src="/images/placeholder.svg"
  309. class="lazyload"
  310. alt="{{ listing.title|excludeNumbers }}"
  311. width="{{ listingPhotoSize }}" height="{{ listingPhotoSize }}"
  312. fetchpriority="low" />
  313. </picture>
  314. {% endif %}
  315. {% else %}
  316. <div class="search-listing-card__img__no-photo">{{ 'layout.no_listing_photo'|trans }}</div>
  317. {% endif %}
  318. {% if showPhotosCount %}
  319. <div class="search-listing-card__img__thumbnail search-listing-card__img__thumbnail_bottom">
  320. <div class="search-listing-card__img__count">
  321. <span class="fa fa-image"></span>
  322. {% if listingPhotosCount[listing.id] is defined %}
  323. {{ listingPhotosCount[listing.id] }}
  324. {% else %}
  325. 0
  326. {% endif %}
  327. </div>
  328. </div>
  329. {% endif %}
  330. </div>
  331. </div>
  332. <div class="search-listing-card__details">
  333. {% if app.request.attributes.get("_route") != 'aqarmap_user_listings' %}
  334. {% if isListingLogoDefined %}
  335. {{ _self.userLogo(
  336. custom_vich_uploader_asset(listingPhotos[listing.id].logo.file, 'file') | thumbnail('logo'),
  337. disableLazyLoadImgIndex,
  338. listingUserPhotoSize,
  339. listing.id
  340. ) }}
  341. {% elseif listing.validUserLogo %}
  342. {{ _self.userLogo(
  343. custom_vich_uploader_asset(listing.validUserLogo, 'file') | thumbnail('logo'),
  344. disableLazyLoadImgIndex,
  345. listingUserPhotoSize,
  346. listing.id
  347. ) }}
  348. {% endif %}
  349. {% endif %}
  350. <div class="search-listing-card__details__wrapper" >
  351. {% if isCompoundSearchResultsCard %}
  352. <div class="search-listing-card__compound-title">
  353. <span> {{ listing.title|fixArabicNumbers|raw }}</span>
  354. </div>
  355. <p class="search-listing-card__address search-listing-card__address_compound">
  356. <img
  357. fetchpriority="low"
  358. src="/images/BrandsIcons/listing/ic_location.svg"
  359. class="search-listing-card__attributes_icon"
  360. alt="{{ listing.address }}"
  361. width="{{ iconSize }}" height="{{ iconSize }}"
  362. />
  363. <span> {{ listing.address }} </span>
  364. </p>
  365. {% if showCompoundAveragePrices %}
  366. <div class="search-listing-card__units__wrapper">
  367. {% if isCompoundAveragePrices%}
  368. {% include '@AqarmapListingBundle/Listing/compoundAveragePrices.html.twig' with {'units': compoundAveragePrices} %}
  369. {% endif %}
  370. </div>
  371. {% endif %}
  372. <div class="search-listing-card__starting-price">
  373. {% if listingPrice %}
  374. {{ 'listing.starting_from'|trans }}
  375. <span class="integer">{{ listingPrice |number_format }}</span>
  376. <span>{{ get_setting('general', 'currency')|trans }}</span>
  377. {% elseif listing.section.searchable %}
  378. {{ 'listing.call_for_price'|trans }}
  379. {% endif %}
  380. </div>
  381. {% else %}
  382. {% if allowListingLabel %}
  383. <div class="search-listing-card__best-label">
  384. {% if isValidPrice %}
  385. <img fetchpriority="low" width="{{ iconSize }}" height="{{ iconSize }}"
  386. src="{{ asset('images/picks/ic_money_blue.svg') }}" alt="{{'listing.valid_price'|trans }}" />
  387. {{'listing.valid_price'|trans }}
  388. {% elseif isTopViewed %}
  389. <img fetchpriority="low" width="{{ iconSize }}" height="{{ iconSize }}"
  390. src="{{ asset('images/picks/analytics-arrow-up_blue.svg') }}" alt="{{'listing.top_viewed'|trans }}" />
  391. {{'listing.top_viewed'|trans }}
  392. {% elseif isTopFavourited %}
  393. <img fetchpriority="low" width="{{ iconSize }}" height="{{ iconSize }}"
  394. src="{{ asset('images/picks/ic_heart_blue.svg') }}" alt="{{'listing.top_favourite'|trans }}" />
  395. {{'listing.top_favourite'|trans }}
  396. {% endif %}
  397. </div>
  398. {% endif %}
  399. <div class="search-listing-card__price">
  400. {% if listing.price %}
  401. <span class="integer">{{ listing.price|number_format }}</span>
  402. <span class="mx-2">{{ get_setting('general', 'currency')|trans }}</span>
  403. {% elseif listing.section.searchable %}
  404. {{ 'listing.call_for_price'|trans }}
  405. {% endif %}
  406. </div>
  407. <h2 class="search-listing-card__title">
  408. {{ listing.title|fixArabicNumbers|raw }}
  409. </h2>
  410. <p class="search-listing-card__address" >
  411. <img
  412. fetchpriority="low"
  413. src="/images/BrandsIcons/listing/ic_location.svg"
  414. class="search-listing-card__attributes_icon"
  415. alt="{{ listing.address }}"
  416. width="{{ iconSize }}" height="{{ iconSize }}"
  417. />
  418. <span>{{ listing.address }}</span>
  419. </p>
  420. <div class="search-listing-card__attributes">
  421. <label class="search-listing-card__attributes_item">
  422. <img
  423. fetchpriority="low"
  424. src="/images/BrandsIcons/listing/ic_size.svg"
  425. class="search-listing-card__attributes_icon"
  426. alt="Listing attributes"
  427. width="{{ iconSize }}" height="{{ iconSize }}"
  428. />
  429. {{ listing.area}} {{ get_setting('general', 'measurement_unit')|trans }}
  430. </label>
  431. {% if listing_attributes|length > 0 %}
  432. {% if listing_rooms %}
  433. <label class="search-listing-card__attributes_item">
  434. <img
  435. fetchpriority="low"
  436. src="/images/BrandsIcons/listing/ic_bedroom.svg"
  437. class="search-listing-card__attributes_icon"
  438. alt="Listing attributes"
  439. width="{{ iconSize }}" height="{{ iconSize }}"
  440. />
  441. {{ listing_rooms }}
  442. </label>
  443. {% endif %}
  444. {% if listing_baths %}
  445. <label class="search-listing-card__attributes_item">
  446. <img
  447. fetchpriority="low"
  448. src="/images/BrandsIcons/listing/ic_bathroom.svg"
  449. class="search-listing-card__attributes_icon"
  450. alt="Listing attributes"
  451. width="{{ iconSize }}" height="{{ iconSize }}"
  452. />
  453. {{ listing_baths }}
  454. </label>
  455. {% endif %}
  456. {% endif %}
  457. </div>
  458. {% endif %}
  459. </div>
  460. </div>
  461. </div>
  462. {% if isEnabledDdeveloperCardData is defined and isEnabledDdeveloperCardData %}
  463. <div class="search-listing-card__user-properties__container">
  464. <hr class="desktop-separator">
  465. <div class="search-listing-card__user-properties user-properties-container">
  466. {% include '@AqarmapListingBundle/Listing/compoundCardDeveloperData.html.twig' with {'compound': compoundField} %}
  467. </div>
  468. </div>
  469. {% endif %}
  470. {% if showCtaButtons %}
  471. <div class="search-listing-card__footer">
  472. <hr class="desktop-separator">
  473. <div class="search-listing-card__cta w-100">
  474. {% if listingPhones is not empty and not listing.isCallRequest %}
  475. {% if hasWhatsapp %}
  476. <button aria-label="text seller by whatsapp"
  477. class="search-listing-card__cta-button search-listing-card__cta-button_whatsapp whatsapp big"
  478. ng-click="onSendLead($event,{
  479. leadType:'whatsapp' ,
  480. actionType:'{{ SEND_WHATSAPP_CONSTANT }}' ,
  481. {# listingType: {{leadSources|serialize('json')}} , #}
  482. propertySection: '{{propertySectionSlug}}' ,
  483. propertyCategory: '{{propertyCategory}}',
  484. leadSourcePage: '{{leadSourcePage}}' ,
  485. depthProduct: '{{depthProduct}}',
  486. listingId: '{{ listing.id }}' ,
  487. insideCompound : '{{insideCompound}}'
  488. });"
  489. >
  490. <img
  491. fetchpriority="low"
  492. src="/images/BrandsIcons/listing/ic_whatsapp.svg"
  493. class="search-listing-card__cta-button_whatsapp_icon"
  494. alt="{{ 'label.lead.whatsApp'|trans }}"
  495. width="{{ iconSize }}" height="{{ iconSize }}"
  496. />
  497. {{ 'label.lead.whatsApp'|trans }}
  498. </button>
  499. <div class="vertical-separator"></div>
  500. {% endif %}
  501. {% set phoneBtnClass = 'search-listing-card__cta-button search-listing-card__cta-button_call ' ~ callBtnClass %}
  502. <button class="{{ phoneBtnClass }}" aria-label="show seller phone"
  503. submit-text="{{ 'listing.show_seller_phone'|trans }}"
  504. ng-click="searchActionType = 'showNumber';
  505. onSendLead($event,{
  506. leadType:'call' ,
  507. actionType:'{{ SHOW_PHONE_CONSTANT }}' ,
  508. leadSourcePage: '{{leadSourcePage}}' ,
  509. propertySection: '{{propertySectionSlug}}' ,
  510. propertyCategory: '{{propertyCategory}}',
  511. depthProduct: '{{depthProduct}}',
  512. {# listingType: {{leadSources|serialize('json')}} , #}
  513. listingId: '{{ listing.id }}' ,
  514. insideCompound : '{{insideCompound}}'
  515. });"
  516. ng-if="!phoneShowed[{{listing.id}}]"
  517. data-gtm-listing-id="{{ listing.id }}">
  518. <img
  519. fetchpriority="low"
  520. src="/images/BrandsIcons/listing/ic_phone.svg"
  521. class="search-listing-card__cta-button_call_icon"
  522. alt="{{ 'listing.show_seller_phone'|trans }}"
  523. width="{{ iconSize }}" height="{{ iconSize }}"
  524. />
  525. <span class="cta-button-text"> {{ 'listing.show_seller_phone'|trans }}</span>
  526. </button>
  527. <button class="{{ phoneBtnClass }}" aria-label="seller phone"
  528. ng-cloak
  529. ng-click="showPhoneModalByListingId({{listing.id}})"
  530. ng-if="phoneShowed[{{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. {% else %}
  541. <button aria-label="request seller call"
  542. class="search-listing-card__cta-button search-listing-card__cta-button_call-request big m-0"
  543. ng-hide="callRequested[{{listing.id}}]"
  544. ng-click="searchActionType = 'sendRequest';
  545. onSendLead($event,{
  546. leadType:'request_call' ,
  547. actionType:'{{ CALL_REQUEST_CONSTANT }}' ,
  548. {# listingType: {{leadSources|serialize('json')}} , #}
  549. leadSourcePage: '{{leadSourcePage}}' ,
  550. propertySection: '{{propertySectionSlug}}' ,
  551. propertyCategory: '{{propertyCategory}}',
  552. depthProduct: '{{depthProduct}}',
  553. listingId: '{{ listing.id }}' ,
  554. insideCompound : '{{insideCompound}}'
  555. });"
  556. >
  557. <img
  558. fetchpriority="low"
  559. src="/images/BrandsIcons/listing/ic_phone.svg"
  560. class="search-listing-card__cta-button_call_icon"
  561. alt="{{ 'label.lead.call_request'|trans }}"
  562. width="{{ iconSize }}" height="{{ iconSize }}"
  563. />
  564. <span ng-hide="callRequested[{{listing.id}}]" class="cta-button-text"> {{ 'label.lead.call_request'|trans }} </span>
  565. </button>
  566. <button aria-label="seller call requested"
  567. class="search-listing-card__cta-button big success ng-hide"
  568. ng-show="callRequested[{{listing.id}}]"
  569. type= "button"
  570. disabled
  571. >
  572. <i class="fa fa-check circle-badge success"></i>
  573. <span class="mx-1"> {{ 'label.lead.call_requested'|trans }} </span>
  574. </button>
  575. {% endif %}
  576. </div>
  577. </div>
  578. {% endif %}
  579. </div>
  580. {# elastic scoring debug #}
  581. {% if isEnabledElasticScoringDebug %}
  582. {% include "@AqarmapListing/ListingSearch/listingElasticScore.html.twig" %}
  583. {% endif %}
  584. </div>
  585. {% if showMobileFeedads is defined and showMobileFeedads %}
  586. <div class="text-center col-12 visible-sm visible-xs" style="margin-bottom: 24px;">
  587. {% if get_setting('general', 'country') == 'SA' %}
  588. <div id='div-gpt-ad-1611049193067-0' style='width: 320px; height: 320px; margin: 0 auto 10px;'>
  589. <script>
  590. setTimeout(function() {
  591. if (typeof googletag !== 'undefined') {
  592. googletag.cmd.push(function() { googletag.display('div-gpt-ad-1611049193067-0'); });
  593. }
  594. }, 3000);
  595. </script>
  596. </div>
  597. {% else %}
  598. <div id='div-gpt-ad-1588541966744-0' style='width: 320px; height: 320px; margin: 0 auto 10px;'>
  599. <script type="application/javascript" v-pre defer>
  600. setTimeout(function() {
  601. if (typeof googletag !== 'undefined') {
  602. googletag.cmd.push(function() { googletag.display('div-gpt-ad-1588541966744-0'); });
  603. }
  604. }, 3000);
  605. </script>
  606. </div>
  607. {% endif %}
  608. </div>
  609. {% set isInFeedAdAappeared = true %}
  610. {% endif %}
  611. {% 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') : "" %}
  612. {% block headScripts %}
  613. <script type="application/ld+json">
  614. {
  615. "@context": "https://schema.org",
  616. "@type": "SingleFamilyResidence",
  617. "name" : "{{listing.title}}",
  618. "image": "{{listingPhoto}}",
  619. "url": "{{ absolute_url(LISTING_URL) }}",
  620. "address": {
  621. "@type": "PostalAddress",
  622. "name": "{{ listing.location.title }}"
  623. },
  624. "geo": {
  625. "@type": "GeoCoordinates",
  626. "latitude": "{{ listing.location.centerLat }}",
  627. "longitude": "{{ listing.location.centerLng }}"
  628. },
  629. "floorSize": {
  630. "@type": "QuantitativeValue",
  631. "value": "{{ listing.area }}"
  632. }
  633. }
  634. </script>
  635. {% endblock %}
  636. {% endfor %}