src/CoreBundle/Resources/views/DCSite/core-dc-template.html.twig line 1

Open in your IDE?
  1. <!DOCTYPE html>
  2. {% if app.request.locale in('ua') %}
  3. <html lang="uk" prefix="og: https://ogp.me/ns#">
  4. {% else %}
  5. <html lang="ru" prefix="og: https://ogp.me/ns#">
  6. {% endif %}
  7. <head>
  8.     {% block gtm %}
  9.     {% endblock gtm %}
  10.     <link rel="preload" as="style" href="{{ asset('/bundles/core/css/preloader.css') }}">
  11.     <link rel="preload" as="style"  href="{{ asset('/bundles/core/css/bootstrap_build/bootstrap.css') }}">
  12.     <link rel="stylesheet" media="print" onload="this.media='all'" as="style" href="{{ asset('/bundles/core/css/core.css') }}">
  13.     <link rel="preconnect" href="https://www.googletagmanager.com">
  14.     {% block robots %}
  15.         {% if app.environment == 'dev' %}
  16.             <meta name="robots" content="noindex, nofollow">
  17.             <meta name="google-site-verification" content="FWJj2KVU8sswZ4I7nJAffMG7Tj8xgkCr3XX-FgBmAus" />
  18.         {% elseif seoMeta.robots %}
  19.             <meta name="robots" content="{{ seoMeta.robots }}">
  20.         {% endif %}
  21.     {% endblock robots %}
  22.     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  23.     <meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no,user-scalable=0">
  24.     {% if dealer is defined %}
  25.     <link rel="alternate" type="application/rss+xml" title="{{ dealer.name }}" href="https://{{ dealer.domain }}/rss/"/>
  26.     {% endif %}
  27.     {% block head %}
  28.     {% endblock head %}
  29.     {% block ogtagStatic %}
  30.         {% include '@DcSite/Modules/og-tag.html.twig' %}
  31.     {% endblock ogtagStatic %}
  32.     {% block ogtagDynamicImage %}
  33.         {% if dealer is defined and dealer.brand is defined and dealer.brand.logo is defined  %}<meta property="og:image" content="{{ app.request.httpHost }}{{ sonata_path(dealer.brand.logo, 'reference') }}">{% else %}<meta property="og:image" content="/bundles/portal/img/front/logo.jpg" />{% endif %}
  34.     {% endblock ogtagDynamicImage %}
  35.     {% block ogtagDynamic %}
  36.     {% endblock ogtagDynamic %}
  37.     {% block canonical %}
  38.         {% if app.request.attributes.get('_route_params')['_locale'] is defined %}
  39.             {% if app.request.host != 'vidi.ua' %}
  40.                 <link rel="canonical"
  41.                       href="{{ url(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) }}"/>
  42.             {% else %}
  43.                 <link rel="canonical" href="{{ app.request.uri }}"/>
  44.             {% endif %}
  45.             {% if app.request.get('variation') %}
  46.                 {% for locale in allowed_locales %}
  47.                     <link rel="alternate" hreflang="{% if locale == 'ua' %}uk-ua{% else %}ru-ua{% endif %}"
  48.                           href="{{ absolute_url(path(app.request.attributes.get('_route'),app.request.attributes.get('_route_params')|merge({'_locale': locale, 'variation': app.request.get('variation')}))) }}"/>
  49.                 {% endfor %}
  50.                 <link rel="alternate" hreflang="x-default"
  51.                       href="{{ absolute_url(path(app.request.attributes.get('_route'),app.request.attributes.get('_route_params')|merge({'_locale': 'ua', 'variation': app.request.get('variation')}))) }}"/>
  52.             {% else %}
  53.                 {% for locale in allowed_locales %}
  54.                     <link rel="alternate" hreflang="{% if locale == 'ua' %}uk-ua{% else %}ru-ua{% endif %}"
  55.                           href="{{ absolute_url(path(app.request.attributes.get('_route'),app.request.attributes.get('_route_params')|merge({'_locale': locale}))) }}"/>
  56.                 {% endfor %}
  57.                 <link rel="alternate" hreflang="x-default"
  58.                       href="{{ absolute_url(path(app.request.attributes.get('_route'),app.request.attributes.get('_route_params')|merge({'_locale': 'ua'}))) }}"/>
  59.             {% endif %}
  60.         {% endif %}
  61.     {% endblock canonical %}
  62.     {% include '@DcSite/Modules/pixel-code.html.twig' %}
  63. </head>
  64. <body class="dealer">
  65. {% block bodyGtm %}
  66. {% endblock bodyGtm %}
  67. <div id="preloader">
  68.     <div id="fountainG">
  69.         <div id="fountainG_1" class="fountainG"></div>
  70.         <div id="fountainG_2" class="fountainG"></div>
  71.         <div id="fountainG_3" class="fountainG"></div>
  72.         <div id="fountainG_4" class="fountainG"></div>
  73.         <div id="fountainG_5" class="fountainG"></div>
  74.         <div id="fountainG_6" class="fountainG"></div>
  75.         <div id="fountainG_7" class="fountainG"></div>
  76.         <div id="fountainG_8" class="fountainG"></div>
  77.     </div>
  78. </div>
  79. {% if not app.request.host starts with 'loyalty.' %}
  80. <iframe style="display: none" src="{{ path('my_ios_cross_domain_auth') }}"></iframe>
  81. {% endif %}
  82. {% block socialPreview %}
  83. {% endblock socialPreview %}
  84. {% block body %}
  85. {% endblock body %}
  86. {% include '@My/Modules/auth.html.twig' %}
  87. {% block coreMessage %}
  88.     <div id="vidiCoreMessageWrapper"></div>
  89. {% endblock coreMessage %}
  90. {% block initJsApp %}
  91.     {% set urlResult = backLoginUrl is defined and backLoginUrl ? backLoginUrl : path('my_about_car') %}
  92.     {% if app.environment != 'dev' %}
  93.         <script src="{{ asset('bundles/core/js/core.js') }}"></script>
  94.         <script type="text/javascript">
  95.             window.app = new ViDiApp({
  96.                 version: '{{ asset_version(asset('/bundles/core/js/core.js')) }}',
  97.                 message: {
  98.                     templateUrl: '{{ path('core_message_load_template') }}',
  99.                     text: {
  100.                         btnCancel: '{{ 'app.message.cancel'|trans({},'core') }}',
  101.                     }
  102.                 },
  103.                 http: {
  104.                     requestErrorText: '{{ 'app.http.server_error'|trans({},'core') }}',
  105.                 },
  106.                 preLoader: {
  107.                     templateUrl: '{{ path('core_preloader_load_template') }}',
  108.                     preLoaderCss: '{{ asset('/bundles/core/css/preloader.css') }}',
  109.                 },
  110.                 authOptions: {
  111.                     checkUrl: '{{ absolute_url(path('my_cross_domain_auth')) }}',
  112.                     loginUrl: '{{ path('core_cross_domain_auth') }}',
  113.                 },
  114.                 leadForms: {
  115.                     captchaUrl: '{{ path('base_capthcha_init') }}',
  116.                     text: {
  117.                         successTitle: '{{ 'modules.sps_form_title'|trans({}, 'dc_base') }}',
  118.                         successText: '{{ 'modules.sps_form_subtitle'|trans({}, 'dc_base') }}',
  119.                         buttonText: '{{ 'pages.base.ok'|trans({}, 'dc_base') }}'
  120.                     },
  121.                     href: {
  122.                         buttonSuccess: null,
  123.                     },
  124.                 },
  125.                 favoriteOptions: {
  126.                     addUrl: '{{ path('portal_add_favl') }}',
  127.                     removeUrl: '{{ path('portal_remove_favl') }}',
  128.                 },
  129.                 user: {
  130.                     id: {% if app.user %}{{ app.user.id }}{% else %}false{% endif %},
  131.                     name: {% if app.user %}'{{ app.user.fullName }}'{% else %}null{% endif %},
  132.                 },
  133.                 requiredJs: [
  134.                     {
  135.                         path: '{{ asset('/bundles/core/js/jquery-2.2.4.slim.min.js') }}',
  136.                     },
  137.                     {
  138.                         path: '{{ asset('/bundles/core/js/bootstrap/popper.min.js') }}',
  139.                     },
  140.                     {
  141.                         //path: '{{ asset('/bundles/core/js/vue/vue.min.js') }}',
  142.                         path: 'https://cdn.jsdelivr.net/npm/vue/dist/vue.js',
  143.                     },
  144.                 ],
  145.                 coreJs: [
  146.                     {
  147.                         path: '{{ asset('/bundles/core/js/track.js') }}',
  148.                     },
  149.                     {
  150.                         path: '{{ asset('/bundles/core/js/message.js') }}',
  151.                         onLoadEvent: 'messageLoad',
  152.                     },
  153.                     {
  154.                         path: '{{ asset('/bundles/core/js/http.js') }}',
  155.                         onLoadEvent: 'httpLoad',
  156.                     },
  157.                     {
  158.                         path: '{{ asset('/bundles/core/js/preloader.js') }}',
  159.                         onLoadEvent: 'preLoaderLoad',
  160.                     },
  161.                     {
  162.                         path: '{{ asset('/bundles/core/js/lead-form.js') }}',
  163.                         onLoadEvent: 'leadFormsLoad',
  164.                     },
  165.                     {
  166.                         path: '{{ asset('/bundles/core/js/favorit.js') }}',
  167.                         onLoadEvent: 'favoritLoad',
  168.                     },
  169.                     {
  170.                         path: '{{ asset('/bundles/core/js/compare.js') }}',
  171.                         onLoadEvent: 'compareLoad',
  172.                     },
  173.                     {
  174.                         path: '{{ asset('/bundles/core/js/lazy-init.js') }}',
  175.                         onLoadEvent: 'lazyInitLoad',
  176.                     },
  177.                     {
  178.                         path: '{{ asset('/bundles/core/js/bootstrap/bootstrap.min.js') }}',
  179.                     },
  180.                     {
  181.                         path: '{{ asset('/bundles/core/js/mask.js') }}',
  182.                     },
  183.                 ],
  184.                 coreCss: [
  185.                     '{{ asset('/bundles/core/css/bootstrap_build/bootstrap.css') }}',
  186.                     '{{ asset('/bundles/core/css/core.css') }}',
  187.                     '{{ asset('/bundles/core/css/modules/core-modal/core-modal.css') }}',
  188.                     '{{ asset('/bundles/core/css/modules/core-modal/modal-fw.css') }}',
  189.                     '{{ asset('/bundles/core/css/lead-form.css') }}',
  190.                 ],
  191.             });
  192.             app.onCustomEvent('appInit', function () {
  193.                 app.loadJs('{{ asset('bundles/my/js/register.js') }}', function () {
  194.                     initAuthRegistration({
  195.                         locale: '{{ app.request.locale }}',
  196.                         fbAuthUrl: '{{ path('my_auth_fb_user') }}',
  197.                         googleAuthUrl: '{{ path('my_auth_google_user') }}',
  198.                         registerConfoirmUrl: '{{ path('my_register_confirm') }}',
  199.                         profileUrl: '{{ urlResult }}',
  200.                         getCodeUrl: '{{ path('my_register_get_code') }}',
  201.                         resendCodeUrl: '{{ path('my_register_resend_reg_code') }}',
  202.                         loginCodeUrl: '{{ path('core_register_code_login') }}',
  203.                         refererUrl: {{ refererUrl is defined ? refererUrl|json_encode|raw : 'null' }},
  204.                         messageRegisterSuccessTitle: '{{ 'app.message.register.success_title'|trans({},'core') }}',
  205.                         messageRegisterSuccessText: '{{ 'app.message.register.success_text'|trans({},'core') }}',
  206.                         messageLoginErrorPassword: '{{ 'app.message.login.error_password'|trans({}, 'core') }}',
  207.                         messageLoginErrorEmail: '{{ 'app.message.login.error_email'|trans({}, 'core') }}'
  208.                     });
  209.                 });
  210.                 app.loadJs('{{ asset('bundles/my/js/recovery.js') }}', function () {
  211.                     initAuthRecovery({
  212.                         locale: '{{ app.request.locale }}',
  213.                         getCodeRecoveryUrl: '{{ path('my_recovery_get_code') }}',
  214.                         recoveryConfirmCodeUrl: '{{ path('my_recovery_confirm_code') }}',
  215.                         recoverySetPasswordUrl: '{{ path('my_recovery_set_password') }}',
  216.                         messageRecoverySuccessTitle: '{{ 'app.message.recovery.success_title'|trans({}, 'core') }}',
  217.                         messageRecoverySuccessText: '{{ 'app.message.recovery.success_text'|trans({}, 'core') }}',
  218.                         messageLoginErrorPassword: '{{ 'app.message.login.error_password'|trans({}, 'core') }}',
  219.                         messageLoginErrorEmail: '{{ 'app.message.login.error_email'|trans({}, 'core') }}',
  220.                         profileUrl: '{{ path('my_about_car') }}',
  221.                     });
  222.                 });
  223.                 app.loadJs('{{ asset('bundles/my/js/change-phone.js') }}', function () {
  224.                     initAuthChangePhone({
  225.                         locale: '{{ app.request.locale }}',
  226.                         messageLoginErrorEmail: '{{ 'app.message.login.error_email'|trans({}, 'core') }}',
  227.                         getCodeChangePhoneUrl: '{{ path('my_change_phone_get_code') }}',
  228.                         setNewPhoneUrl: '{{ path('my_change_phone_set_phone') }}',
  229.                         loginCodeUrl: '{{ path('core_register_code_login') }}',
  230.                         confirmNewPhoneUrl: "{{ path('my_confirm_new_phone') }}",
  231.                         profileUrl: '{{ path('my_about_car') }}',
  232.                     });
  233.                 });
  234.             });
  235.         </script>
  236.     {% else %}
  237.         <script src="{{ asset('bundles/core/js/prod.core.js') }}"></script>
  238.         <script type="text/javascript">
  239.             window.app = new ViDiApp({
  240.                 version: '{{ asset_version(asset('/bundles/core/js/prod.core.js')) }}',
  241.                 message: {
  242.                     templateUrl: '{{ path('core_message_load_template') }}',
  243.                     text: {
  244.                         btnCancel: '{{ 'app.message.cancel'|trans({},'core') }}',
  245.                     }
  246.                 },
  247.                 http: {
  248.                     requestErrorText: '{{ 'app.http.server_error'|trans({},'core') }}',
  249.                 },
  250.                 preLoader: {
  251.                     templateUrl: '{{ path('core_preloader_load_template') }}',
  252.                     preLoaderCss: '{{ asset('/bundles/core/css/preloader.css') }}',
  253.                 },
  254.                 authOptions: {
  255.                     checkUrl: '{{ absolute_url(path('my_cross_domain_auth')) }}',
  256.                     loginUrl: '{{ path('core_cross_domain_auth') }}',
  257.                 },
  258.                 leadForms: {
  259.                     captchaUrl: '{{ path('base_capthcha_init') }}',
  260.                     text: {
  261.                         successTitle: '{{ 'modules.sps_form_title'|trans({}, 'dc_base') }}',
  262.                         successText: '{{ 'modules.sps_form_subtitle'|trans({}, 'dc_base') }}',
  263.                     },
  264.                     href: {
  265.                         buttonSuccess: null,
  266.                     },
  267.                 },
  268.                 favoriteOptions: {
  269.                     addUrl: '{{ path('portal_add_favl') }}',
  270.                     removeUrl: '{{ path('portal_remove_favl') }}',
  271.                 },
  272.                 user: {
  273.                     id: {% if app.user %}{{ app.user.id }}{% else %}false{% endif %},
  274.                     name: {% if app.user %}'{{ app.user.fullName }}'{% else %}null{% endif %},
  275.                 },
  276.                 requiredJs: [
  277.                     {
  278.                         path: '{{ asset('/bundles/core/js/prod.cor.min.js') }}',
  279.                     },
  280.                 ],
  281.                 coreCss: [
  282.                     '{{ asset('/bundles/core/css/core.prod.css') }}',
  283.                     '{{ asset('/bundles/core/css/lead-form.css') }}',
  284.                 ],
  285.             });
  286.             app.onCustomEvent('appInit', function () {
  287.                 app.loadJs('{{ asset('bundles/my/js/register.js') }}', function () {
  288.                     initAuthRegistration({
  289.                         locale: '{{ app.request.locale }}',
  290.                         fbAuthUrl: '{{ path('my_auth_fb_user') }}',
  291.                         googleAuthUrl: '{{ path('my_auth_google_user') }}',
  292.                         registerConfoirmUrl: '{{ path('my_register_confirm') }}',
  293.                         profileUrl: '{{ urlResult }}',
  294.                         getCodeUrl: '{{ path('my_register_get_code') }}',
  295.                         resendCodeUrl: '{{ path('my_register_resend_reg_code') }}',
  296.                         loginCodeUrl: '{{ path('core_register_code_login') }}',
  297.                         loginCodeUrlA: '{{ path('core_register_code_login') }}',
  298.                         refererUrl: {{ refererUrl is defined ? refererUrl|json_encode|raw : 'null' }},
  299.                         messageRegisterSuccessTitle: '{{ 'app.message.register.success_title'|trans({},'core') }}',
  300.                         messageRegisterSuccessText: '{{ 'app.message.register.success_text'|trans({},'core') }}',
  301.                         messageLoginErrorEmail: '{{ 'app.message.login.error_email'|trans({}, 'core') }}'
  302.                     });
  303.                 });
  304.                 app.loadJs('{{ asset('bundles/my/js/recovery.js') }}', function () {
  305.                     initAuthRecovery({
  306.                         locale: '{{ app.request.locale }}',
  307.                         getCodeRecoveryUrl: '{{ path('my_recovery_get_code') }}',
  308.                         recoveryConfirmCodeUrl: '{{ path('my_recovery_confirm_code') }}',
  309.                         recoverySetPasswordUrl: '{{ path('my_recovery_set_password') }}',
  310.                         messageRecoverySuccessTitle: '{{ 'app.message.recovery.success_title'|trans({}, 'core') }}',
  311.                         messageRecoverySuccessText: '{{ 'app.message.recovery.success_text'|trans({}, 'core') }}',
  312.                         messageLoginErrorPassword: '{{ 'app.message.login.error_password'|trans({}, 'core') }}',
  313.                         messageLoginErrorEmail: '{{ 'app.message.login.error_email'|trans({}, 'core') }}',
  314.                         profileUrl: '{{ path('my_about_car') }}',
  315.                     });
  316.                 });
  317.                 app.loadJs('{{ asset('bundles/my/js/change-phone.js') }}', function () {
  318.                     initAuthChangePhone({
  319.                         locale: '{{ app.request.locale }}',
  320.                         messageLoginErrorEmail: '{{ 'app.message.login.error_email'|trans({}, 'core') }}',
  321.                         getCodeChangePhoneUrl: '{{ path('my_change_phone_get_code') }}',
  322.                         setNewPhoneUrl: '{{ path('my_change_phone_set_phone') }}',
  323.                     });
  324.                 });
  325.             });
  326.         </script>
  327.     {% endif %}
  328. {% endblock initJsApp %}
  329. <script>
  330.     function isLoyaltySubdomain() {
  331.         return window.location.hostname.startsWith('loyalty.');
  332.     }
  333.     app.onCustomEvent('appInit', function () {
  334.         app.onCustomEvent('coreAuthInit', function () {
  335.             Auth.setOnLogoinCallback(function (user, token = null, url = null) {
  336.                 if (url) {
  337.                     window.location.href = url;
  338.                 } else {
  339.                     window.location.reload();
  340.                 }
  341.             });
  342.         });
  343.         window.addEventListener("message", function (e) {
  344.             if(e.data.dataType != 'crossAuth') {
  345.                 return false;
  346.             }
  347.             if (isLoyaltySubdomain() || !e.isTrusted) {
  348.                 return false;
  349.             }
  350.             // if(app.user.id && !e.data.token) {
  351.             //     $.ajax({
  352.             //         url: '/logout-user',
  353.             //         method: 'GET',
  354.             //         xhrFields: {
  355.             //             withCredentials: true
  356.             //         },
  357.             //         success: function (response) {
  358.             //             window.location.reload();
  359.             //         }
  360.             //     });
  361.             // }
  362.             if (app.user.id) {
  363.                 return false;
  364.             }
  365.             $.ajax({
  366.                 url: '{{ absolute_url(path('core_cross_domain_auth')) }}',
  367.                 method: 'POST',
  368.                 data: {token: e.data.token, rnew: 1},
  369.                 xhrFields: {
  370.                     withCredentials: true
  371.                 },
  372.                 success: function (response) {
  373.                     if (response.success) {
  374.                         window.location.reload();
  375.                     }
  376.                 }
  377.             });
  378.         });
  379.     });
  380. </script>
  381. {% block coreBottomJs %}
  382.     <script>
  383.         app.onCustomEvent('appInit', function () {
  384.             app.loadCss('{{ asset('/bundles/core/css/modules/core-modal/core-modal.css') }}');
  385.             app.loadCss('{{ asset('/bundles/core/css/modules/core-modal/modal-fw.css') }}');
  386.         });
  387.     </script>
  388. {% endblock coreBottomJs %}
  389. {% if app.user %}
  390.     <script type="text/javascript">
  391.         window.dataLayer = window.dataLayer || [];
  392.         window.dataLayer.push({'user_id': {{ app.user.id }}});
  393.     </script>
  394. {% endif %}
  395. {% if helpCrunch is defined and dealer is defined and (dealer.id != 16 and dealer.id != 27 and dealer.id != 8) %}
  396. <script type="text/javascript">
  397.     window.helpcrunchSettings = {
  398.         organization: '{{ helpCrunch['organization'] }}',
  399.         appId: '{{ helpCrunch['appId'] }}',
  400.     };
  401. </script>
  402. <script type="text/javascript">
  403.     (function(w,d){var hS=w.helpcrunchSettings;if(!hS||!hS.organization){return;}var widgetSrc='https://'+hS.organization+'.widget.helpcrunch.com/';w.HelpCrunch=function(){w.HelpCrunch.q.push(arguments)};w.HelpCrunch.q=[];function r(){if (d.querySelector('script[src="' + widgetSrc + '"')) { return; }var s=d.createElement('script');s.async=1;s.type='text/javascript';s.src=widgetSrc;(d.body||d.head).appendChild(s);}if(d.readyState === 'complete'||hS.loadImmediately){r();} else if(w.attachEvent){w.attachEvent('onload',r)}else{w.addEventListener('load',r,false)}})(window, document)
  404. </script>
  405. {% endif %}
  406. </body>
  407. </html>