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

  1. {% extends "base.html.twig" %}
  2. {% form_theme quick_registration_form 'Form/form_div_layout.html.twig' %}
  3. {# Constants #}
  4. {% set FIRST_LISTING_FOR_FREE_LISTING_CATEGORY = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingCategories::FIRST_LISTING_FOR_FREE') %}
  5. {% set EBAWAB_LISTING_CATEGORY = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingCategories::EBAWAB') %}
  6. {% set UNLIMITED_LISTING_CATEGORY = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingCategories::UNLIMITED') %}
  7. {% set PAID_LISTING_CATEGORY = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingCategories::PAID') %}
  8. {% set PROJECT_LISTING_CATEGORY = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingCategories::PROJECTS') %}
  9. {% set SCRAPPED_LISTING_CATEGORY = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingCategories::SCRAPPED') %}
  10. {% set SHOW_PHONE_CONSTANT = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\LeadTypes::SHOW_PHONE') %}
  11. {% set SEND_MESSAGE_CONSTANT = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\LeadTypes::SEND_MESSAGE') %}
  12. {% set SEND_WHATSAPP_CONSTANT = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\LeadTypes::WHATSAPP') %}
  13. {% set CALL_REQUEST_CONSTANT = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\LeadTypes::CALL_REQUEST') %}
  14. {% set TOP_VIEWED_CONST = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingLabel::TOP_VIEWED') %}
  15. {% set TOP_FAVOURITAED_CONST = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingLabel::TOP_FAVORITE') %}
  16. {% set VALID_PRICE_CONST = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingLabel::VALID_PRICE') %}
  17. {% set SPONSORED_TYPE = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingFeaturedTypes::SPONSORED') %}
  18. {% set FEATURE_TYPE = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingFeaturedTypes::FEATURED') %}
  19. {% set PREMIUM_CONSTANT = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingFeaturedTypes::PREMIUM') %}
  20. {% set SPOTLIGHT_CONSTANT = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingFeaturedTypes::SPOTLIGHT') %}
  21. {# gtm events variables #}
  22. {% set listingFeatured = listing.featured %}
  23. {% set isSpotLight = listingFeatured == SPOTLIGHT_CONSTANT %}
  24. {% set isSponserd = listingFeatured == SPONSORED_TYPE %}
  25. {% set isPremium = listingFeatured == PREMIUM_CONSTANT %}
  26. {% set isFeatured = listingFeatured == FEATURE_TYPE %}
  27. {% set listingCategory = listing.category %}
  28. {% set isProject = listingCategory == PROJECT_LISTING_CATEGORY %}
  29. {% set isPaid = listingCategory == PAID_LISTING_CATEGORY %}
  30. {% set isScrapped = listingCategory == SCRAPPED_LISTING_CATEGORY %}
  31. {% set isEBawab = listingCategory == EBAWAB_LISTING_CATEGORY %}
  32. {% set isUnlimited = listingCategory == UNLIMITED_LISTING_CATEGORY %}
  33. {% set isFlf2 = listingCategory == FIRST_LISTING_FOR_FREE_LISTING_CATEGORY %}
  34. {% set propertySectionSlug = isProject ? "projects" : section is defined ? section.slug: listing.section.slug %}
  35. {% set propertyCategory = isProject ? "projects" : isScrapped ? "scrapped" :
  36. isPaid ? "paid" : isEBawab ? "bawab" : isUnlimited ? "unlimited" :
  37. isFlf2 ? "flf2" : "free" %}
  38. {% set depthProduct = isFeatured ? "featured" : isPremium ? "premium" :
  39. isSponserd ? "sponsored": isSpotLight ? "spotlight" : "regular" %}
  40. {% set insideCompound = isProject or listing.parent != null %}
  41. {# classes names variables #}
  42. {% set sendEmailBtnStyleClasses = 'btn btn-block btn-lg cta-btn rounded-pill btn-gray' %}
  43. {% set phoneBtnStyleClasses = 'btn btn-block btn-lg cta-btn rounded-pill btn-primary' %}
  44. {% set forRent = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingSections::FOR_RENT')%}
  45. {% set PROJECT_LISTING_CHILD = listing.parent != null %}
  46. {% set isListingHasChildren = liveUnitsPaginated is not empty %}
  47. {% set PROJECT_LISTING_PARENT = isListingHasChildren %}
  48. {% set IS_PROJECT = listing.category == PROJECT_LISTING_CATEGORY or PROJECT_LISTING_CHILD %}
  49. {% set IS_PROJECT_PARENT = PROJECT_LISTING_PARENT or listing.category == PROJECT_LISTING_CATEGORY %}
  50. {% set isScrapped = listing.category == SCRAPPED_LISTING_CATEGORY %}
  51. {% set parentId = listing.parent ? listing.parent.id : listing.id %}
  52. {% set parentTitle = listing.parent ? listing.parent.title : listing.title %}
  53. {% set isEnabledActivityToggles = isEnabledFeature('web.activity.app') and isEnabledFeature('web.my.activities.build') %}
  54. {% set isEnabledActivityListingPageToggles = isEnabledActivityToggles and isEnabledFeature('web.listing.page.activities') %}
  55. {% set isEnabledActivityListingPage = isEnabledActivityListingPageToggles and not IS_PROJECT_PARENT %}
  56. {% set isEnabledLazyloadingActivitiesBuild = isEnabledFeature('web.async.vueapp') %}
  57. {% set isUnitsTabsEnabled = IS_PROJECT and (PROJECT_LISTING_PARENT or not PROJECT_LISTING_CHILD) %}
  58. {% set hasResaleUnits = resaleUnitsPaginated|length > 0 %}
  59. {% set hasRentUnits = rentUnitsPaginated|length > 0 %}
  60. {% set hasPrimaryUnits = liveUnitsPaginated|length > 0 %}
  61. {% set isPrimaryUnitsSoldOut = not hasPrimaryUnits %}
  62. {% set isRentUnitsSoldOut = not hasRentUnits %}
  63. {% set isResaleUnitsSoldOut = not hasResaleUnits %}
  64. {% set isUnitsSoldOut = isUnitsTabsEnabled and isRentUnitsSoldOut and isResaleUnitsSoldOut and isPrimaryUnitsSoldOut %}
  65. {% set isPrimaryUnitsOnly = hasPrimaryUnits and isRentUnitsSoldOut and isResaleUnitsSoldOut %}
  66. {% set isPrimarySoldOutCta = isUnitsTabsEnabled and isPrimaryUnitsSoldOut %}
  67. {% set isListingCallRequest = (isUnitsTabsEnabled and isPrimaryUnitsSoldOut) or listing.isCallRequest %}
  68. {% set isEligibleForMortgage = isEnabledFeature('web.mortgage.options') and listing.isMortgageApproved %}
  69. {% set isEnabledCompoundBuild = IS_PROJECT_PARENT and isEnabledFeature('web.compound.listingpage.build') %}
  70. {% set propertyType = listing.propertyType %}
  71. {% set propertyTypeId = propertyType.id %}
  72. {% set section = listing.section %}
  73. {% set sectionId = section.id %}
  74. {% set location = listing.location %}
  75. {% set locationId = location.id %}
  76. {% set isCompaniesDataParamsDefined = true %}
  77. {% set isListingForRent = sectionId == forRent %}
  78. {% set listingParent = listing.parent %}
  79. {% set compoundField = listingParent ? listingParent.CompoundField : listing.CompoundField %}
  80. {% set showSellerInfo = not IS_PROJECT and not isScrapped %}
  81. {% set showTopSearchableCompaniesList = true %}
  82. {% set listingPhones = isEnabledFeature('listing_user_phones') ? listing.phones : listing.listingPhones %}
  83. {% set listingPhone = null %}
  84. {% if listingPhones is not empty %}
  85. {% set listingPhone = listingPhones|first %}
  86. {% endif %}
  87. {% set financeFeatureValue = get_setting('features', 'finance_service') %}
  88. {% set ALLOWED_LISTING_SECTIONS_TO_ADD_FINANCE_URL = constant('Aqarmap\\Bundle\\FinancialAidsBundle\\Constant\\FinancialAidConstraints::ALLOWED_LISTING_SECTIONS_TO_ADD_FINANCE_URL')%}
  89. {% set showListingDetails = not isListingHasChildren and not isUnitsTabsEnabled %}
  90. {% set isSearchableListing = section.searchable == true %}
  91. {% set metaTitle = "%s %s %s . %s"|format(listing.title,'layout.in'|trans, location,'layout.app_name'|trans) %}
  92. {% set metaDescription = listing.description|nl2br|markdown_to_html %}
  93. {% if IS_PROJECT_PARENT %}
  94. {% if listing.metaTitle %}
  95. {% set metaTitle = 'layout.project_listing_details_title_with_suffix'|trans({'%project%': listing.metaTitle}) %}
  96. {% else %}
  97. {% set metaTitle = 'layout.project_listing_details_title'|trans({'%project%': listing.title}) %}
  98. {% endif %}
  99. {% if listing.metaDescription %}
  100. {% set metaDescription = listing.metaDescription %}
  101. {% endif %}
  102. {% endif %}
  103. {% block title %}{{ metaTitle }}{% endblock %}
  104. {% block meta_description %}
  105. {{ metaDescription }}
  106. {% endblock %}
  107. {% set enable_project_faqs = IS_PROJECT_PARENT and compoundFaqs is defined and compoundFaqs|length %}
  108. {% if enable_project_faqs %}
  109. {% set project_faqs = [
  110. compoundFaqs.location ? {
  111. "@type": "Question",
  112. "name": 'layout.faqs_project_page.location_count.name'|trans({
  113. '%project%': listing.title
  114. }),
  115. "acceptedAnswer": {
  116. "@type": "Answer",
  117. "text": 'layout.faqs_project_page.location_count.answer'|trans({
  118. '%project%': listing.title,
  119. '%location%': compoundFaqs.location,
  120. }),
  121. }
  122. } : {},
  123. compoundFaqs.minimumUnitPrice ? {
  124. "@type": "Question",
  125. "name": 'layout.faqs_project_page.start_price.name'|trans({
  126. '%project%': listing.title
  127. }),
  128. "acceptedAnswer": {
  129. "@type": "Answer",
  130. "text": 'layout.faqs_project_page.start_price.answer'|trans({
  131. '%project%': listing.title,
  132. '%starting_price%': compoundFaqs.minimumUnitPrice|number_format,
  133. }),
  134. }
  135. } : {},
  136. compoundFaqs.minimumUnitArea ? {
  137. "@type": "Question",
  138. "name": 'layout.faqs_project_page.start_area.name'|trans({
  139. '%project%': listing.title
  140. }),
  141. "acceptedAnswer": {
  142. "@type": "Answer",
  143. "text": 'layout.faqs_project_page.start_area.answer'|trans({
  144. '%project%': listing.title,
  145. '%starting_area%': compoundFaqs.minimumUnitArea|number_format,
  146. }),
  147. }
  148. } : {},
  149. compoundFaqs.lastUpdate ? {
  150. "@type": "Question",
  151. "name": 'layout.faqs_project_page.data_updated.name'|trans,
  152. "acceptedAnswer": {
  153. "@type": "Answer",
  154. "text": 'layout.faqs_project_page.data_updated.answer'|trans({
  155. '%project%': listing.title,
  156. '%date%': compoundFaqs.lastUpdate|date("m/d/Y"),
  157. }),
  158. }
  159. } : {},
  160. compoundFaqs.constructionStatus ? {
  161. "@type": "Question",
  162. "name": 'layout.faqs_project_page.status.name'|trans({
  163. '%project%': listing.title
  164. }),
  165. "acceptedAnswer": {
  166. "@type": "Answer",
  167. "text": 'layout.faqs_project_page.status.answer'|trans({
  168. '%project%': listing.title,
  169. '%status%': compoundFaqs.constructionStatus|trans,
  170. }),
  171. }
  172. } : {},
  173. ] %}
  174. {% endif %}
  175. {% block htmlhead %}
  176. {% set LISTING_CATEGORIES_SCRAPPED = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingCategories::SCRAPPED') %}
  177. <meta name="twitter:card" content="summary_large_image" />
  178. <meta name="twitter:site" content="{{ "%s%s"|format('@', 'layout.app_name'|trans) }}" />
  179. <meta name="twitter:creator" content="{{ "%s%s"|format('@', 'layout.app_name'|trans) }}" />
  180. <meta property="og:title" content="{{ listing.category == PROJECT_LISTING_CATEGORY ? 'layout.project_listing_details_title'|trans({'%project%': listing.title}) : "%s %s %s . %s"|format(listing.title,'layout.in'|trans, location,'layout.app_name'|trans) }}"/>
  181. <meta property="og:description" content="{{ listing.category == PROJECT_LISTING_CATEGORY ? 'listing.compound_guide.sharing.description_location'|trans({'%compound%': listing.title, '%location%': location}) : 'listing.sharing.description'|trans({'%location%': location}) }}" />
  182. <meta property="og:url" content="{{ url('listing_slug', {id: listing.id, slug: listing.slug}) }}" />
  183. <meta property="og:site_name" content="{{ 'layout.app_name'|trans }}" />
  184. <meta property="fb:app_id" content="{{ facebook_app_id }}"/>
  185. <meta property="og:image" content="{{ getSharingImage(listing) }}" />
  186. {% if shouldAddNoIndex(listing) %}
  187. <meta name="robots" content="noindex, nofollow">
  188. {% endif %}
  189. <link rel="canonical" href="{{ url('listing_slug', {id: parentId, slug: listing.slug}) }}"/>
  190. <link rel="shortlink" href="{{ url('listing_view', {id: listing.id}) }}"/>
  191. {% if listing.slug %}
  192. <link rel="alternate" hreflang="ar" href="{{ url('listing_slug', {id: listing.id, slug: listing.slug, _locale: 'ar'}) }}"/>
  193. <link rel="alternate" hreflang="en" href="{{ url('listing_slug', {id: listing.id, slug: listing.slug, _locale: 'en'}) }}"/>
  194. <link rel="alternate" hreflang="x-default"
  195. href="{{ url('listing_slug', {id: listing.id, slug: listing.slug, _locale: 'ar'}) }}"/>
  196. {% endif %}
  197. {% if enable_project_faqs %}
  198. <script type="application/ld+json">
  199. {
  200. "@context": "https://schema.org",
  201. "@type": "FAQPage",
  202. "mainEntity": {{ project_faqs | json_encode | raw }}
  203. }
  204. </script>
  205. {% endif %}
  206. {% endblock %}
  207. {% block categorizedStylesheets %}
  208. {{ encore_entry_link_tags('activitiesApp') }}
  209. {% if IS_PROJECT_PARENT %}
  210. <link rel="stylesheet" href="{{ asset('builds/css/projectDetailsBuild'~ (app.environment == 'dev' ? '' : '.min') ~'.css') }}" />
  211. {% else %}
  212. <link rel="stylesheet" href="{{ asset('builds/css/listingDetailsBuild'~ (app.environment == 'dev' ? '' : '.min') ~'.css') }}" />
  213. {% endif %}
  214. {% endblock %}
  215. {% block headerTop %}
  216. {% endblock %}
  217. {% set CTA_block = "" %}
  218. {% block body %}
  219. {% set markupType = "SingleFamilyResidence" %}
  220. {% set STATUS_LIVE_CONSTANT = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingStatus::LIVE') %}
  221. {% set PHOTO_MAIN_CONSTANT = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\PhotoTypes::MAIN_PHOTO') %}
  222. {% set STATUS_PENDING_CONSTANT = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingStatus::PENDING') %}
  223. {% set STATUS_USER_DELETED_CONSTANT = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingStatus::USER_DELETED') %}
  224. {% set PREMIUM_LISTING = not isSearchableListing %}
  225. {% if PREMIUM_LISTING %} {% set markupType = "GatedResidenceCommunity" %} {% endif %}
  226. {% if not isSearchableListing or (listing.parent and not listing.parent.section.searchable) %}
  227. {% set LEAD_LISTING = true %}
  228. {% else %}
  229. {% set LEAD_LISTING = false %}
  230. {% endif %}
  231. {% set STATUS_EXPIRED_CONSTANT = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingStatus::USER_DELETED') %}
  232. {% set LISTING_CATEGORIES_SCRAPPED = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingCategories::SCRAPPED') %}
  233. {% set topCompaniesEnabled = not get_setting('features', 'top_companies') %}
  234. {% set currentUser = app.user %}
  235. {% set currentUserEmail = currentUser ? currentUser.email : '' %}
  236. {% if isListingHasChildren %}
  237. {% set sharingEvent = "compound-details" %}
  238. {% else %}
  239. {% set sharingEvent = "listing-details" %}
  240. {% endif %}
  241. {% set showTopSellersModal = topSearchableCompaniesCount and searchableLocation is not null %}
  242. {% set showRegisterSurvey = isEnabledFeature('web.registration.survey') %}
  243. {% set country = get_setting('general', 'country') | lower %}
  244. {% set sellerName = '' %}
  245. {% set listingUser = listing.user %}
  246. {% set sellerName = listingUser.fullName %}
  247. {% set userLogo = listingUser.logo ? listingUser.logo.file : null %}
  248. {% set logo = listing.validUserLogo %}
  249. {% set sellerLogo = logo ? logo : userLogo %}
  250. {% set sellerUrl = path('aqarmap_user_listings', {'id': listingUser.id})%}
  251. {% set joinedData = listingUser.createdAt|date('Y')%}
  252. {% set listingMainPhoto = '#' %}
  253. {% if listing.mainPhoto %}
  254. {% set listingMainPhoto = custom_vich_uploader_asset(listing.mainPhoto.file, 'file') | thumbnail('search-thumb') %}
  255. {% endif %}
  256. {% set listing_attributes = listing.getAttributesList() %}
  257. {% set listing_floor = (listing_attributes["floor"]) is defined ? getFloorLabel(listing_attributes["floor"])|trans : '' %}
  258. {% set listing_year_built = (listing_attributes["year-built"]) is defined ? listing_attributes["year-built"] : '' %}
  259. {% set listing_baths = (listing_attributes["baths"]) is defined ? getRoomsLabel(listing_attributes["baths"]) : '' %}
  260. {% set listing_rooms = (listing_attributes["rooms"]) is defined ? getRoomsLabel(listing_attributes["rooms"]) : '' %}
  261. {% set listing_finish_type = (listing_attributes["finish-type"]) is defined ? listing_attributes["finish-type"] : '' %}
  262. {% set topSellerTrigger = 'gtm-action-topsellers-lead-listing-details' %}
  263. {% set topSellerEventAction = 'ListingDetails' %}
  264. {% set listingHasPhotos = listing.photosForSlider|length > 0 %}
  265. {% set ABtestingClasses = "listing-details-ab-testing-master virtical-related-listing virtical-related-listing_option-1" %}
  266. {% set encodedSellerPhones = []%}
  267. {% for phone in listingPhones %}
  268. {% set encodedSellerPhones = encodedSellerPhones | merge([{'number': phone.number|phoneNumberEncode}]) %}
  269. {% endfor %}
  270. {% set listingLabelType = listing.label %}
  271. {% set isListingTopPicks = listing.isTopPicks %}
  272. {% set allowListingLabel = listingLabelType and not isListingTopPicks and not IS_PROJECT_PARENT %}
  273. {% set isTopFavourited = listingLabelType == TOP_FAVOURITAED_CONST %}
  274. {% set isValidPrice = listingLabelType == VALID_PRICE_CONST %}
  275. {% set isTopViewed = listingLabelType == TOP_VIEWED_CONST %}
  276. {% set listingLabelUrl = path('search' , {'section_slug' : section.slug, 'property_type_slug' : propertyType.slug, 'location_slug': location.slug }|merge({'label': listingLabelType}))%}
  277. {% set enableSearchInListingDetails = not IS_PROJECT_PARENT and not isEnabledFeature('web.search.full.filters') %}
  278. {% set showRelatedListing = relatedListingsCount and isSearchableListing and not IS_PROJECT_PARENT %}
  279. {% set showOtherUnits = isEnabledFeature('web.other.units.details.page') and otherUnits|length > 0 %}
  280. {# Testing listings #}
  281. {% set testingListingsIds = [3747940, 3813089, 3626475, 2705901] %}
  282. {% set isTestingListing = listing.id in testingListingsIds %}
  283. {% set isListingSliderDisabledTest = isTestingListing and isEnabledFeature('web.disable.listingslider') %}
  284. {% set isTopSellersDisabledTest = isTestingListing and isEnabledFeature('web.disable.topsellers') %}
  285. {% set isRelatedListingsDisabledTest = isTestingListing and isEnabledFeature('web.disable.relatedlistings') %}
  286. {% set isGoogleDoubleClickDisabledTest = isTestingListing and isEnabledFeature('web.disable.googledoubleclick') %}
  287. {% set isEnabledActivityDisabledTest = isTestingListing and isEnabledFeature('web.disable.activities.test') %}
  288. {% set isEnabledActivityListingPage = isEnabledActivityListingPage and not isEnabledActivityDisabledTest %}
  289. {% set relatedListing %}
  290. <div class="row">
  291. {% include "@AqarmapListing/ListingSearch/listingCardVertical.html.twig" with {'listings': related_listings, 'mainListing': listing, 'isRelatedToListing': true, 'defaultResults' : false, 'topSellersResults' : false, 'isRelatedResults' : false, 'hideCta': true , 'cardGridSize': 'related-listing-card-option-1' , 'leadSourcePage': 'related_listings'} %}
  292. </div>
  293. {% endset %}
  294. <div class="listing-quick-lead" ng-controller="quickLeadController">
  295. <div ng-content-loaded callback='setSourceRoute("{{ app.request.attributes.get('_route') }}");
  296. setListingDetail("{{listing.id}}",{
  297. "id": "{{listing.id}}",
  298. "section": "{{section.id}}",
  299. "sectionTitle": {{section.title|serialize()}},
  300. "isProjectParent": "{{IS_PROJECT_PARENT}}" ,
  301. "sellerPhones": {{encodedSellerPhones|serialize('json')}},
  302. "sellerPhone": "{{listingPhone ? listingPhone.number|phoneNumberEncode: ""}}",
  303. "financeUrl":"{{listing.getFinancialAidURL()}}",
  304. "userEmail": {{currentUserEmail|json_encode()}},
  305. "financeFeatureValue": "{{financeFeatureValue}}",
  306. "listingName" : {{listing.customSlug|default(listing.id)|serialize()}},
  307. "listingTitle" : {{listing.title|serialize()}},
  308. "location": "{{location.id}}",
  309. "locationTitle": {{location.title|serialize()}},
  310. "propertyType": "{{propertyType.id}}",
  311. "propertyTypeTitle": {{propertyType.title|serialize()}},
  312. "price": "{{listing.price}}",
  313. "currency": "{{ get_setting('general', 'currency')|trans }}",
  314. "area": "{{listing.area}}",
  315. "isCompound": "{{IS_PROJECT_PARENT}}",
  316. "image": "{{ listingMainPhoto }}",
  317. "paymentMethodLabel": {{ listing.paymentMethodLabel|trans|serialize() }},
  318. "pricePerMeter": "{{listing.calculatePricePerMeter }}",
  319. "sellerRole": {{listing.sellerRoleLabel|trans|serialize()}},
  320. "floor": "{{ listing_floor }}",
  321. "baths": "{{ listing_baths }}",
  322. "rooms": "{{ listing_rooms }}",
  323. "yearBuilt": "{{ listing_year_built }}",
  324. "finishType": "{{ listing_finish_type }}",
  325. "publishDate": "{{ listing.publishedAt|date('Y-m-d h:i:s A') }}",
  326. "view": {{ listing.propertyViewLabel|trans|serialize() }},
  327. "listingUser": {
  328. "sellerName" : {{sellerName|serialize()}},
  329. "sellerLogo": "",
  330. "sellerUrl": "{{sellerUrl}}",
  331. "joinedData":"{{joinedData}}",
  332. "activeListingsCount": "{{activeListingsCount}}",
  333. "leadsCount":"{{leadsCount}}"
  334. },
  335. "description": {{ listing.description|serialize() }},
  336. });'>
  337. {% if enableSearchInListingDetails %}
  338. {% include "@AqarmapListing/ListingSearch/searchFormFilter.html.twig" %}
  339. {% endif %}
  340. <div class="container listingContainer listing_details_container {{ relatedListingsCount and isSearchableListing ? 'has-related-listing' : ''}} {% if isEnabledFeature('web.header.cta') %}overflow-hidden{% endif %}">
  341. <div class="row">
  342. {% include '@AqarmapListingBundle/Listing/listingNav.html.twig' %}
  343. <section
  344. class="col-md-12 listing-details {{ ABtestingClasses }}"
  345. data-sticky-container
  346. itemscope
  347. itemtype="https://schema.org/{{ markupType }}"
  348. >
  349. <div class="listing-slider-container padding-lg-zero padding-md-zero" >
  350. {% if listingHasPhotos %}
  351. <div class="slider-wrapper section-wrapper">
  352. {% include '@AqarmapListingBundle/Listing/listingSlider.html.twig' %}
  353. </div>
  354. {% endif %}
  355. {% include '@AqarmapListingBundle/Listing/listingContactWrapper.html.twig' %}
  356. </div>
  357. <div class="listing-details-container padding-md-zero">
  358. {% include '@AqarmapListingBundle/Listing/listingLabel.html.twig' %}
  359. {% if IS_PROJECT_PARENT %}
  360. {% include '@AqarmapListingBundle/Listing/projectDetailsTitle.html.twig' %}
  361. {% else %}
  362. {% include '@AqarmapListingBundle/Listing/listingTitle.html.twig' %}
  363. {% endif %}
  364. </div>
  365. <div class="listing-details-container padding-md-zero">
  366. {% include '@AqarmapListingBundle/Listing/listingUnitsTabs.html.twig' %}
  367. {% if showListingDetails %}
  368. {% include "@AqarmapListingBundle/Listing/listingDetailsList.html.twig" %}
  369. {% endif %}
  370. {% include "@AqarmapListingBundle/Listing/listingDescription.html.twig" %}
  371. {% include "@AqarmapListingBundle/Listing/listingMap.html.twig" %}
  372. {% include "@AqarmapListingBundle/Listing/listingSellerInfo.html.twig" %}
  373. {% if not isTopSellersDisabledTest %}
  374. {% include "@AqarmapListingBundle/Listing/listingTopSellers.html.twig" %}
  375. {% endif %}
  376. {% if IS_PROJECT %}
  377. {% include "@AqarmapListingBundle/Listing/compoundRating.html.twig" %}
  378. {% endif %}
  379. {% include '@AqarmapListingBundle/Listing/otherUnitsTable.html.twig' %}
  380. {% if not isRelatedListingsDisabledTest %}
  381. {% if showRelatedListing %}
  382. <div class="listing-details-item card-container card-container_option-2">
  383. {% include '@AqarmapListingBundle/Listing/listingRelatedListingSection.html.twig' %}
  384. </div>
  385. {% endif %}
  386. {% endif %}
  387. {% include '@AqarmapListingBundle/Listing/listingNeighborhoodsSection.html.twig' %}
  388. {% include '@AqarmapListingBundle/Listing/listingDiscussionsSection.html.twig' %}
  389. {% include '@AqarmapListingBundle/Listing/listingFooter.html.twig' %}
  390. </div>
  391. </section>
  392. {% include '@AqarmapListingBundle/Listing/projectFaqs.html.twig' %}
  393. </div>
  394. </div>
  395. {% if not isSearchableListing and not IS_PROJECT_PARENT %}
  396. {% set section = section %}
  397. <div class="container">
  398. <div class="compounds_quick_links">
  399. {% include "@AqarmapListing/CompoundSearch/compoundsSubLinks.html.twig" %}
  400. </div>
  401. </div>
  402. {% endif %}
  403. {# Google double click ads #}
  404. {% if not isGoogleDoubleClickDisabledTest %}
  405. {% include "adsHeader.html.twig" %}
  406. {% endif %}
  407. {# Modals container #}
  408. {% if not isRelatedListingsDisabledTest %}
  409. {% if showRelatedListing %}
  410. {% include '@AqarmapListingBundle/Listing/OnCloseListingPopup.html.twig' %}
  411. {% endif %}
  412. {% endif %}
  413. {% include '@AqarmapListingBundle/Listing/listingModalsContainer.html.twig' %}
  414. </div>
  415. </div>
  416. {% include '@AqarmapListingBundle/Listing/listingBreadcrumb.html.twig' %}
  417. {% endblock %}
  418. {% block footer %}
  419. {% include "footer.v2.html.twig" %}
  420. {% endblock %}
  421. {% block facebookLogin %}
  422. {% if isEnabledFeature('web.enable.quicklogin') %}
  423. {{ parent() }}
  424. {% endif %}
  425. {% endblock %}
  426. {% block categorizedJavascripts %}
  427. <script type="application/javascript" src="{{ asset('builds/js/buildListingDetailsCritical'~ (app.environment == 'dev' ? '' : '.min') ~'.js') }}"></script>
  428. <script defer type="application/javascript" src="{{ asset('builds/js/buildListingDetailsMainVendors'~ (app.environment == 'dev' ? '' : '.min') ~'.js') }}"></script>
  429. <script defer type="application/javascript" src="{{ asset('builds/js/buildListingDetailsExtraVendors'~ (app.environment == 'dev' ? '' : '.min') ~'.js') }}"></script>
  430. {% if isEnabledCompoundBuild %}
  431. <script defer src="{{ asset('builds/js/compound.desktop.buildListingDetails'~ (app.environment == 'dev' ? '' : '.min') ~'.js') }}"></script>
  432. {% else %}
  433. <script defer src="{{ asset('builds/js/buildListingDetails'~ (app.environment == 'dev' ? '' : '.min') ~'.js') }}"></script>
  434. {% endif %}
  435. <script defer type="application/javascript" src="{{ asset('builds/js/buildTopSellers'~ (app.environment == 'dev' ? '' : '.min') ~'.js') }}"></script>
  436. {% if isEnabledLazyloadingActivitiesBuild %}
  437. {% for file in encore_entry_js_files('activitiesApp') %}
  438. <script async type='application/javascript' src='{{ asset(file) }}'></script>
  439. {% endfor %}
  440. {% else %}
  441. {{ encore_entry_script_tags('activitiesApp', attributes={defer: false}) }}
  442. {% endif %}
  443. {% if topBar is defined and not null %}
  444. {{ encore_entry_script_tags('countdown') }}
  445. {% endif %}
  446. {% endblock %}
  447. {% block javascripts %}
  448. <script src="//maps.google.com/maps/api/js?v=3.25&amp;key={{ google_maps_key }}"></script>
  449. {{ parent() }}
  450. <script>
  451. $(document).ready(function () {
  452. imageSlider.lunchSlider({% if isLocalArabic %}true{% else %}false{% endif %}, false);
  453. });
  454. </script>
  455. <script>
  456. $(document).ready(function () {
  457. dataLayer.push({
  458. 'listingName': '{{ listing.customSlug|default(listing.id) }}',
  459. 'listingParentName': {% if listing.parent %}'{{ listing.parent.customSlug|default(listing.parent.id) }}'{% else %}null{% endif %},
  460. 'listingSection': '{{ leadAnalytics.listingSection|default('') }}',
  461. 'listingSegment': '{{ leadAnalytics.listingSegment|default('') }}',
  462. 'hasParent': {{ listing.parent ? 'true' : 'false' }},
  463. 'hasChildren': {{ listing.isProject ? 'true' : 'false' }},
  464. 'isFeatured': {{ listing.featured ? 'true' : 'false' }}
  465. });
  466. });
  467. </script>
  468. <script>
  469. function getdivheight(){
  470. return $('#listing-title-container').height() > 0 ? $('#listing-title-container').height() : 100;
  471. }
  472. function updateDivMargin(){
  473. //add 5 pix to height
  474. var temp_margintop = getdivheight() + 5;
  475. $('#listingContactWrapper').attr('data-margin-top',temp_margintop);
  476. }
  477. $(document).ready(function () {
  478. updateDivMargin();
  479. });
  480. $( window ).resize(function() {
  481. updateDivMargin();
  482. });
  483. </script>
  484. {# Google tag manager for contact the seller after submit #}
  485. {% if app.request.query.get('contact_seller') %}
  486. <script>
  487. // Google Tag Manager
  488. $(document).ready(function () {
  489. dataLayer.push({'event': 'gtm-action-seller-message'});
  490. });
  491. </script>
  492. {% endif %}
  493. {% if listing.parent is null and isSearchableListing %}
  494. <script>
  495. {% if searchableLocation is not null %}
  496. var locationId = {{location.nearestSearchable.id}};
  497. {% else %}
  498. var locationId = null;
  499. {% endif %}
  500. jQuery(document).mouseleave(function (e) {
  501. if(e.clientY < 100)
  502. {
  503. if (!locationsLocalStorage.locationExists(locationId))
  504. {
  505. $('.modal').modal('hide');
  506. $('#on-close-popup').modal('show');
  507. locationsLocalStorage.setLocationId(locationId);
  508. }else
  509. {
  510. if (locationsLocalStorage.isLocationExpired(locationId))
  511. {
  512. $('.modal').modal('hide');
  513. $('#on-close-popup').modal('show');
  514. dataLayer.push({'event': 'gtm-action-request-call-popup'});
  515. locationsLocalStorage.updateLocationExpiryDate(locationId);
  516. }
  517. }
  518. }
  519. });
  520. </script>
  521. {% endif %}
  522. {% endblock %}