templates/base.html.twig line 1

Open in your IDE?
  1. {% import '@BoldrCms/_macros/assets.twig' as assets_macros %}
  2. {% set assets = assets is defined and assets is not empty ? boldr_cms_get_assets().addAll(assets) : boldr_cms_get_assets() %}
  3. <!DOCTYPE html>
  4. <html lang="{{ app.request.locale }}">
  5.     <head>
  6.         <meta charset="UTF-8">
  7.         <title>{% block title %}{{ boldr_cms_get_site_name() }}{% endblock %}</title>
  8.         <meta name="viewport" content="width=device-width" />
  9.         <link rel="stylesheet" href="{{ asset('assets/css/boldrcms-theme-variables.css') }}" />
  10.         <link rel="stylesheet" href="{{ asset('bundles/boldrcms/boldrcms-calculated.css') }}" />
  11.         <link rel="icon" href="{{ asset('assets/images/logo.svg') }}" />
  12.         {{ assets_macros.renderHeadContents(assets) }}
  13.         {{ assets_macros.renderCssFiles(assets) }}
  14.         {{ assets_macros.renderWebpackEncoreStyleEntries(assets) }}
  15.         {% if boldr_cms_get_cookie_state().analysis %}
  16.         <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
  17.         new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
  18.         j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
  19.         'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
  20.         })(window,document,'script','dataLayer','GTM-55B36VC');</script>
  21.         {% endif %}
  22.         <link rel="stylesheet" href="{{ asset('assets/css/style.css') }}?v=1.0.2" />
  23. {% block head %}
  24. {% endblock %}
  25. {% if app.environment == 'dev' %}
  26.         <style>
  27.             body {box-shadow: inset 10px 0 0 red; }
  28.         </style>
  29. {% endif %}
  30.     </head>
  31.     <body class="{{ app.request.attributes.get('_route') == 'shop_shop' ? 'boldr-shop-order-page' }}">
  32.         <div id="wrap">
  33.             <div id="overlay-container">
  34.                 <div id="overlay-loading">
  35.                     <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="margin: auto; display: block;" width="100px" height="100px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid">
  36.                         <circle cx="50" cy="50" fill="none" stroke="#ffffff" stroke-width="10" r="35" stroke-dasharray="164.93361431346415 56.97787143782138">
  37.                             <animateTransform attributeName="transform" type="rotate" repeatCount="indefinite" dur="1s" values="0 50 50;360 50 50" keyTimes="0;1"></animateTransform>
  38.                         </circle>
  39.                     </svg>
  40.                 </div>
  41. {% block overlays %}{% endblock %}
  42.             </div>
  43.             {# Header #}
  44.             <div class="header-wrapper">
  45.                 {% block header_wrapper_content %}
  46.                     <div class="header-content">
  47.                         <div class="header-content-left">
  48.                             {# Header locale switcher #}
  49.                             {% set availableLocales = boldr_cms_get_enabled_locales() %}
  50.                             {% if availableLocales|length > 1 %}
  51.                                 <div class="header-language-selector">
  52.                                     {% for locale in availableLocales %}
  53.                                         {% set translatedUrl = boldr_cms_get_translation_url(locale) %}
  54.                                         {% if translatedUrl is not null and locale != app.request.locale %}
  55.                                             <a href="{{ translatedUrl }}" class="available-locale">
  56.                                                 <img class="language-selector-flag" src="{{ asset('assets/images/flags/' ~ locale ~ '.png') }}" title="{{ locale|locale_name(locale) }}" />
  57.                                                 <span>{{ locale|locale_name(locale) }}</span>
  58.                                             </a>
  59.                                         {% endif %}
  60.                                     {% endfor %}
  61.                                 </div>
  62.                             {% endif %}
  63.                             {# Header menu #}
  64.                             {% for menu in boldr_cms_get_menus_at_location('header') %}
  65.                                 {{ _self.menu(menu, 'header-menu') }}
  66.                             {% endfor %}
  67.                         </div>
  68.                         {# Header logo #}
  69.                         <a class="header-logo" href="{{ url('cms_home') }}">
  70.                             <img class="header-logo-image" src="{{ asset('assets/images/logo.svg') }}" alt="{{ boldr_cms_get_site_name() }}" title="{{ boldr_cms_get_site_name() }}">
  71.                         </a>
  72.                         <div class="header-content-right">
  73.                             {% if app.user %}
  74.                                 {% if boldr_shop_get_customer().getCanChangeOwnDetails() %}
  75.                                 <a class="header-user-link" href="{{ url('shop_personal_details') }}" id="header-user-button">
  76.                                     {{ 'my_account'|trans({}, 'HelensBakery') }}
  77.                                 </a>
  78.                                 {% else %}
  79.                                 <a class="header-user-link" href="{{ url('boldr_users_logout') }}" id="header-user-button">
  80.                                     {{ 'my_account'|trans({}, 'HelensBakery') }}
  81.                                     Log out
  82.                                 </a>
  83.                                 {% endif %}
  84.                             {% else %}
  85.                                 <div class="header-login-wrapper">
  86.                                     <a href="#" id="header-login-button">{{ 'log_in'|trans({}, 'HelensBakery') }}</a>
  87.                                     <form class="header-login-form" method="post" action="{{ url('boldr_users_login') }}">
  88.                                         <input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
  89.                                         <span class="header-login-form-header">{{ 'log_in'|trans({}, 'HelensBakery') }}</span>
  90.                                         <div class="header-login-form-error"></div>
  91.                                         <input type="text" id="header-login-username" name="_username" placeholder="{{ 'username'|trans({}, 'BoldrUsersBundle') }}" />
  92.                                         <input type="password" id="header-login-password" name="_password" placeholder="{{ 'password'|trans({}, 'BoldrUsersBundle') }}" />
  93.                                         <div class="form-label-control header-login-remember-me">
  94.                                             <input type="checkbox" name="_remember_me" id="header-login-remember" />
  95.                                             <label for="header-login-remember">{{ 'remember_me'|trans({}, 'BoldrUsersBundle') }}</label>
  96.                                         </diV>
  97.                                         <a href="{{ url('boldr_users_forgot_password') }}" class="header-login-form-forgot">{{ 'forgot_password'|trans({}, 'BoldrUsersBundle') }}</a>
  98.                                         <button class="header-login-form-submit boldr-button boldr-button-filled" type="submit">
  99.                                             Inloggen
  100.                                         </button>
  101.                                         <a href="{{ url('app_register') }}" class="header-login-form-register">{{ 'no_account_click_here'|trans({}, 'HelensBakery') }}</a>
  102.                                     </form>
  103.                                 </div>
  104.                             {% endif %}
  105.                             {% set itemCount = boldr_shop_get_cart().itemCount %}
  106.                             {% if isShop|default(false)  %}
  107.                                 <div class="order-window-cart-next-states only-finish">
  108.                                 {% for nextState in cart.nextStates|filter(v => v.state == 'payment' or v.state == 'confirmed') %}
  109.                                     <a href="{{ nextState.url }}" class="boldr-button boldr-button-highlight">
  110.                                         {{ nextState.buttonText }}
  111.                                     </a>
  112.                                 {% endfor %}
  113.                                 </div>
  114.                             {% else %}
  115.                                 <a href="{{ url('shop_shop') }}" id="header-order-button" class="boldr-button boldr-button-filled {{ itemCount > 0 ? 'has-items' }}">
  116.                                     <span id="header-order-button-order">{{ 'order'|trans({}, 'HelensBakery') }}</span>
  117.                                     <span id="header-order-button-continue">{{ 'continue_order'|trans({}, 'HelensBakery') }}</span>
  118.                                     <span id="header-order-button-count" class="boldr-button-notification-count">{{ itemCount }}</span>
  119.                                 </a>
  120.                             {% endif %}
  121.                         </div>
  122.                     </div>
  123.                     <div class="header-mobile">
  124.                         <div class="header-mobile-language">
  125.                             <ul>
  126.                                 {% if availableLocales|length > 1 %}
  127.                                     <li>
  128.                                         {% for locale in availableLocales %}
  129.                                             {% set translatedUrl = boldr_cms_get_translation_url(locale) %}
  130.                                             {% if translatedUrl is not null and locale != app.request.locale %}
  131.                                                 <a class="available-locale" href="{{ translatedUrl }}">
  132.                                                     <img class="language-selector-flag" src="{{ asset('assets/images/flags/' ~ locale ~ '.png') }}" title="{{ locale|locale_name(locale) }}" />
  133.                                                 </a>
  134.                                             {% endif %}
  135.                                         {% endfor %}
  136.                                     </li>
  137.                                 {% endif %}
  138.                             </ul>
  139.                         </div>
  140.                         <a href="#menu" class="header-mobile-button">
  141.                             <span></span>
  142.                             <span></span>
  143.                             <span></span>
  144.                         </a>
  145.                         <div class="header-mobile-menu">
  146.                             <div class="header-mobile-menu-inner">
  147.                                 <ul>
  148.                                     <li>
  149.                                         <a href="{{ url('shop_shop') }}" id="header-order-button" class="{{ itemCount > 0 ? 'has-items' }}">
  150.                                             <span id="header-order-button-order">{{ 'order'|trans({}, 'HelensBakery') }}</span>
  151.                                             <span id="header-order-button-continue">{{ 'continue_order'|trans({}, 'HelensBakery') }}</span>
  152.                                         </a>
  153.                                     </li>
  154.                                 </ul>
  155.                                 {% for menu in boldr_cms_get_menus_at_location('header') %}
  156.                                     {{ _self.menu(menu, 'header-menu') }}
  157.                                 {% endfor %}
  158.                                 <ul>
  159.                                     <li>
  160.                                         {% if app.user %}
  161.                                             {% if boldr_shop_get_customer().getCanChangeOwnDetails() %}
  162.                                             <a href="{{ url('shop_personal_details') }}">
  163.                                                 {{ 'my_account'|trans({}, 'HelensBakery') }}
  164.                                             </a>
  165.                                             {% else %}
  166.                                             <a href="{{ url('boldr_users_logout') }}">
  167.                                                 {{ 'log_out'|trans({}, 'HelensBakery') }}
  168.                                             </a>
  169.                                             {% endif %}
  170.                                         {% else %}
  171.                                             <a href="{{ url('boldr_users_login') }}">
  172.                                                 {{ 'log_in'|trans({}, 'HelensBakery') }}
  173.                                             </a>
  174.                                         {% endif %}
  175.                                     </li>
  176.                                 {% if availableLocales|length > 1 %}
  177.                                     <li>
  178.                                         {% for locale in availableLocales %}
  179.                                             {% set translatedUrl = boldr_cms_get_translation_url(locale) %}
  180.                                             {% if translatedUrl is not null and locale != app.request.locale %}
  181.                                                 <a class="available-locale" href="{{ translatedUrl }}">
  182.                                                     <img class="language-selector-flag" src="{{ asset('assets/images/flags/' ~ locale ~ '.png') }}" title="{{ locale|locale_name(locale) }}" />
  183.                                                     <span>{{ locale|locale_name(locale) }}</span>
  184.                                                 </a>
  185.                                             {% endif %}
  186.                                         {% endfor %}
  187.                                     </li>
  188.                                 {% endif %}
  189.                                 </ul>
  190.                             </div>
  191.                         </div>
  192.                     </div>
  193.                 {% endblock %}
  194.             </div>
  195.             {# Main content #}
  196.             <div class="main">
  197. {% block body %}{% endblock %}
  198.             </div>
  199.             {# Footer #}
  200.             <div class="footer-wrapper">
  201.                 <div class="footer-content">
  202.                     <div class="footer-top">
  203.                         <div class="footer-opening-hours">
  204.                             <h3>{{ 'opening_hours'|trans({}, 'HelensBakery') }}</h3>
  205.                             {{ boldr_opening_hours(hb_get_opening_hours_set()) }}
  206.                             <p class="footer-bereidingstijd">
  207.                                 {{ 'warm_bread_15_min_before_close'|trans({}, 'HelensBakery') }}
  208.                             </p>
  209.                             {% set bestellijstPdf = boldr_site_options_get('bestellijst_pdf') %}
  210.                             {% if bestellijstPdf %}
  211.                                 <a target="_blank" class="bestellijst-button" href="{{ boldr_cms_generate_link(boldr_site_options_get('bestellijst_pdf')) }}">
  212.                                     {{ 'order_list'|trans({}, 'HelensBakery') }}
  213.                                 </a>
  214.                             {% endif %}
  215.                         </div>
  216.                         <div class="footer-contact">
  217.                             <h3>{{ 'contact_details'|trans({}, 'HelensBakery') }}</h3>
  218.                             <div class="footer-contact-lines">
  219.                                 {# Address #}
  220.                                 <div class="footer-contact-line-group">
  221.                                     <div class="boldr-contact-map-line">
  222.                                         <i class="icon-pin"></i>
  223.                                         <div class="boldr-contact-map-address">
  224.                                             {{ boldr_site_options_get('contact_details_address') }}<br />
  225.                                             {{ boldr_site_options_get('contact_details_postal_code') }}
  226.                                             {{ boldr_site_options_get('contact_details_city') }}<br />
  227.                                             {{ 'zep'|trans({}, 'HelensBakery') }}
  228.                                         </div>
  229.                                     </div>
  230.                                 </div>
  231.                                 {# Contact options #}
  232.                                 <div class="footer-contact-line-group">
  233.                                     {% for contactOption in boldr_site_options_get('contact_details_contact_methods') %}
  234.                                         <{{ (contactOption.url ? 'a href="' ~ contactOption.url ~ '"' : 'span')|raw }} class="boldr-contact-map-line boldr-contact-map-contact-option">
  235.                                             <i class="boldr-icon {{ contactOption.icon }}"></i>
  236.                                             <span class="boldr-contact-map-contact-option-text">
  237.                                                 {{ contactOption.text }}
  238.                                             </span>
  239.                                         </{{ contactOption.url ? 'a' : 'span' }}>
  240.                                     {% endfor %}
  241.                                 </div>
  242.                                 <div class="footer-social-media">
  243.                                     {% for socialMediaLink in boldr_site_options_get('social_media_links') %}
  244.                                         <a href="{{ socialMediaLink.url }}" target="_blank" title="{{ socialMediaLink.name }}" class="boldr-contact-map-social-media-link">
  245.                                             <i class="boldr-icon {{ socialMediaLink.icon }}"></i>
  246.                                         </a>
  247.                                     {% endfor %}
  248.                                 </div>
  249.                             </div>
  250.                         </div>
  251.                     </div>
  252.                     <div class="footer-bottom">
  253.                         <div class="footer-content-left">
  254.                             {# Copyright #}
  255.                             <span class="footer-copyright">&copy; {{ 'now'|date('Y') }} - {{ boldr_cms_get_site_name() }}.</span>
  256.                             <span class="footer-developer">
  257.                                 {{ 'website_by'|trans({}, 'HelensBakery') }}
  258.                                 <a href="https://boldragency.nl" target="_blank" class="footer-developer-name">
  259.                                     Boldr Digital Agency
  260.                                 </a>
  261.                             </span>
  262.                         </div>
  263.                         <div class="footer-content-right">
  264.                             {# Footer menu #}
  265.                             {% for menu in boldr_cms_get_menus_at_location('footer') %}
  266.                                 {{ _self.menu(menu, 'footer-menu') }}
  267.                             {% endfor %}
  268.                         </div>
  269.                     </div>
  270.                 </div>
  271.             </div>
  272.         </div>
  273.         {% if not isShop|default(false) and not isCheckout|default(false) %}
  274.             <div class="mobile-begin-order-bar">
  275.                 {% set itemCount = boldr_shop_get_cart().itemCount %}
  276.                 <a href="{{ url('shop_shop') }}" class="boldr-button boldr-button-filled">
  277.                     {{ (itemCount > 0 ? 'contiue_order' : 'start_order')|trans({}, 'HelensBakery') }}
  278.                     {% if itemCount > 0 %}
  279.                         <span class="boldr-button-notification-count">{{ itemCount }}</span>
  280.                     {% endif %}
  281.                 </a>
  282.             </div>
  283.         {% endif %}
  284.         {{ boldr_cookies_render()|raw }}
  285.         {# Render new head contents and script contents that were added by functions in the body #}
  286.         {{ assets_macros.renderHeadContents(assets) }}
  287.         {{ assets_macros.renderCssFiles(assets) }}
  288.         {{ assets_macros.renderWebpackEncoreStyleEntries(assets) }}
  289.         {{ assets_macros.renderJsFiles(assets) }}
  290.         {{ assets_macros.renderWebpackEncoreScriptEntries(assets) }}
  291.         {{ assets_macros.renderBodyContents(assets) }}
  292.         {% if boldr_cms_get_cookie_state().analysis %}
  293.         <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KPHG9RG"
  294.         height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
  295.         {% endif %}
  296.     </body>
  297. </html>
  298. {% macro menu(menu, class, itemClass) -%}
  299.     <ul class="menu {{ class }}">
  300.         {% for item in menu.items %}
  301.             {{ _self.menuItem(item, itemClass) }}
  302.         {% endfor %}
  303.     </ul>
  304. {%- endmacro %}
  305. {% macro menuItem(item, class) -%}
  306.     {% set children %}
  307.         {% if item.hasChildren() %}
  308.             <ul class="menu-item-children">
  309.                 {% for child in item.getChildren() %}
  310.                     {{ _self.menuItem(child) }}
  311.                 {% endfor %}
  312.             </ul>
  313.         {% endif %}
  314.     {% endset %}
  315.     <li class="menu-item{{ app.request.uri == item.url or app.request.requestUri == item.url ? ' menu-item-current' : ('menu-item-current' in children ? ' menu-item-current-child') }}">
  316.         {% if item.hasUrl %}
  317.             <a {{ item.getOpenInNewWindow() ? ' target="blank"' : '' }} class="menu-item-text menu-item-link {{ class }}" href="{{ item.url }}">
  318.                 {{ item.text }}
  319.             </a>
  320.         {% else %}
  321.             <span class="menu-item-text">
  322.                 {{ item.text }}
  323.             </span>
  324.         {% endif %}
  325.         {% if item.notification is defined and item.notification is not empty %}
  326.         <span class="menu-item-notification">
  327.             {{ item.notification }}
  328.         </span>
  329.         {% endif %}
  330.         {{ children }}
  331.     </li>
  332. {%- endmacro %}