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