templates/__design/v2023/layout.html.twig line 31

Open in your IDE?
  1. {# {% set cssContent = source('../public/assets/styles/v2023/public.css') %} #}
  2. {% apply spaceless %}
  3. {% set templateType = 'public' %}
  4. {% set city = app.request.attributes.get('city', default_city()) %}
  5. {% set isDefaultCity = city == default_city() %}
  6. {# Создаём переменную для урла в логотипе #}
  7. {% set logoUrl = app.request.requestUri == '/' ? path('homepage') :
  8.                 (isDefaultCity ? '/' : path('profile_list.list_by_city', {"city": city.uriIdentity}))
  9. %}
  10. {% set months = {
  11.     "January": "Январь",
  12.     "February": "Февраль",
  13.     "March": "Март",
  14.     "April": "Апрель",
  15.     "May": "Май",
  16.     "June": "Июнь",
  17.     "July": "Июль",
  18.     "August": "Август",
  19.     "September": "Сентябрь",
  20.     "October": "Октябрь",
  21.     "November": "Ноябрь",
  22.     "December": "Декабрь"
  23. } %}
  24. {# {% apply inline_css(source("assets/colors.css")) %} #}
  25. <!DOCTYPE html>
  26. <html lang="{{ app.request.locale }}" class="page{{ app.request.get('_route') == 'map.page' ? ' full-page' : '' }}">
  27.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  28.     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  29.     <meta http-equiv="Accept-CH" content="DPR">
  30.     <title>{% block title %}{{ seo_title() }}{% endblock %}</title>
  31.     {% block metaDescription %}
  32.         <meta name="description" content="{{ seo_description() }}">
  33.     {% endblock %}
  34.     {% block metaKeywords %}
  35.         <meta name="keywords" content="{{ seo_keywords() }}">
  36.     {% endblock %}
  37.     {% block metaRobots %}{% endblock %}
  38.     {% block metaSpecial %}{% endblock %}
  39.     {% block preconnect %}
  40.         {%- if responsive_media_base_url is defined -%}
  41.         <link rel="preconnect" href="{{ responsive_media_base_url|replace({'responsive': 'assets'}) }}" />
  42.         <link rel="preconnect" href="{{ responsive_media_base_url }}" />
  43.         {%- endif -%}
  44.         <link rel="preconnect" href="https://mc.yandex.ru">
  45.         <link rel="preconnect" href="https://www.googletagmanager.com">
  46.         <link rel="dns-prefetch" href="{{ responsive_media_base_url }}" />
  47.     {% endblock %}
  48.     {% block stylesheet %}
  49.         <style>
  50.             {% for asset_file in encore_entry_css_files('scripts/v2023/index', 'nodomainConfig') %}
  51.                 {{ source(asset_file) }}
  52.             {% endfor %}
  53.         </style>
  54.     {% endblock %}
  55.     {# {{ encore_entry_link_tags('colors') }} #}
  56.     <style>
  57.         {% for asset_file in encore_entry_css_files('colors', 'nodomainConfig') %}
  58.             {{ source(asset_file) }}
  59.         {% endfor %}
  60.     </style>
  61.     {% block stylesheet_preload %}{% endblock %}
  62.     <style>
  63.         {% for asset_file in encore_entry_css_files('styles/v2023/public', 'nodomainConfig') %}
  64.             {{ source(asset_file) }}
  65.         {% endfor %}
  66.     </style>
  67.     {% block alternate %}{% endblock %}
  68.     {% block preloadAnyData %}{% endblock %}
  69.     {% block canonical %}
  70.         {% if actual_main_domain == app.request.host %}
  71.         <link rel="canonical" href="{{ canonical_url(actual_main_domain) }}">
  72.         {% endif %}
  73.     {% endblock %}
  74.     <!-- Icons -->
  75.     <link rel="icon" href="{{ asset('assets/images/favicons/favicon.ico')}}" type="image/x-icon">
  76.     <link rel="apple-touch-icon" sizes="180x180" href="{{ asset('assets/images/favicons/apple-touch-icon.png')}}" type="image/png">
  77.     <meta name="theme-color" content="#FF3F40">
  78. </head>
  79. <body {% block specialHtmlTagClass %} class="page__body{% block bodyClasses %}{% endblock %}"{% endblock %}>
  80.     <div class="wrapper{% block wrapper_class %}{% endblock %}">
  81.         {% block header %}
  82.             {% include '__design/v2023/components/header.html.twig' %}
  83.         {% endblock %}
  84.         <div class="content{% block content_class %}{% endblock %}">
  85.             {% block grid %}{% endblock %}
  86.         </div>
  87.         {% block footer %}
  88.             {{ include('__design/v2023/components/footer.html.twig') }}
  89.         {% endblock %}
  90.         <div class="overlay"></div>
  91.     </div>
  92.     {% block modal %}
  93.     {% endblock %}
  94.     {{ include('__design/v2023/components/modal.html.twig') }}
  95.     {% block stylesheet_postload1 %}
  96.     {% endblock %}
  97.     <svg class="d-none" xmlns="http://www.w3.org/2000/svg">
  98.         <symbol id="i-alert" viewBox="0 0 80 80">
  99.             <path fill="#FF3F40" fill-rule="evenodd" d="M6.668 67.576 40.001 10l33.334 57.576H6.668Zm56.151-6.06L40.001 22.09 17.183 61.515H62.82Zm-25.848-9.092v6.06h6.06v-6.06h-6.06Zm0-18.182h6.06v12.122h-6.06V34.242Z" clip-rule="evenodd"/>
  100.         </symbol>
  101.         <symbol id="i-ok" viewBox="0 0 80 80">
  102.             <path fill="#67C509" fill-rule="evenodd" d="M40.001 6.668c-18.4 0-33.333 14.933-33.333 33.333s14.933 33.334 33.333 33.334S73.335 58.4 73.335 40C73.335 21.601 58.4 6.668 40 6.668Zm0 60c-14.7 0-26.666-11.967-26.666-26.667 0-14.7 11.966-26.666 26.666-26.666 14.7 0 26.667 11.966 26.667 26.666 0 14.7-11.967 26.667-26.667 26.667Zm-6.666-19.433L55.3 25.268l4.7 4.733-26.666 26.667L20 43.335l4.7-4.7 8.634 8.6Z" clip-rule="evenodd"/>
  103.         </symbol>
  104.         <symbol id="search" viewBox="0 0 25 24">
  105.             <path fill-rule="evenodd" d="M8.056 2.685a9 9 0 0 1 10.476 13.933l3.675 3.675a1 1 0 0 1-1.414 1.414l-3.675-3.675A9 9 0 1 1 8.056 2.685ZM11.5 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14Z" clip-rule="evenodd"/>
  106.         </symbol>
  107.         <symbol id="selfie" viewBox="0 0 20 20">
  108.              <path d="M12.084 8.75a2.083 2.083 0 1 1-4.167 0 2.083 2.083 0 0 1 4.167 0Z"/><path fill-rule="evenodd" d="M1.667 6.667A3.333 3.333 0 0 1 5 3.333h10a3.333 3.333 0 0 1 3.334 3.334v6.666A3.333 3.333 0 0 1 15 16.667H5a3.333 3.333 0 0 1-3.333-3.334V6.667ZM5 5h10c.92 0 1.667.746 1.667 1.667v6.666c0 .92-.746 1.667-1.667 1.667h-2.083c0-1.841-1.306-3.333-2.917-3.333-1.61 0-2.916 1.492-2.916 3.333H5c-.92 0-1.666-.746-1.666-1.667V6.667C3.334 5.747 4.08 5 5 5Zm7.084 3.75a2.083 2.083 0 1 1-4.167 0 2.083 2.083 0 0 1 4.167 0Z" clip-rule="evenodd"/>
  109.         </symbol>
  110.         <symbol id="video" viewBox="0 0 20 20">
  111.             <path fill-rule="evenodd" d="M15 5H5c-.92 0-1.666.746-1.666 1.667v6.666C3.334 14.253 4.08 15 5 15h10c.92 0 1.667-.746 1.667-1.667V6.667C16.667 5.747 15.921 5 15 5ZM5 3.333a3.333 3.333 0 0 0-3.333 3.334v6.666A3.333 3.333 0 0 0 5 16.667h10a3.333 3.333 0 0 0 3.334-3.334V6.667A3.333 3.333 0 0 0 15 3.333H5Z" clip-rule="evenodd"/><path d="m8.334 13.333 5-3.333-5-3.333v6.666Z"/>
  112.         </symbol>
  113.         <symbol id="comment" viewBox="0 0 20 20">
  114.             <path fill-rule="evenodd" d="M15 5H5c-.92 0-1.666.746-1.666 1.667v6.666C3.334 14.253 4.08 15 5 15h10c.92 0 1.667-.746 1.667-1.667V6.667C16.667 5.747 15.921 5 15 5ZM5 3.333a3.333 3.333 0 0 0-3.333 3.334v6.666A3.333 3.333 0 0 0 5 16.667h10a3.333 3.333 0 0 0 3.334-3.334V6.667A3.333 3.333 0 0 0 15 3.333H5Z" clip-rule="evenodd"/><path d="M5 7.5c0-.46.373-.833.834-.833h8.333a.833.833 0 0 1 0 1.666H5.834A.833.833 0 0 1 5 7.5ZM5 10c0-.46.373-.833.834-.833h8.333a.833.833 0 0 1 0 1.666H5.834A.833.833 0 0 1 5 10ZM5 12.5c0-.46.373-.833.834-.833H10a.833.833 0 1 1 0 1.666H5.834A.833.833 0 0 1 5 12.5Z"/>
  115.         </symbol>
  116.         <symbol id="verify" viewBox="0 0 24 25">
  117.             <path fill="#27AE60" fill-rule="evenodd" d="m20.56 9.716 2.44 2.78-2.44 2.78.34 3.68-3.61.82-1.89 3.18-3.4-1.46-3.4 1.47-1.89-3.18-3.61-.82.34-3.69L1 12.496l2.44-2.79-.34-3.68 3.61-.81 1.89-3.18 3.4 1.46 3.4-1.46 1.89 3.18 3.61.82-.34 3.68ZM7.42 11.91l3.17 3.17 6.59-6.58 1.41 1.41-8 8L6 13.32l1.42-1.41Z" clip-rule="evenodd"/>
  118.         </symbol>
  119.         <symbol id="metro" viewBox="0 0 18 19">
  120.             <path d="M1.2 14H0v1.7h6.4V14H4.5l1.2-4.4L9 15.9l3.3-6.3 1.2 4.4h-1.9v1.7H18V14h-1.3L12.5 2.4 9 10 5.4 2.4 1.2 14Z" />
  121.         </symbol>
  122.         <symbol id="mcd-1" viewBox="0 0 22 18">
  123.             <path d="m21.96 3.14-3.12 11.68c-.2.72-.45.93-1.06.93H.59c-.52 0-.69-.29-.54-.9l3.1-11.7c.19-.7.42-.9 1.05-.9h17.2c.52 0 .69.29.56.9Z" fill="#F6A500"/><path d="M13.1 12.64h3.87l.41-1.18h-1.6v-6.1h-2.59V6.5h1.32v4.96h-1.4v1.17Zm-1.24-3.63c0-2.17-1.43-3.66-3.64-3.66H4.99l-.37 1.23H5.8v6.07h2.42c2.2-.01 3.63-1.5 3.63-3.64Zm-1.4 0c0 1.6-.97 2.42-2.27 2.42H7.12V6.56H8.2c1.3 0 2.28.8 2.28 2.45Z" fill="#fff"/>
  124.         </symbol>
  125.         <symbol id="mcd-2" viewBox="0 0 22 18">
  126.             <path d="m21.96 3.14-3.12 11.68c-.2.72-.45.93-1.06.93H.59c-.52 0-.69-.29-.54-.9l3.1-11.7c.19-.7.42-.9 1.05-.9h17.2c.52 0 .69.29.56.9Z" fill="#E94282"/><path d="m12.6 6.33.86.86a2.67 2.67 0 0 1 1.74-.76c.7 0 1.24.39 1.24 1.05 0 .57-.3.97-1.67 2.33l-1.88 1.85v.99h4.79l.41-1.16h-3.37v-.02l1.33-1.27c1.23-1.17 1.72-1.85 1.72-2.84 0-1.12-.88-2.12-2.5-2.12-1.03-.01-2.02.47-2.66 1.1ZM11.44 9c0-2.17-1.48-3.66-3.79-3.66H4.3l-.4 1.24h1.23v6.07h2.51c2.31-.01 3.79-1.5 3.79-3.65ZM9.97 9c0 1.61-1.01 2.45-2.36 2.45H6.5v-4.9h1.1c1.36 0 2.37.83 2.37 2.45Z" fill="#fff"/>
  127.         </symbol>
  128.         <symbol id="mcd-3" viewBox="0 0 22 18">
  129.             <path d="M3.75 5.21A.3.3 0 0 1 4.04 5h14.65c.2 0 .34.2.28.38l-2.72 8.41a.3.3 0 0 1-.29.21H1.31a.3.3 0 0 1-.28-.38L3.75 5.2Z" fill="#E95B0C"/><path d="m21.96 3.14-3.12 11.68c-.2.72-.45.93-1.06.93H.59c-.52 0-.69-.29-.54-.9l3.1-11.7c.19-.7.42-.9 1.05-.9h17.2c.52 0 .69.29.56.9Z" fill="#E95B0C"/><path d="M17.1 8.79a2.34 2.34 0 0 0-1.25-.68l1.73-1.72V5.36H12.8V6.6h3.06l-1.8 1.78v.88l.19-.03.26-.03h.27c.46 0 .83.1 1.14.31.3.2.44.47.44.86 0 .36-.13.64-.4.85a1.5 1.5 0 0 1-.98.33 2.26 2.26 0 0 1-1.65-.67l-.11-.1-.9.9.11.1a3.47 3.47 0 0 0 2.57 1c.76 0 1.42-.24 1.94-.7.53-.47.8-1.05.8-1.72a2.18 2.18 0 0 0-.64-1.57ZM10.41 6.39a3.64 3.64 0 0 0-2.74-1.04h-3.1l-.3 1.21h.97v6.08h2.43c1.15 0 2.07-.34 2.74-1.02.67-.7 1-1.56 1-2.61a3.55 3.55 0 0 0-1-2.62ZM10.01 9c0 .84-.23 1.43-.68 1.83-.44.4-1.02.6-1.72.6h-1V6.58h1c.71 0 1.28.2 1.72.62.45.4.68 1 .68 1.82Z" fill="#fff"/>
  130.         </symbol>
  131.         <symbol id="mcd-4" viewBox="0 0 22 18">
  132.             <path d="M3.75 5.21A.3.3 0 0 1 4.04 5h14.65c.2 0 .34.2.28.38l-2.72 8.41a.3.3 0 0 1-.29.21H1.31a.3.3 0 0 1-.28-.38L3.75 5.2Z" fill="#41B384"/><path d="m21.96 3.14-3.12 11.68c-.2.72-.45.93-1.06.93H.59c-.52 0-.69-.29-.54-.9l3.1-11.7c.19-.7.42-.9 1.05-.9h17.2c.52 0 .69.29.56.9Z" fill="#41B384"/><path d="M10.1 6.4a3.63 3.63 0 0 0-2.74-1.03H4.37l-.3 1.21h.86v6.07h2.42c1.15 0 2.07-.34 2.74-1.02a3.6 3.6 0 0 0 .99-2.6c0-1.06-.32-1.94-.98-2.63ZM9.69 9c0 .85-.24 1.44-.67 1.84-.46.4-1.02.6-1.72.6H6.29V6.6h1c.7 0 1.28.2 1.72.61.44.4.68 1 .68 1.8ZM16.7 9.9V7.8h-1.32v2.1H13.5l1.96-4.53h-1.4l-2.04 4.78v.93h3.36v1.57h1.32v-1.57h.8l.44-1.17H16.7Z" fill="#fff"/>
  133.         </symbol>
  134.         <symbol id="mck" viewBox="0 0 24 24">
  135.             <path fill-rule="evenodd" clip-rule="evenodd" d="M12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm0 2a6 6 0 1 0 0-12 6 6 0 0 0 0 12Z" fill="#DC0505"/>
  136.             <path fill-rule="evenodd" clip-rule="evenodd" d="M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm0 2a10 10 0 1 0 0-20 10 10 0 0 0 0 20Z" fill="#DC0505"/>
  137.         </symbol>
  138.     </svg>
  139.     {% block javascripts %}
  140.         {{ encore_entry_script_tags('scripts/v2023/index', null, 'basicConfig') }}
  141.         {# <script>
  142.             {% for asset_file in encore_entry_js_files('scripts/v2023/index') %}
  143.                 {{ source(asset_file) }}
  144.             {% endfor %}
  145.         </script> #}
  146.     {% endblock %}
  147.     <script>
  148.         (function(){
  149.             document.addEventListener("DOMContentLoaded", () => {
  150.                 fetch("{{ path('component.header') }}?city={{app.request.attributes.get('city', default_city()).uriIdentity}}", {
  151.                     method: 'GET',
  152.                     responseType: 'text',
  153.                     headers: {
  154.                         "Content-Type": "text/html; charset=utf-8",
  155.                         'X-Requested-With': 'XMLHttpRequest'
  156.                     },
  157.                 }).then(response => {
  158.                     return response.text();
  159.                 }).then(data => {
  160.                     const temp = document.createElement('div');
  161.                     temp.innerHTML = data;
  162.                     const userData = temp.querySelector('#user-data');
  163.                     document.dispatchEvent(new Event('header:loaded'))
  164.                     const loginBtnList = document.querySelectorAll('[data-login]');
  165.                     const regBtnList = document.querySelectorAll('[data-registration]');
  166.                     const user = JSON.parse(userData.innerHTML);
  167.                     if (user.role) {
  168.                         const footerLink = document.getElementById('add-profile');
  169.                         if (footerLink) footerLink.href = user.role === "advertiser" ? "{{ path('account.profile_editing.create') }}" : (user.role === "user" ? "{{ path('app_security_register') }}" : '');
  170.                         regBtnList.forEach(el => {
  171.                             if (el.dataset.parent) {
  172.                                 el.parentElement.remove();
  173.                             } else {
  174.                                 el.remove();
  175.                             }
  176.                         });
  177.                         loginBtnList.forEach(el => {
  178.                             el.href = "{{ path('account') }}";
  179.                             el.innerHTML = `<svg class="btn-icon" width="24" height="24" viewbox="0 0 24 24" fill="none"><path fill-rule="evenodd" d="M15.46 11.61A4.99 4.99 0 0 0 12 3a5 5 0 0 0-3.46 8.61A10.02 10.02 0 0 0 2 21h20a10.02 10.02 0 0 0-6.54-9.39ZM15 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm-3 5a8 8 0 0 0-7.75 6h15.5A8 8 0 0 0 12 13Z" clip-rule="evenodd"/></svg>
  180.                             <span class="btn-text">Личный кабинет</span>`;
  181.                             el.classList.remove('btn-white');
  182.                             el.classList.remove('d-none');
  183.                             el.classList.add('btn-white-black');
  184.                             el.classList.add('header__login-account');
  185.                         });
  186.                     } else {
  187.                         regBtnList.forEach(el => {
  188.                             el.classList.remove('d-none');
  189.                         });
  190.                         loginBtnList.forEach(el => {
  191.                             el.classList.remove('d-none');
  192.                         });
  193.                     }
  194.                     try {
  195.                         document.dispatchEvent(new CustomEvent('header:update', { detail: { data: user } }));
  196.                     } catch (e) {
  197.                         console.warn('Error parsing user data:', e);
  198.                     }
  199.                     //document.dispatchEvent(new Event(`header:update:${data.includes('Для Вас') ?}`))
  200.                 })
  201.             })
  202.             // function showHamburger() {
  203.             //     hamburger.setAttribute('aria-expanded', 'true');
  204.             //     overlay.classList.add('active');
  205.             // }
  206.             // function hideLightbox() {
  207.             //     hamburger.setAttribute('aria-expanded', 'false');
  208.             //     overlay.classList.remove('active');
  209.             // }
  210.             function toggleLightbox(state) {
  211.                 hamburgerBtn.setAttribute('aria-expanded', (state ? "true" : "false"));
  212.                 overlay.classList.toggle('active', state);
  213.             }
  214.             const overlay = document.querySelector('.overlay');
  215.             let hamburgerBtn = document.getElementById('hamburger-btn');
  216.             document.addEventListener('click', function(e) {
  217.                 if (e.target === hamburgerBtn && hamburgerBtn.contains(e.target)) {
  218.                     hamburgerBtn.getAttribute('aria-expanded') === 'true' ? toggleLightbox(false) : toggleLightbox(true)
  219.                 }
  220.                 else if (hamburgerBtn && hamburgerBtn.parentElement.contains(e.target)) {}
  221.                 else {
  222.                     toggleLightbox(false);
  223.                 }
  224.             });
  225.         })();
  226.     </script>
  227.     {% include '__design/v2023/components/profile_ctr.js.twig' %}
  228.     {% if ga_tracker_id %}
  229.         <!-- Global site tag (gtag.js) - Google Analytics -->
  230.         <script async src="https://www.googletagmanager.com/gtag/js?id={{ ga_tracker_id  }}"></script>
  231.         <script>
  232.             window.dataLayer = window.dataLayer || [];
  233.             function gtag(){dataLayer.push(arguments);}
  234.             gtag('js', new Date());
  235.             {# https://developers.google.com/analytics/devguides/collection/gtagjs/custom-dims-mets #}
  236.             gtag('config', '{{ ga_tracker_id  }}', {
  237.                 'custom_map': {
  238.                     'userip': 'ip',
  239.                     'useragent': 'user_agent'
  240.                 }
  241.             });
  242.             gtag('event', 'user_data', {'ip': '{{ app.request.clientIp }}', 'user_agent': window.navigator.userAgent});
  243.         </script>
  244.     {% endif %}
  245.     {% if ym_tracker_id %}
  246.         <!-- Yandex.Metrika counter -->
  247.         <script type="text/javascript" >
  248.             (function (d, w, c) {
  249.                 (w[c] = w[c] || []).push(function() {
  250.                     try {
  251.                         w.yaCounter{{ ym_tracker_id }} = new Ya.Metrika({
  252.                             id:{{ ym_tracker_id }},
  253.                             clickmap:true,
  254.                             trackLinks:true,
  255.                             accurateTrackBounce:true
  256.                         });
  257.                     } catch(e) { }
  258.                 });
  259.                 var n = d.getElementsByTagName("script")[0],
  260.                     s = d.createElement("script"),
  261.                     f = function () { n.parentNode.insertBefore(s, n); };
  262.                 s.type = "text/javascript";
  263.                 s.async = true;
  264.                 s.src = "https://mc.yandex.ru/metrika/watch.js";
  265.                 if (w.opera == "[object Opera]") {
  266.                     d.addEventListener("DOMContentLoaded", f, false);
  267.                 } else { f(); }
  268.             })(document, window, "yandex_metrika_callbacks");
  269.         </script>
  270.         <noscript><div><img src="https://mc.yandex.ru/watch/{{ ym_tracker_id }}" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
  271.         <!-- /Yandex.Metrika counter -->
  272.     {% endif %}
  273. </body>
  274. </html>
  275. {% endapply %}
  276. {# {% endapply %} #}