src/WebBundle/Resources/views/layout.html.twig line 1

Open in your IDE?
  1. {% compress %}
  2. <!DOCTYPE html>
  3. <html id="html-ai8Y8J31" lang="{{ userLocale() }}"
  4.       data-locale="{{ te.request.get('_locale') }}"
  5.       data-ga="{{ userGA() }}"
  6.       data-debug="{{ te.request.get('d') or app.debug ? 1 : 0 }}"
  7.       data-currency="{{ userCurrency() }}"
  8.       data-measure="{{ userMeasure() }}"
  9.       data-env="TE"
  10.       data-logged="{{ isLogged() ? 1 : 0 }}"
  11.       {#data-initial-unread-count="{{ getUnreadCount() }}"#}
  12.       data-jwt="{{ getJwt() }}"
  13.       data-user_channel="{{ getUserChannel() }}"
  14.       data-centrifugo_connection_url="{{ centrifugoConnectionUrl }}"
  15.       data-token="{{ token }}"
  16.       data-cons-online-attribute-url="{{ url('get_cons_online_attribute') }}"
  17.       data-tokenCF="{{ csrf_token(token ~ (date('now') | date('Y-m-d H'))) }}"
  18.       data-auth-info="{{ app.session.remove('successAuth') }}"
  19. >
  20. <head>
  21.     {% if not te.checkIsDev and googleRemarketing is defined and googleRemarketing %}
  22.         <script>
  23.             window.dataLayer = window.dataLayer || [];
  24.             function gtag(){dataLayer.push(arguments);}
  25.             gtag('consent', 'default', {
  26.                 'ad_storage': 'denied',
  27.                 'analytics_storage': 'denied',
  28.                 'ad_user_data': 'denied',
  29.                 'ad_personalization': 'denied'
  30.             });
  31.             setTimeout(function() {
  32.                 gtag('consent', 'update', {
  33.                     'ad_storage': 'granted',
  34.                     'analytics_storage': 'granted',
  35.                     'ad_user_data': 'granted',
  36.                     'ad_personalization': 'granted'
  37.                 });
  38.             }, 2000);
  39.         </script>
  40.         <!-- Google Tag Manager -->
  41.         <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
  42.         new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
  43.         j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
  44.         'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
  45.         })(window,document,'script','dataLayer','GTM-WCNQMZ8');</script>
  46.         <!-- End Google Tag Manager -->
  47.         {% block extraGoogleTagScript %}{% endblock %}
  48.     {% else %}
  49.         <meta name="checkIsDev" content="{{ te.checkIsDev }}" />
  50.         <meta name="googleRemarketing" content="{{ googleRemarketing is defined ? googleRemarketing : '-' }}" />
  51.     {% endif %}
  52.     {% block beforeTGM %}{% endblock %}
  53.     {% set curRoute = '' %}
  54.     {% if te.request.get('_route') is defined and te.request.get('_route') %}
  55.         {% set curRoute = te.request.get('_route') %}
  56.     {% endif %}
  57.        {% set isCollectionPageOrSlideShow = curRoute in ['app_collection', 'app_collection_slideshow', 'app_collection_slideshow_f'] %}
  58.     {% include '@Web/base-meta-header.html.twig' %}
  59.     {# CSFR токен для проверки AJAX запросов #}
  60.     <meta content="authenticity_token" name="csrf-param" />
  61.     <meta content="{{ csrf_token }}" name="csrf-token" />
  62.     {# мета-тег, запрещающий устройствам работающим на iOS (iPhone / IPod / IPad) и Android делать из номеров ссылки #}
  63.     <meta name="format-detection" content="telephone=no" />
  64.     {% block meta %}
  65.     {% endblock %}
  66.     {# оптимизация дублей страниц для поисковиков #}
  67.     {% set baseLinkRel = te.request.getSchemeAndHttpHost() %}
  68.     {% if curRoute != '' %}
  69.         {% set routeLinkRel = path(curRoute, te.request.get('_route_params')) %}
  70.         {# @TODO: уточнить, т.к. routeLinkRel используется и для Google Analytics (@Web/google.html.twig), и в строке 23 #}
  71.         {# после перехода на гугл таг, routeLinkRel - не будет использоваться ! #}
  72.         {% set routeLinkRel = routeLinkRel | split('/') | slice(2) | join('/') %}
  73.     {% else %}
  74.         {% set routeLinkRel = '#' %}
  75.     {% endif %}
  76.     {% if te.request.get('v') != null %}
  77.         <meta name="robots" content="noindex, nofollow" />
  78.     {% endif %}
  79.     {#% if te.request.get('gclid') != null %}
  80.         больше не используем, потому что негативно влияет на языковое распределение
  81.         <link rel="canonical" href="{{ baseLinkRel ~ routeLinkRel }}" />
  82.     {% endif %#}
  83.     {% if not(noSEOLink is defined) and curRoute != '' and userCountry() != 'ru' %}
  84.         {# Важный блок для гугл #}
  85.         {% if curRoute != '' and te.request.get('_route_params') is defined %}
  86.             {{ te.SEOLink(curRoute, te.request.get('_route_params'), (hrefFlag is defined ? hrefFlag : null)) | raw }}
  87.         {% endif %}
  88.     {% endif %}
  89.     {#{% block canonical %}#}
  90.         {#{{ te.getCanonicalTR() | raw }}#}
  91.     {#{% endblock %}#}
  92.     <meta name="msvalidate.01" content="465EFDDEC49D260187BF1FAF4F2FEB88" />
  93.     <meta name="timestamp" content="{{ timestamp() }}" />
  94.     <title>
  95.         {% block title %}{% endblock %}
  96.     </title>
  97.     {% block stylesheets %}
  98.         {#<link href="https://fonts.googleapis.com/css?family=Lato:300,300i,400,400i,700,700i" rel="stylesheet" />#}
  99.         {# возможность подключения стилей только для планшетов или для мобильных #}
  100.         {# чем подключать отдельный файл и замедлять скорость загрузки, лучше вывести такие стили инлайново, т.к. их немного #}
  101.         {% if is_tablet() %}
  102.             {#<link rel="stylesheet" href="{{ asset('_css/tablet.min.css') }}" />#}
  103.             <style>
  104.                 .innerBoxInformer,.share-icons:hover .share-body,.swiper-container .collection-video {display: none;}
  105.                 .share-icons .share-body.shown,.swiper-container .carousel-video-item {display: block;}
  106.                 {# увеличение области тапа в ссылке на "collection also viewed" #}
  107.                 .view-with-collection .collection-viewed-with-header .total-count-viewed-with {padding: 5px;}
  108.             </style>
  109.         {% elseif is_mobile() %}
  110.             {#<link rel="stylesheet" href="{{ asset('_css/mobile.min.css') }}" />#}
  111.             <style>
  112.                 .innerBoxInformer,.share-icons:hover .share-body {display: none;}
  113.                 .share-icons .share-body.shown,.swiper-container .carousel-video-item {display: block;}
  114.                 @media screen and (max-height: 400px) {
  115.                     {# убираем блок, который необходим для предотвращения пробивки списка на десктопах при выборе языка или страны #}
  116.                     .login-locale-block .tab-block.wrap-change-location.active .pseudo-height {height: 0px;}
  117.                 }
  118.                 {# для мобильных, чтобы не было авто-зуминга при тапе на любом инпуте #}
  119.                 input,input:focus {font-size: 16px;}
  120.                 {# увеличение области тапа в ссылке на "collection also viewed" #}
  121.                 .view-with-collection .collection-viewed-with-header .total-count-viewed-with {padding: 5px;}
  122.             </style>
  123.         {% endif %}
  124.     {% endblock %}
  125.     {% include '@Web/facebookPixelCode.html.twig' %}
  126. </head>
  127. {% set bodyClass = '' %}
  128. {% if curRoute == 'app_collection' %}
  129.     {% set bodyClass = ' collection-active' %}
  130. {% endif %}
  131. {% if curRoute in ['app_collection_slideshow', 'app_collection_slideshow_f'] and is_mobile() and not is_tablet() %}
  132.     {% set bodyClass = bodyClass ~ ' slider-active' %}
  133. {% endif %}
  134. <body id="body" class="clearfix{{ bodyClass }}">
  135.     {% if googleRemarketing is defined and googleRemarketing %}
  136.     <!-- Google Tag Manager (noscript) -->
  137.     <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WCNQMZ8"
  138.     height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
  139.     <!-- End Google Tag Manager (noscript) -->
  140.     {% endif %}
  141.     <div class="data-confirm"
  142.          data-confirm-yes="{{ 'yes' | trans }}"
  143.          data-confirm-no="{{ 'no' | trans }}"
  144.          data-confirm-ok="{{ 'order.ok' | trans }}"
  145.          data-confirm-header="{{ 'buyOrder.confirm.header' | trans }}"></div>
  146.     <div class="data-confirm-sample"
  147.          {#$message, $count, array $arguments = array(), $domain = null, $locale = null#}
  148.          data-confirm-sample-title="{{ 'order.sample_is_true' | trans }}" {# заголовок в сообщении #}
  149.          {# data-confirm-yes="{{ 'order.sample_is_true_yes' | trans }}"
  150.          data-confirm-no="{{ 'order.sample_is_true_no' | trans }}" #}
  151.          data-confirm-sample-text="" {# текст уведомления #}
  152.     ></div>
  153.     <div class="data-toastmessage"
  154.          data-header-warning="{{ 'buyOrder.confirm.header' | trans }}"
  155.          data-header-error="{{ 'error' | trans }}"
  156.          data-header-success="{{ 'success' | trans }}"
  157.        ></div>
  158.     <div class="swipe-area-menu-open"></div>
  159.     {# оверлей, который появляется после вызова коллапс-меню на мобильных устройствах #}
  160.     <div class="overlay-bg"></div>
  161.     <div class="lining"></div>
  162.     {# вспомогательный блок, на который вешается свойство z-index в зависимости от ширины
  163.        экрана - необходимо для скрипта, отображающего блок boxInformer #}
  164.     <div class="set-z-index"></div>
  165.     {# если установлен атрибут data-smartphone, значит просмотр осуществляется со смартфона, #}
  166.     {# если установлен атрибут data-mobile, значит просмотр осуществляется с планшета #}
  167.     <div class="wrap-content js-wrap-content"
  168.          {% if te.checkIsDev %} data-dev="true" {% endif %}
  169.          {% if is_mobile() and not is_tablet() %}
  170.              data-smartphone="true"
  171.          {% elseif is_mobile() %}
  172.              data-mobile="true"
  173.          {% endif %}
  174.     >
  175.         {{ render_esi(controller('WebBundle\\Controller\\CommonController::topAction')) }}
  176.         {# вывел меню фильтров в отдельный блок, подключение JS тоже пришлось, чтобы не было лишних файлов #}
  177.         {% set isExhibition = blog is defined and blog.isExhibition %} {# не рендерить быстрые фильтры для выставок #}
  178.         {% block filter_menu %}
  179.             {{ te.buildLeftMenuLite(not isExhibition) | raw }}
  180.         {% endblock filter_menu %}
  181.         {# wrap-exhibition добавляется в блогах с выставками #}
  182.         <div class="wrap {% if isExhibition %}wrap-exhibition{% endif %}">
  183.             <div class="container-fluid">
  184.                 <div class="row">
  185.                     <div class="col-sm-12">
  186.                         {# main-for-catalog - чтобы изменить отступ для мобилки, main - создает много пустого пространства #}
  187.                         <div id="main" class="main fixed-width clearfix {{ curRoute == 'app_catalog' ? 'main-for-catalog' }}">
  188.                             {% for label, messages in app.flashes %}
  189.                                 {% for message in messages %}
  190.                                     <div class="flash-{{ label }}">
  191.                                         {% include '@Web/Common/notifications.html.twig' with { 'notificationType': label, 'notificationText': message } %}
  192.                                     </div>
  193.                                 {% endfor %}
  194.                             {% endfor %}
  195.                             {% block content %}
  196.                                 <div id="RightContent"></div>
  197.                             {% endblock content %}
  198.                         </div>
  199.                     </div>
  200.                 </div>
  201.             </div>
  202.         </div>
  203.         <div class="both"></div>
  204.     </div>
  205.     {% if (
  206.             curRoute != 'discuss' and
  207.             curRoute != 'app_chatb_chatbpage' and
  208.             (noFloor is defined == false or noFloor == false)
  209.     ) %}
  210.         {{ include('@Web/Common/footer.html.twig') }}
  211.     {% else %}
  212.         <footer id="footer"> </footer>
  213.     {% endif %}
  214.     {{ include('@Web/base-js.html.twig') }}
  215.     {% block javascripts %}{% endblock %}
  216.     {% if userCountry() == 'ru' and te.checkIsDev == false %}
  217.         <script src="//cdn.callibri.ru/callibri.js" type="text/javascript" charset="utf-8"></script>
  218.     {% endif %}
  219.     {# displaying the top filter menu during scroll up #}
  220.     {# <script>
  221.         var prevScrollpos = window.pageYOffset;
  222.         window.onscroll = function() {
  223.         var currentScrollPos = window.pageYOffset;
  224.         if (prevScrollpos > currentScrollPos) {
  225.             document.getElementById('top-filter-menu').style.top = '0';
  226.         } else {
  227.             document.getElementById('top-filter-menu').style.top = '-50px';
  228.         }
  229.             prevScrollpos = currentScrollPos;
  230.         }
  231.     </script> #}
  232.     {% if useRTWidget() and app.request.attributes.get('_route') != 'app_chatb_chatbpage' %}
  233. {#        {% set lang = getCurLocale(false) %}#}
  234. {#        {% set country = userCountry() %}#}
  235.         <script src="https://rtc.remote.team/scripts.js?port-num=3001&chat-id=170619828665B2850E08B2F170619828&client-id={{ token }}&custom-trigger-id=chat-widget-btn&portal-subdomain=te"></script>
  236.     {% endif %}
  237. </body>
  238. </html>
  239. {% endcompress %}