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

Open in your IDE?
  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.     {% if isEnabledFeature('web.chat.app') or isEnabledActivityListingPage %}
  209.         {{ encore_entry_link_tags('activitiesApp') }}
  210.     {% endif %}
  211.     {% if IS_PROJECT_PARENT %}
  212.         <link rel="stylesheet" href="{{ asset('builds/css/projectDetailsBuild'~ (app.environment == 'dev' ? '' : '.min') ~'.css') }}" />
  213.     {% else %}
  214.         <link rel="stylesheet" href="{{ asset('builds/css/listingDetailsBuild'~ (app.environment == 'dev' ? '' : '.min') ~'.css') }}" />
  215.     {% endif %}
  216. {% endblock %}
  217. {% block headerTop %}
  218. {% endblock %}
  219. {% set CTA_block = "" %}
  220. {% block body %}
  221.     {% set markupType = "SingleFamilyResidence" %}
  222.     {% set STATUS_LIVE_CONSTANT = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingStatus::LIVE') %}
  223.     {% set PHOTO_MAIN_CONSTANT = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\PhotoTypes::MAIN_PHOTO') %}
  224.     {% set STATUS_PENDING_CONSTANT = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingStatus::PENDING') %}
  225.     {% set STATUS_USER_DELETED_CONSTANT = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingStatus::USER_DELETED') %}
  226.     {% set PREMIUM_LISTING = not isSearchableListing %}
  227.     {% if PREMIUM_LISTING %} {% set markupType = "GatedResidenceCommunity" %} {% endif %}
  228.     {% if not isSearchableListing or (listing.parent and not listing.parent.section.searchable) %}
  229.         {% set LEAD_LISTING = true %}
  230.     {% else %}
  231.         {% set LEAD_LISTING = false %}
  232.     {% endif %}
  233.     {% set STATUS_EXPIRED_CONSTANT = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingStatus::USER_DELETED') %}
  234.     {% set LISTING_CATEGORIES_SCRAPPED = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingCategories::SCRAPPED') %}
  235.     {% set topCompaniesEnabled = not get_setting('features', 'top_companies') %}
  236.     {% set currentUser = app.user %}
  237.     {% set currentUserEmail = currentUser ? currentUser.email : '' %}
  238.     {% if isListingHasChildren %}
  239.             {% set sharingEvent = "compound-details" %}
  240.         {% else %}
  241.             {% set sharingEvent = "listing-details" %}
  242.     {% endif %}
  243. {% set showTopSellersModal = topSearchableCompaniesCount and searchableLocation is not null %}
  244. {% set showRegisterSurvey = isEnabledFeature('web.registration.survey')  %}
  245. {% set country = get_setting('general', 'country') | lower %}
  246. {% set sellerName = '' %}
  247. {% set listingUser = listing.user %}
  248. {% set sellerName =  listingUser.fullName %}
  249. {% set userLogo = listingUser.logo ? listingUser.logo.file : null %}
  250. {% set logo = listing.validUserLogo %}
  251. {% set sellerLogo = logo ? logo : userLogo %}
  252. {% set sellerUrl = path('aqarmap_user_listings', {'id': listingUser.id})%}
  253. {% set joinedData = listingUser.createdAt|date('Y')%}
  254. {% set listingMainPhoto = '#' %}
  255. {% if listing.mainPhoto %}
  256.     {% set listingMainPhoto = custom_vich_uploader_asset(listing.mainPhoto.file, 'file') | thumbnail('search-thumb') %}
  257. {% endif %}
  258. {% set listing_attributes = listing.getAttributesList() %}
  259. {% set listing_floor = (listing_attributes["floor"]) is defined ? getFloorLabel(listing_attributes["floor"])|trans : '' %}
  260. {% set listing_year_built = (listing_attributes["year-built"]) is defined ? listing_attributes["year-built"] : '' %}
  261. {% set listing_baths = (listing_attributes["baths"]) is defined ? getRoomsLabel(listing_attributes["baths"]) : '' %}
  262. {% set listing_rooms = (listing_attributes["rooms"]) is defined ? getRoomsLabel(listing_attributes["rooms"]) : '' %}
  263. {% set listing_finish_type = (listing_attributes["finish-type"]) is defined ? listing_attributes["finish-type"] : '' %}
  264. {% set topSellerTrigger = 'gtm-action-topsellers-lead-listing-details' %}
  265. {% set topSellerEventAction = 'ListingDetails' %}
  266. {% set listingHasPhotos = listing.photosForSlider|length > 0 %}
  267. {% set ABtestingClasses = "listing-details-ab-testing-master virtical-related-listing virtical-related-listing_option-1" %}
  268. {% set encodedSellerPhones = []%}
  269. {% for phone in listingPhones %}
  270.         {% set encodedSellerPhones = encodedSellerPhones | merge([{'number': phone.number|phoneNumberEncode}]) %}
  271. {% endfor %}
  272. {% set listingLabelType = listing.label %}
  273. {% set isListingTopPicks = listing.isTopPicks %}
  274. {% set allowListingLabel = listingLabelType and not isListingTopPicks and not IS_PROJECT_PARENT %}
  275. {% set isTopFavourited = listingLabelType == TOP_FAVOURITAED_CONST %}
  276. {% set isValidPrice = listingLabelType == VALID_PRICE_CONST %}
  277. {% set isTopViewed = listingLabelType == TOP_VIEWED_CONST %}
  278. {% set listingLabelUrl = path('search' , {'section_slug' : section.slug, 'property_type_slug' : propertyType.slug, 'location_slug': location.slug }|merge({'label': listingLabelType}))%}
  279. {% set enableSearchInListingDetails = not IS_PROJECT_PARENT and not isEnabledFeature('web.search.full.filters') %}
  280. {% set showRelatedListing = relatedListingsCount and isSearchableListing and not IS_PROJECT_PARENT %}
  281. {% set showOtherUnits = isEnabledFeature('web.other.units.details.page') and otherUnits|length > 0 %}
  282. {# Testing listings #}
  283. {% set testingListingsIds = [3747940, 3813089, 3626475, 2705901] %}
  284. {% set isTestingListing = listing.id in testingListingsIds %}
  285. {% set isListingSliderDisabledTest = isTestingListing and isEnabledFeature('web.disable.listingslider') %}
  286. {% set isTopSellersDisabledTest = isTestingListing and isEnabledFeature('web.disable.topsellers') %}
  287. {% set isRelatedListingsDisabledTest = isTestingListing and isEnabledFeature('web.disable.relatedlistings') %}
  288. {% set isGoogleDoubleClickDisabledTest = isTestingListing and isEnabledFeature('web.disable.googledoubleclick') %}
  289. {% set isEnabledActivityDisabledTest = isTestingListing and isEnabledFeature('web.disable.activities.test') %}
  290. {% set isEnabledActivityListingPage = isEnabledActivityListingPage and not isEnabledActivityDisabledTest %}
  291. {% set relatedListing %}
  292.     <div class="row">
  293.         {% 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'} %}
  294.     </div>
  295. {% endset %}
  296. <div class="listing-quick-lead" ng-controller="quickLeadController">
  297.     <div ng-content-loaded callback='setSourceRoute("{{ app.request.attributes.get('_route') }}");
  298.             setListingDetail("{{listing.id}}",{
  299.                 "id": "{{listing.id}}",
  300.                 "section": "{{section.id}}",
  301.                 "sectionTitle": {{section.title|serialize()}},
  302.                 "isProjectParent": "{{IS_PROJECT_PARENT}}" ,
  303.                 "sellerPhones": {{encodedSellerPhones|serialize('json')}},
  304.                 "sellerPhone": "{{listingPhone.number|phoneNumberEncode}}",
  305.                 "financeUrl":"{{listing.getFinancialAidURL()}}",
  306.                 "userEmail": {{currentUserEmail|json_encode()}},
  307.                 "financeFeatureValue": "{{financeFeatureValue}}",
  308.                 "listingName" : {{listing.customSlug|default(listing.id)|serialize()}},
  309.                 "listingTitle" : {{listing.title|serialize()}},
  310.                 "location": "{{location.id}}",
  311.                 "locationTitle": {{location.title|serialize()}},
  312.                 "propertyType": "{{propertyType.id}}",
  313.                 "propertyTypeTitle": {{propertyType.title|serialize()}},
  314.                 "price": "{{listing.price}}",
  315.                 "currency": "{{ get_setting('general', 'currency')|trans }}",
  316.                 "area": "{{listing.area}}",
  317.                 "isCompound": "{{IS_PROJECT_PARENT}}",
  318.                 "image": "{{ listingMainPhoto }}",
  319.                 "paymentMethodLabel": {{ listing.paymentMethodLabel|trans|serialize() }},
  320.                 "pricePerMeter": "{{listing.calculatePricePerMeter }}",
  321.                 "sellerRole": {{listing.sellerRoleLabel|trans|serialize()}},
  322.                 "floor": "{{  listing_floor }}",
  323.                 "baths": "{{  listing_baths }}",
  324.                 "rooms": "{{  listing_rooms }}",
  325.                 "yearBuilt": "{{  listing_year_built }}",
  326.                 "finishType": "{{  listing_finish_type }}",
  327.                 "publishDate": "{{  listing.publishedAt|date('Y-m-d h:i:s A') }}",
  328.                 "view": {{ listing.propertyViewLabel|trans|serialize() }},
  329.                 "listingUser": {
  330.                     "sellerName" : {{sellerName|serialize()}},
  331.                     "sellerLogo": "",
  332.                     "sellerUrl": "{{sellerUrl}}",
  333.                     "joinedData":"{{joinedData}}",
  334.                     "activeListingsCount": "{{activeListingsCount}}",
  335.                     "leadsCount":"{{leadsCount}}"
  336.                 },
  337.                 "description": {{ listing.description|serialize() }},
  338.             });'>
  339.         {% if enableSearchInListingDetails %}
  340.             {% include "@AqarmapListing/ListingSearch/searchFormFilter.html.twig" %}
  341.         {% endif %}
  342.         <div class="container listingContainer listing_details_container {{ relatedListingsCount and isSearchableListing ? 'has-related-listing' : ''}} {% if isEnabledFeature('web.header.cta') %}overflow-hidden{% endif %}">
  343.             <div class="row">
  344.                 {% include '@AqarmapListingBundle/Listing/listingNav.html.twig' %}
  345.                 <section
  346.                     class="col-md-12 listing-details {{ ABtestingClasses }}"
  347.                     data-sticky-container
  348.                     itemscope
  349.                     itemtype="https://schema.org/{{ markupType }}"
  350.                     >
  351.                     <div class="listing-slider-container padding-lg-zero padding-md-zero" >
  352.                         {% if listingHasPhotos %}
  353.                             <div class="slider-wrapper section-wrapper">
  354.                                 {% include '@AqarmapListingBundle/Listing/listingSlider.html.twig' %}
  355.                             </div>
  356.                         {% endif %}
  357.                         {% include '@AqarmapListingBundle/Listing/listingContactWrapper.html.twig' %}
  358.                     </div>
  359.                     <div class="listing-details-container padding-md-zero">
  360.                         {% include '@AqarmapListingBundle/Listing/listingLabel.html.twig' %}
  361.                         {% if IS_PROJECT_PARENT %}
  362.                             {% include '@AqarmapListingBundle/Listing/projectDetailsTitle.html.twig' %}
  363.                         {% else %}
  364.                             {% include '@AqarmapListingBundle/Listing/listingTitle.html.twig' %}
  365.                         {% endif %}
  366.                     </div>
  367.                     <div class="listing-details-container padding-md-zero">
  368.                         {% include '@AqarmapListingBundle/Listing/listingUnitsTabs.html.twig' %}
  369.                         {% if showListingDetails %}
  370.                             {% include "@AqarmapListingBundle/Listing/listingDetailsList.html.twig" %}
  371.                         {% endif %}
  372.                         {% include "@AqarmapListingBundle/Listing/listingDescription.html.twig" %}
  373.                         {% include "@AqarmapListingBundle/Listing/listingMap.html.twig" %}
  374.                         {% include "@AqarmapListingBundle/Listing/listingSellerInfo.html.twig" %}
  375.                         {% if not isTopSellersDisabledTest %}
  376.                             {% include "@AqarmapListingBundle/Listing/listingTopSellers.html.twig" %}
  377.                         {% endif %}
  378.                         {% if IS_PROJECT %}
  379.                             {% include "@AqarmapListingBundle/Listing/compoundRating.html.twig" %}
  380.                         {% endif %}
  381.                         {% include '@AqarmapListingBundle/Listing/otherUnitsTable.html.twig' %}
  382.                         {% if not isRelatedListingsDisabledTest %}
  383.                             {% if showRelatedListing %}
  384.                                 <div class="listing-details-item card-container card-container_option-2">
  385.                                     {% include '@AqarmapListingBundle/Listing/listingRelatedListingSection.html.twig' %}
  386.                                 </div>
  387.                             {% endif %}
  388.                         {% endif %}
  389.                         {% include '@AqarmapListingBundle/Listing/listingNeighborhoodsSection.html.twig' %}
  390.                         {% include '@AqarmapListingBundle/Listing/listingDiscussionsSection.html.twig' %}
  391.                         {% include '@AqarmapListingBundle/Listing/listingFooter.html.twig' %}
  392.                     </div>
  393.                 </section>
  394.                 {% include '@AqarmapListingBundle/Listing/projectFaqs.html.twig' %}
  395.             </div>
  396.         </div>
  397.         {% if not isSearchableListing and not IS_PROJECT_PARENT %}
  398.             {% set section = section %}
  399.             <div class="container">
  400.                 <div class="compounds_quick_links">
  401.                     {% include "@AqarmapListing/CompoundSearch/compoundsSubLinks.html.twig" %}
  402.                 </div>
  403.             </div>
  404.         {% endif %}
  405.         {# Google double click ads #}
  406.         {% if not isGoogleDoubleClickDisabledTest %}
  407.             {% include "adsHeader.html.twig" %}
  408.         {% endif %}
  409.         {# Modals container #}
  410.         {% if not isRelatedListingsDisabledTest %}
  411.             {% if showRelatedListing %}
  412.                 {% include '@AqarmapListingBundle/Listing/OnCloseListingPopup.html.twig' %}
  413.             {% endif %}
  414.         {% endif %}
  415.         {% include '@AqarmapListingBundle/Listing/listingModalsContainer.html.twig' %}
  416.     </div>
  417. </div>
  418. {% include '@AqarmapListingBundle/Listing/listingBreadcrumb.html.twig' %}
  419. {% endblock %}
  420. {% block footer %}
  421.     {% include "footer.v2.html.twig" %}
  422. {% endblock %}
  423. {% block facebookLogin %}
  424.     {% if isEnabledFeature('web.enable.quicklogin') %}
  425.         {{ parent() }}
  426.     {% endif %}
  427. {% endblock %}
  428. {% block categorizedJavascripts %}
  429.     <script type="application/javascript" src="{{ asset('builds/js/buildListingDetailsCritical'~ (app.environment == 'dev' ? '' : '.min') ~'.js') }}"></script>
  430.     <script defer type="application/javascript" src="{{ asset('builds/js/buildListingDetailsMainVendors'~ (app.environment == 'dev' ? '' : '.min') ~'.js') }}"></script>
  431.     <script defer type="application/javascript" src="{{ asset('builds/js/buildListingDetailsExtraVendors'~ (app.environment == 'dev' ? '' : '.min') ~'.js') }}"></script>
  432.     {% if isEnabledCompoundBuild %}
  433.         <script defer src="{{ asset('builds/js/compound.desktop.buildListingDetails'~ (app.environment == 'dev' ? '' : '.min') ~'.js') }}"></script>
  434.     {% else %}
  435.         <script defer src="{{ asset('builds/js/buildListingDetails'~ (app.environment == 'dev' ? '' : '.min') ~'.js') }}"></script>
  436.     {% endif %}
  437.     <script defer type="application/javascript" src="{{ asset('builds/js/buildTopSellers'~ (app.environment == 'dev' ? '' : '.min') ~'.js') }}"></script>
  438.     {% if isEnabledActivityListingPage %}
  439.         {% if isEnabledLazyloadingActivitiesBuild %}
  440.             {% for file in encore_entry_js_files('activitiesApp') %}
  441.                 <script async type='application/javascript' src='{{ asset(file) }}'></script>
  442.             {% endfor %}
  443.         {% else %}
  444.             {{ encore_entry_script_tags('activitiesApp', attributes={defer: false}) }}
  445.         {% endif %}
  446.     {% endif %}
  447.     {% if topBar is defined and  not null %}
  448.         {{ encore_entry_script_tags('countdown') }}
  449.     {% endif %}
  450. {% endblock %}
  451. {% block javascripts %}
  452.     <script src="//maps.google.com/maps/api/js?v=3.25&amp;key={{ google_maps_key }}"></script>
  453.     {{ parent() }}
  454.     <script>
  455.         $(document).ready(function () {
  456.             imageSlider.lunchSlider({% if isLocalArabic %}true{% else %}false{% endif %}, false);
  457.         });
  458.     </script>
  459.     <script>
  460.         $(document).ready(function () {
  461.             dataLayer.push({
  462.                 'listingName': '{{ listing.customSlug|default(listing.id) }}',
  463.                 'listingParentName': {% if listing.parent %}'{{ listing.parent.customSlug|default(listing.parent.id) }}'{% else %}null{% endif %},
  464.                 'listingSection': '{{ leadAnalytics.listingSection|default('') }}',
  465.                 'listingSegment': '{{ leadAnalytics.listingSegment|default('') }}',
  466.                 'hasParent': {{ listing.parent ? 'true' : 'false' }},
  467.                 'hasChildren': {{ listing.isProject ? 'true' : 'false' }},
  468.                 'isFeatured': {{ listing.featured ? 'true' : 'false' }}
  469.             });
  470.         });
  471.     </script>
  472.     <script>
  473.         function getdivheight(){
  474.             return $('#listing-title-container').height() > 0 ? $('#listing-title-container').height() : 100;
  475.         }
  476.         function updateDivMargin(){
  477.             //add 5 pix to height
  478.             var temp_margintop = getdivheight() + 5;
  479.             $('#listingContactWrapper').attr('data-margin-top',temp_margintop);
  480.         }
  481.         $(document).ready(function () {
  482.             updateDivMargin();
  483.         });
  484.         $( window ).resize(function() {
  485.             updateDivMargin();
  486.         });
  487.     </script>
  488.     {# Google tag manager for contact the seller after submit #}
  489.     {% if app.request.query.get('contact_seller') %}
  490.         <script>
  491.             // Google Tag Manager
  492.             $(document).ready(function () {
  493.                 dataLayer.push({'event': 'gtm-action-seller-message'});
  494.             });
  495.         </script>
  496.     {% endif %}
  497.     {% if listing.parent is null and isSearchableListing %}
  498.     <script>
  499.         {% if searchableLocation is not null %}
  500.         var locationId = {{location.nearestSearchable.id}};
  501.         {% else %}
  502.         var locationId = null;
  503.         {% endif %}
  504.         jQuery(document).mouseleave(function (e) {
  505.         if(e.clientY < 100)
  506.         {
  507.             if (!locationsLocalStorage.locationExists(locationId))
  508.             {
  509.                 $('.modal').modal('hide');
  510.                 $('#on-close-popup').modal('show');
  511.                 locationsLocalStorage.setLocationId(locationId);
  512.             }else
  513.             {
  514.                 if (locationsLocalStorage.isLocationExpired(locationId))
  515.                 {
  516.                     $('.modal').modal('hide');
  517.                     $('#on-close-popup').modal('show');
  518.                     dataLayer.push({'event': 'gtm-action-request-call-popup'});
  519.                     locationsLocalStorage.updateLocationExpiryDate(locationId);
  520.                 }
  521.             }
  522.         }
  523.         });
  524.     </script>
  525.     {% endif %}
  526. {% endblock %}