templates/base.html.twig line 58

Open in your IDE?
  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="{% spaceless %}{% if block('meta_description') is defined %}
  31.                 {{ block('meta_description')|default('layout.homepage_description'|trans)|striptags|truncate(250, true, null)|replace({"\n": " ", "\r\n": " ", "\t": " ", "\n\r": " ", "  ": ".."})|replace({"  ": ". "})|trim('.') }}
  32.             {% else %}
  33.                 {{ 'layout.homepage_description'|trans|striptags|truncate(250, true, null)|replace({"\n": " ", "\r\n": " ", "\t": " ", "\n\r": " ", "  ": ".."})|replace({"  ": ". "})|trim('.') }}
  34.             {% endif %}
  35.         {% endspaceless %}">
  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.             {% include "authModal.html.twig" %}
  215.         {% endblock %}
  216.     </div>
  217. {% endblock %}
  218. {% if app.request.attributes.get('_route') not in ['compound_adviser_search_results', 'compound_adviser', 'search', 'property_type_search', 'compound_search'] %}
  219.     <section class="problem">
  220.         <a class="gtm-btn-report problemButton hidden-xs"
  221.            href="{{ path('aqarmap_feedback_get') }}"
  222.            target="_blank" rel="nofollow">
  223.             <span class="fa fa-smile"></span>
  224.             {{ 'problem.problem_help_btn'|trans }}
  225.         </a>
  226.     </section><!-- problem Section -->
  227. {% endif %}
  228. {% if app.request.attributes.get('_route') not in ['listing_slug', 'compound_adviser_search_results', 'compound_adviser', 'search', 'property_type_search', 'compound_search'] %}
  229. <div class="position-fixed mobile-problem-wrapper visible-xs">
  230.     <section class="problem mobile-problem-section">
  231.         <a class="gtm-btn-report mobile-problem-button position-relative"
  232.         href="{{ path('aqarmap_feedback_get') }}"
  233.         target="_blank" rel="nofollow">
  234.             <span class="icon fa fa-question"></span>
  235.         </a>
  236.     </section><!-- problem Section Mobile-->
  237. </div>
  238. {% endif %}
  239. {% block footer %}
  240.     {% set hiddenFooterRoutes = ['listing_initialize', 'listing_edit', 'listing_upload', 'listing_confirm_publish_credit'] %}
  241.     {% if app.request.attributes.get('_route') not in hiddenFooterRoutes %}
  242.         {% include "footer.v2.html.twig" %}
  243.     {% endif %}
  244. {% endblock %}
  245. {% block stylesheets -%}
  246.     {% if  ('layout.direction_code'|trans) == 'rtl' -%}
  247.         <link href="{{ asset('builds/css/bootstrap-rtl.min.css') }}" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;" />
  248.     {% endif -%}
  249.  {% endblock %}
  250. {% block getTranslations %}
  251.     {% include "get-translations.html.twig" %}
  252. {% endblock %}
  253. <!-- Javascript categorized files -->
  254. {% block categorizedJavascripts %}
  255.     <script src="{{ asset('builds/js/build'~ (app.environment == 'dev' ? '' : '.min') ~'.js') }}"></script>
  256.     <script defer type="application/javascript" src="{{ asset('builds/js/buildTopSellers'~ (app.environment == 'dev' ? '' : '.min') ~'.js') }}"></script>
  257.     {% if topBar is not null %}
  258.         {{ encore_entry_script_tags('countdown') }}
  259.     {% endif %}
  260. {% endblock %}
  261. <!-- Javascript files -->
  262. {% block javascripts %}
  263.     <script src="{{ asset('js/translations/jstranslation/'~ app.request.locale ~'.js') }}" defer></script>
  264.     <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  265.     <!--[if lt IE 9]>
  266.     <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
  267.     <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
  268.     <![endif]-->
  269.     <script type="application/javascript">
  270.         // Google Tag Manager Data Layer initialization
  271.         window.dataLayer = window.dataLayer || [];
  272.         // Translator initialization
  273.         window.Translator = window.Translator || [];
  274.     </script>
  275.     {# Criteo Custom DataLayer #}
  276.     {% set criteo_custom_datalayer = {'PageType': 'TransactionPage', 'email': ' '} %}
  277.     {# Criteo DataLayer #}
  278.     {% set criteo_datalayer = {'PageType': app.request.attributes.get('_route')} %}
  279.     {% if app.request.attributes.get('_route') == 'search' or app.request.attributes.get('_route') == 'property_type_search' -%}
  280.         {% set criteo_datalayer = {'PageType': 'search'} %}
  281.     {% endif %}
  282.     {% set criteo_datalayer = criteo_datalayer|merge({'email': ' '}) %}
  283.     {% if app.request.attributes.get('_route') == 'listing_slug' %}
  284.         {% set criteo_datalayer = {'PageType': 'ListingPage', 'email': ' '} %}
  285.         {% set criteo_custom_datalayer = criteo_custom_datalayer|merge({'ProductTransactionProducts': [{ 'id': listing.id , 'price': '0.01' , 'quantity': '1' }]}) %}
  286.         {% set criteo_datalayer = criteo_datalayer|merge({'ListingID': listing.id}) %}
  287.     <script>
  288.         $(document).ready(function () {
  289.             dataLayer.push({{ criteo_custom_datalayer|json_encode|raw }});
  290.         });
  291.     </script>
  292.     {% if listing.liveChildren is not empty %}
  293.             {% set criteo_datalayer = criteo_datalayer|merge({'unitsIDs': listing.liveChildrenIDs}) %}
  294.         {% endif -%}
  295.     {% endif %}
  296.     {% if app.request.attributes.get('_route') == 'search' or app.request.attributes.get('_route') == 'property_type_search' -%}
  297.         {% set criteo_datalayer = criteo_datalayer|merge({'ListingIDList': resultsIDs|slice(1, 3)}) %}
  298.     {% endif %}
  299.     <script>
  300.         $(document).ready(function () {
  301.             dataLayer.push({{ criteo_datalayer|json_encode|raw }});
  302.         });
  303.     </script>
  304. {% endblock %}
  305. {% block fos %}
  306.     {% if app.debug %}
  307.         <script src="{{ path('fos_js_routing_js', {"callback": "fos.Router.setData"}) }}"></script>
  308.     {% else %}
  309.         <script src="{{ asset('js/fos_js_routes.js') }}"></script>
  310.         <script>
  311.             Routing.setPrefix("{{ app.request.locale }}__RG__");
  312.         </script>
  313.     {% endif %}
  314. {% endblock %}
  315. {% block extraScripts %}
  316.     {% if app.request.attributes.get('_route') == 'homepage' %}
  317.                 <script type="application/javascript" src="{{ asset('js/priceFilters.js') }}"></script>
  318.     {% endif %}
  319. {% endblock extraScripts %}
  320. {% block wootricScript %}
  321.     {% if isUXVersion %}
  322.         <!-- begin Wootric code -->
  323.         <script>
  324.             window.wootric = function(){};
  325.         </script>
  326.         <script type="text/javascript" src="https://cdn.wootric.com/wootric-sdk.js"></script>
  327.         {% if app.user %}
  328.             <script id="wootricScript"  type="application/javascript" src="{{ asset('builds/js/buildWootric'~ (app.environment == 'dev' ? '' : '.min') ~'.js') }}"></script>
  329.         {% else %}
  330.             <script type="text/javascript">
  331.                 //window.wootric_survey_immediately = true; // Shows survey immediately for testing purposes. TODO: Comment out for production.
  332.                 window.wootricSettings = {
  333.                     account_token:  'NPS-8fa9e73b'
  334.                 };
  335.                  window.wootric("run");
  336.             </script>
  337.         {% endif %}
  338.     {% else %}
  339.         <script>
  340.             $(document).ready(function () {
  341.                 {% if app.user %}
  342.                     dataLayer.push({
  343.                         'userEmail': '{{ app.user.email }}',
  344.                         'userCreatedAt': '{{ app.user.createdAt|date('U') }}',
  345.                     });
  346.                 {% endif %}
  347.             });
  348.         </script>
  349.     {% endif %}
  350. {% endblock %}
  351. {% block facebookLogin %}
  352. {% endblock %}
  353. {% block googleLogin %}
  354.     {% include "googleLogin.html.twig" %}
  355. {% endblock googleLogin %}
  356. </body>
  357. </html>