templates/base.html.twig line 235

  1. {% set FLUID_CONTAINER = false %}
  2. {% set isEgyptSite = get_setting('general', 'country') == 'EG' %}
  3. {% set isKSASite = get_setting('general', 'country') == 'SA' %}
  4. {% set isEnabledKSAnewHome = isKSASite and isEnabledFeature('web.ksa.newhome') %}
  5. {% set isProduction = app.environment == 'prod' %}
  6. {% set isGoogleTagManagerDisabledTest = isEnabledFeature('web.disable.tagmanager') %}
  7. <!DOCTYPE html>
  8. <html lang="{{ app.request.locale }}" dir="{{ 'layout.direction_code'|trans }}" ng-app="moonshot">
  9. {% set isSearchResultsPage = app.request.attributes.get('_route') in ['search', 'property_type_search'] %}
  10. {% set isComoundResultsPage = app.request.attributes.get('_route') in ['compound_search', 'compound_adviser_search_results'] %}
  11. {% set isListingDetailsPage = app.request.attributes.get('_route') in ['listing_slug'] %}
  12. {% import '@AqarmapListing/Default/macros/seoVersion.twig' as seoMacro %}
  13. {% set isSeoVersion = seoMacro.seoVersion(app.request.requesturi) and isSearchResultsPage and not app.user %}
  14. {% set isLongTailPage = app.request.get('lt') %}
  15. {% set isUXVersion = not isSeoVersion %}
  16. {% set allowTagManagerDelay = isSeoVersion or isComoundResultsPage or isListingDetailsPage %}
  17. {% set hiddenParametersLanguageRoutes = ['search', 'property_type_search', 'listing_slug'] %}
  18. {% set removeParametersLanguageSwitcher = app.request.attributes.get('_route') in hiddenParametersLanguageRoutes and not isLongTailPage %}
  19. {% set adminBodyClass = is_granted("ROLE_ADMIN") ? 'is-admin' : '' %}
  20. {% set searchResultsBodyClass = isSearchResultsPage ? 'initial-font' : '' %}
  21. {% set aqarmap_exhibits_guide_url = aqarmap_advice_url ~ '/' ~ app.request.locale ~ '/events' %}
  22. {% set isUserHasActiveSubscription = app.user and app.user.getAbsoluteSubscriptionExpiryDays > 0 %}
  23. {% set appLocale = app.request.locale %}
  24. {% set isLocalArabic = appLocale == 'ar' %}
  25. <head>
  26. <meta charset="{{ _charset }}" />
  27. <title>{% block title %}{{ 'layout.brand_suffix'|trans }}{% endblock %}</title>
  28. {% set hiddenMetaDescriptionRoutes = ['compound_search'] %}
  29. {% if app.request.attributes.get('_route') not in hiddenMetaDescriptionRoutes or (app.request.attributes.get('_route') == 'listing_slug' and listing.section.searchable) %}
  30. <meta name="description" content="{% apply spaceless %}{% if block('meta_description') is defined %}
  31. {{ block('meta_description')|default('layout.homepage_description'|trans)|striptags|u.truncate(250, true, true)|replace({"\n": " ", "\r\n": " ", "\t": " ", "\n\r": " ", " ": ".."})|replace({" ": ". "})|trim('.') }}
  32. {% else %}
  33. {{ 'layout.homepage_description'|trans|striptags|u.truncate(250, true, true)|replace({"\n": " ", "\r\n": " ", "\t": " ", "\n\r": " ", " ": ".."})|replace({" ": ". "})|trim('.') }}
  34. {% endif %}
  35. {% endapply %}">
  36. {% endif %}
  37. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" >
  38. <meta http-equiv="Accept-CH" content="DPR, Width, Viewport-Width">
  39. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  40. <meta name="theme-color" content="#007dbe">
  41. <meta name="author" content="{{ 'layout.app_name'|trans }}">
  42. <meta name="apple-itunes-app" content="app-id=642633889">
  43. <meta name="google-play-app" content="app-id=com.aqarmap.android">
  44. <meta name="robots" content="noindex, follow">
  45. {% if app_domain != app.request.getHost() %}<meta name="robots" content="noindex, nofollow">{% endif %}
  46. {% block metatags %}{% endblock %}
  47. <link rel="preload" as="image" href="{{ asset('images/placeholder.svg') }}">
  48. <link rel="preload" as="image" href="{{ asset('images/logo-' ~ app.request.locale ~ '-white.svg') }}">
  49. <link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
  50. <link rel="manifest" href="{{ asset('manifest.json') }}" />
  51. {% block htmlhead %}{% endblock %}
  52. {% block categorizedStylesheets -%}
  53. <link rel="stylesheet" href="{{ asset('builds/css/build'~ (app.environment == 'dev' ? '' : '.min') ~'.css') }}" />
  54. {% endblock %}
  55. {% block favouriteHead %}
  56. {% endblock %}
  57. {% set topBar = active_announcement({topBar : true}) %}
  58. {% block headScripts %}
  59. <script>
  60. var app_data = {};
  61. app_data.locale = '{{ appLocale }}';
  62. app_data.debug = {{ (app.debug ? true : false)|serialize }};
  63. app_data.base_url = {{ url('homepage')|serialize|raw }};
  64. app_data.is_authenticated = {{ is_granted("IS_AUTHENTICATED_REMEMBERED")|serialize|raw }};
  65. app_data.messaging_api_key = "{{ firebase_api_key }}";
  66. app_data.messaging_sender_id = "{{ firebase_sender_id }}";
  67. app_data.country = "{{ get_setting('general', 'country') | lower }}";
  68. app_data.topBar = "{{ topBar is not null ? true : false }}";
  69. app_data.topBarStarts = "{{ topBar is not null ? topBar.startAt : false }}";
  70. app_data.topBarCounter = "{{ topBar is not null ? topBar.counter : false }}";
  71. app_data.environment = "{{ app.environment }}"
  72. app_data.currency = "{{ get_setting('general', 'currency')|trans }}"
  73. app_data.searchSvcUrl="{{search_service_public_endpoint}}"
  74. </script>
  75. <script type="application/ld+json">
  76. {
  77. "@context": "https://schema.org",
  78. "@type": "Organization",
  79. "logo" : "{{ app.request.locale == 'ar' ? absolute_url(asset('images/logo-ar.svg')) : absolute_url(asset('images/EnglishLogo.png')) }}",
  80. "url": "{{ app.request.getSchemeAndHttpHost() }}"
  81. }
  82. </script>
  83. {% endblock %}
  84. {% block env %}
  85. {% include "env.html.twig" %}
  86. {% endblock %}
  87. </head>
  88. <body class="{{ 'layout.direction_code'|trans }} {{ adminBodyClass }} {{ searchResultsBodyClass }}">
  89. {% if isProduction and not isGoogleTagManagerDisabledTest %}
  90. <!-- Google Tag Manager -->
  91. <script>
  92. var tagManagerSettings = '{{ get_setting('general', 'tag_manager') }}';
  93. var allowTagManagerDelay = '{{allowTagManagerDelay}}'
  94. </script>
  95. <noscript><iframe src="//www.googletagmanager.com/ns.html?id={{ get_setting('general', 'tag_manager') }}"
  96. height="0" width="0" style="display:none;visibility:hidden" loading="lazy"></iframe></noscript>
  97. <script type="application/javascript" src="{{ asset('builds/js/buildTagManager'~ (app.environment == 'dev' ? '' : '.min') ~'.js') }}"></script>
  98. <!-- End Google Tag Manager -->
  99. {% endif %}
  100. {% block googleDoubleclick %}
  101. {% if isProduction and isUXVersion %}
  102. <script src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
  103. <script>
  104. window.googletag = window.googletag || {cmd: []};
  105. googletag.cmd.push(function() {
  106. googletag.pubads().enableSingleRequest();
  107. googletag.pubads().collapseEmptyDivs();
  108. googletag.pubads().setTargeting('lang', "{{ app.request.locale }}").setTargeting('url', "{{ app.request.pathInfo }}");
  109. });
  110. {% if get_setting('general', 'country') == 'SA' %}
  111. googletag.cmd.push(function() {
  112. googletag.defineSlot('/34628225/Frontpage-KSA', [[1140, 225], [728, 144]], 'div-gpt-ad-1611048992201-0').addService(googletag.pubads());
  113. googletag.enableServices();
  114. });
  115. {% else %}
  116. googletag.cmd.push(function() {
  117. googletag.defineSlot('/34628225/half-page', [1140, 225], 'div-gpt-ad-1588539416603-0').addService(googletag.pubads());
  118. googletag.enableServices();
  119. });
  120. {% endif %}
  121. </script>
  122. <script>
  123. window.googletag = window.googletag || {cmd: []};
  124. googletag.cmd.push(function() {
  125. googletag.pubads().enableSingleRequest();
  126. googletag.pubads().collapseEmptyDivs();
  127. googletag.pubads().setTargeting('lang', "{{ app.request.locale }}").setTargeting('url', "{{ app.request.pathInfo }}");
  128. });
  129. {% if get_setting('general', 'country') == 'SA' %}
  130. googletag.cmd.push(function() {
  131. googletag.defineSlot('/34628225/sideadksalong', [300, 600], 'div-gpt-ad-1638434718795-0').addService(googletag.pubads());
  132. googletag.enableServices();
  133. });
  134. {% else %}
  135. googletag.cmd.push(function() {
  136. googletag.defineSlot('/34628225/sideadlong', [300, 600], 'div-gpt-ad-1638434601381-0').addService(googletag.pubads());
  137. googletag.enableServices();
  138. });
  139. {% endif %}
  140. </script>
  141. <script>
  142. window.googletag = window.googletag || {cmd: []};
  143. googletag.cmd.push(function() {
  144. googletag.pubads().enableSingleRequest();
  145. googletag.pubads().collapseEmptyDivs();
  146. googletag.pubads().setTargeting('lang', "{{ app.request.locale }}").setTargeting('url', "{{ app.request.pathInfo }}");
  147. });
  148. {% if get_setting('general', 'country') == 'SA' %}
  149. googletag.cmd.push(function() {
  150. googletag.defineSlot('/34628225/feedadksa', [320, 320], 'div-gpt-ad-1611049193067-0').addService(googletag.pubads());
  151. googletag.enableServices();
  152. });
  153. {% else %}
  154. googletag.cmd.push(function() {
  155. googletag.defineSlot('/34628225/feedad', [320, 320], 'div-gpt-ad-1588541966744-0').addService(googletag.pubads());
  156. googletag.enableServices();
  157. });
  158. {% endif %}
  159. </script>
  160. {% endif %}
  161. {% endblock %}
  162. {% block searchFilters %}
  163. {% endblock %}
  164. {% block firebase %}
  165. <div id="overlay-back"></div>
  166. <div id="overlay"><div class="overlay-text">{{ 'notification_modal.info_message'|trans }} </div></div>
  167. {% endblock %}
  168. {% block vueBody %}
  169. {% include "flashes.html.twig" %}
  170. {% set vueAppName = isListingDetailsPage ? "activitiesApp" : "vueApp" %}
  171. <div id="{{vueAppName}}"
  172. data-feature-toggle="{{ featureToggle is defined ? featureToggle|json_encode : null }}"
  173. data-user="{{ app.user ? app.user.id : null }}"
  174. data-user-email="{{ app.user ? app.user.email : null }}">
  175. {% block navigation %}
  176. {% include "header.html.twig" %}
  177. {% endblock %}
  178. {% if app.request.attributes.get('_route') == 'homepage' %}
  179. {% include "hero-searchbar.html.twig" %}
  180. <section class="container-fluid">
  181. <div class="row justify-content-center">
  182. {% if isProduction %}
  183. {% if get_setting('general', 'country') == 'SA' %}
  184. <div id='div-gpt-ad-1611048992201-0' style='width: 1140px; height: 225px;'>
  185. <script type="application/javascript" v-pre defer>
  186. if (typeof googletag !== 'undefined') {
  187. googletag.cmd.push(function() { googletag.display('div-gpt-ad-1611048992201-0'); });
  188. }
  189. </script>
  190. </div>
  191. {% else %}
  192. <div id='div-gpt-ad-1588539416603-0' style='width: 1140px; height: 225px;'>
  193. <script type="application/javascript" v-pre defer>
  194. if (typeof googletag !== 'undefined') {
  195. googletag.cmd.push(function() { googletag.display('div-gpt-ad-1588539416603-0'); });
  196. }
  197. </script>
  198. </div>
  199. {% endif %}
  200. {% else %}
  201. <div class="takeover-ad" style="text-align: center; background-color: {{ get_setting('features', 'takeover_ad_color') }};">
  202. <img src="https://placehold.it/1140x225/DFDFDF/B6B6B6&text=AD%20BANNER%20(1140%20X%20225)" width="100%" alt="" />
  203. </div>
  204. {% endif %}
  205. </div>
  206. </section>
  207. {% endif %}
  208. {% block headerTop %}
  209. {% include "adsHeader.html.twig" %}
  210. {% endblock %}
  211. {% block body %}
  212. {% endblock %}
  213. {% block modals %}
  214. {% endblock %}
  215. </div>
  216. {% endblock %}
  217. {% if app.request.attributes.get('_route') not in ['compound_adviser_search_results', 'compound_adviser', 'search', 'property_type_search', 'compound_search'] %}
  218. <section class="problem">
  219. <a class="gtm-btn-report problemButton hidden-xs"
  220. href="{{ path('aqarmap_feedback_get') }}"
  221. target="_blank" rel="nofollow">
  222. <span class="fa fa-smile"></span>
  223. {{ 'problem.problem_help_btn'|trans }}
  224. </a>
  225. </section><!-- problem Section -->
  226. {% endif %}
  227. {% if app.request.attributes.get('_route') not in ['listing_slug', 'compound_adviser_search_results', 'compound_adviser', 'search', 'property_type_search', 'compound_search'] %}
  228. <div class="position-fixed mobile-problem-wrapper visible-xs">
  229. <section class="problem mobile-problem-section">
  230. <a class="gtm-btn-report mobile-problem-button position-relative"
  231. href="{{ path('aqarmap_feedback_get') }}"
  232. target="_blank" rel="nofollow">
  233. <span class="icon fa fa-question"></span>
  234. </a>
  235. </section><!-- problem Section Mobile-->
  236. </div>
  237. {% endif %}
  238. {% block footer %}
  239. {% set hiddenFooterRoutes = ['listing_initialize', 'listing_edit', 'listing_upload', 'listing_confirm_publish_credit'] %}
  240. {% if app.request.attributes.get('_route') not in hiddenFooterRoutes %}
  241. {% include "footer.v2.html.twig" %}
  242. {% endif %}
  243. {% endblock %}
  244. {% block stylesheets -%}
  245. {% if ('layout.direction_code'|trans) == 'rtl' -%}
  246. <link href="{{ asset('builds/css/bootstrap-rtl.min.css') }}" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;" />
  247. {% endif -%}
  248. {% endblock %}
  249. {% block getTranslations %}
  250. {% include "get-translations.html.twig" %}
  251. {% endblock %}
  252. <!-- Javascript categorized files -->
  253. {% block categorizedJavascripts %}
  254. <script src="{{ asset('builds/js/build'~ (app.environment == 'dev' ? '' : '.min') ~'.js') }}"></script>
  255. <script defer type="application/javascript" src="{{ asset('builds/js/buildTopSellers'~ (app.environment == 'dev' ? '' : '.min') ~'.js') }}"></script>
  256. {% if topBar is not null %}
  257. {{ encore_entry_script_tags('countdown') }}
  258. {% endif %}
  259. {% endblock %}
  260. <!-- Javascript files -->
  261. {% block javascripts %}
  262. <script src="{{ asset('js/translations/jstranslation/'~ app.request.locale ~'.js') }}" defer></script>
  263. <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  264. <!--[if lt IE 9]>
  265. <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
  266. <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
  267. <![endif]-->
  268. <script type="application/javascript">
  269. // Google Tag Manager Data Layer initialization
  270. window.dataLayer = window.dataLayer || [];
  271. // Translator initialization
  272. window.Translator = window.Translator || [];
  273. </script>
  274. {# Criteo Custom DataLayer #}
  275. {% set criteo_custom_datalayer = {'PageType': 'TransactionPage', 'email': ' '} %}
  276. {# Criteo DataLayer #}
  277. {% set criteo_datalayer = {'PageType': app.request.attributes.get('_route')} %}
  278. {% if app.request.attributes.get('_route') == 'search' or app.request.attributes.get('_route') == 'property_type_search' -%}
  279. {% set criteo_datalayer = {'PageType': 'search'} %}
  280. {% endif %}
  281. {% set criteo_datalayer = criteo_datalayer|merge({'email': ' '}) %}
  282. {% if app.request.attributes.get('_route') == 'listing_slug' %}
  283. {% set criteo_datalayer = {'PageType': 'ListingPage', 'email': ' '} %}
  284. {% set criteo_custom_datalayer = criteo_custom_datalayer|merge({'ProductTransactionProducts': [{ 'id': listing.id , 'price': '0.01' , 'quantity': '1' }]}) %}
  285. {% set criteo_datalayer = criteo_datalayer|merge({'ListingID': listing.id}) %}
  286. <script>
  287. $(document).ready(function () {
  288. dataLayer.push({{ criteo_custom_datalayer|json_encode|raw }});
  289. });
  290. </script>
  291. {% if listing.liveChildren is not empty %}
  292. {% set criteo_datalayer = criteo_datalayer|merge({'unitsIDs': listing.liveChildrenIDs}) %}
  293. {% endif -%}
  294. {% endif %}
  295. {% if app.request.attributes.get('_route') == 'search' or app.request.attributes.get('_route') == 'property_type_search' -%}
  296. {% set criteo_datalayer = criteo_datalayer|merge({'ListingIDList': resultsIDs|slice(1, 3)}) %}
  297. {% endif %}
  298. <script>
  299. $(document).ready(function () {
  300. dataLayer.push({{ criteo_datalayer|json_encode|raw }});
  301. });
  302. </script>
  303. {% endblock %}
  304. {% block fos %}
  305. {% if app.debug %}
  306. <script src="{{ path('fos_js_routing_js', {"callback": "fos.Router.setData"}) }}"></script>
  307. {% else %}
  308. <script src="{{ asset('js/fos_js_routes.js') }}"></script>
  309. <script>
  310. Routing.setPrefix("{{ app.request.locale }}__RG__");
  311. </script>
  312. {% endif %}
  313. {% endblock %}
  314. {% block extraScripts %}
  315. {% if app.request.attributes.get('_route') == 'homepage' %}
  316. <script type="application/javascript" src="{{ asset('js/priceFilters.js') }}"></script>
  317. {% endif %}
  318. {% endblock extraScripts %}
  319. {% block wootricScript %}
  320. {% if isUXVersion %}
  321. <!-- begin Wootric code -->
  322. <script>
  323. window.wootric = function(){};
  324. </script>
  325. <script type="text/javascript" src="https://cdn.wootric.com/wootric-sdk.js"></script>
  326. {% if app.user %}
  327. <script id="wootricScript" type="application/javascript" src="{{ asset('builds/js/buildWootric'~ (app.environment == 'dev' ? '' : '.min') ~'.js') }}"></script>
  328. {% else %}
  329. <script type="text/javascript">
  330. //window.wootric_survey_immediately = true; // Shows survey immediately for testing purposes. TODO: Comment out for production.
  331. window.wootricSettings = {
  332. account_token: 'NPS-8fa9e73b'
  333. };
  334. window.wootric("run");
  335. </script>
  336. {% endif %}
  337. {% else %}
  338. <script>
  339. $(document).ready(function () {
  340. {% if app.user %}
  341. dataLayer.push({
  342. 'userEmail': '{{ app.user.email }}',
  343. 'userCreatedAt': '{{ app.user.createdAt|date('U') }}',
  344. });
  345. {% endif %}
  346. });
  347. </script>
  348. {% endif %}
  349. {% endblock %}
  350. {% block facebookLogin %}
  351. {% endblock %}
  352. {% block googleLogin %}
  353. {% include "googleLogin.html.twig" %}
  354. {% endblock googleLogin %}
  355. </body>
  356. </html>