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