templates/base.html.twig line 1

Open in your IDE?
  1. {#- templates/base.html.twig -#}
  2. <!DOCTYPE html>
  3. <html lang="{{ app.request.locale|default('en')|replace({'_': '-'}) }}">
  4. <head>
  5.   <meta charset="utf-8">
  6.   <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  7.   <title>{% block title %}MapYourDream{% endblock %}</title>
  8.   {# <link rel="canonical" href="{{ url(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) }}"> #}
  9.   <link id="vendorsbundle" rel="stylesheet" media="screen, print" href="{{ asset('css/vendors.bundle.css') }}">
  10.   <link id="appbundle" rel="stylesheet" media="screen, print" href="{{ asset('css/app.bundle.css') }}">
  11.   <link id="active_theme" rel="stylesheet" media="screen, print" href="{{ asset('css/themes/cust-theme-' ~ app.session.get('userStructure').color_structure|default(7) ~ '.css') }}">
  12.   <!-- Place favicon.ico in the root directory -->
  13.   <link rel="apple-touch-icon" sizes="180x180" href="{{ asset('img/favicon/apple-touch-icon.png') }}">
  14.   <link rel="icon" type="image/png" sizes="32x32" href="{{ asset('img/favicon/favicon-32x32.png') }}">
  15.   <link rel="mask-icon" href="{{ asset('img/favicon/safari-pinned-tab.svg') }}" color="#5bbad5">
  16.   <link rel="stylesheet" href="{{ asset('css/myd.css') }}">
  17.   <link rel="stylesheet" href="{{ asset('css/notifications/toastr/toastr.css') }}">
  18.   {% block stylesheets %}{% endblock %}
  19. </head>
  20. <body class="mod-bg-1 mod-nav-link nav-function-fixed ">
  21.         <!-- DOC: script to save and load page settings -->
  22.         <script>
  23.             /**
  24.              *    This script should be placed right after the body tag for fast execution
  25.              *    Note: the script is written in pure javascript and does not depend on thirdparty library
  26.              **/
  27.             'use strict';
  28.             var classHolder = document.getElementsByTagName("BODY")[0],
  29.                 /**
  30.                  * Load from localstorage
  31.                  **/
  32.                 themeSettings = (localStorage.getItem('themeSettings')) ? JSON.parse(localStorage.getItem('themeSettings')) :
  33.                 {},
  34.                 themeURL = themeSettings.themeURL || '',
  35.                 themeOptions = themeSettings.themeOptions || '';
  36.             /**
  37.              * Load theme options
  38.              **/
  39.             if (themeSettings.themeOptions)
  40.             {
  41.                 classHolder.className = themeSettings.themeOptions;
  42.                 console.log("%c✔ Theme settings loaded", "color: #148f32");
  43.             }
  44.             else
  45.             {
  46.                 console.log("%c✔ Heads up! Theme settings is empty or does not exist, loading default settings...", "color: #ed1c24");
  47.             }
  48.             if (themeSettings.themeURL && !document.getElementById('mytheme'))
  49.             {
  50.                 var cssfile = document.createElement('link');
  51.                 cssfile.id = 'mytheme';
  52.                 cssfile.rel = 'stylesheet';
  53.                 cssfile.href = themeURL;
  54.                 document.getElementsByTagName('head')[0].appendChild(cssfile);
  55.             }
  56.             else if (themeSettings.themeURL && document.getElementById('mytheme'))
  57.             {
  58.                 document.getElementById('mytheme').href = themeSettings.themeURL;
  59.             }
  60.             /**
  61.              * Save to localstorage
  62.              **/
  63.             var saveSettings = function()
  64.             {
  65.                 themeSettings.themeOptions = String(classHolder.className).split(/[^\w-]+/).filter(function(item)
  66.                 {
  67.                     return /^(nav|header|footer|mod|display)-/i.test(item);
  68.                 }).join(' ');
  69.                 if (document.getElementById('mytheme'))
  70.                 {
  71.                     themeSettings.themeURL = document.getElementById('mytheme').getAttribute("href");
  72.                 };
  73.                 localStorage.setItem('themeSettings', JSON.stringify(themeSettings));
  74.             }
  75.             /**
  76.              * Reset settings
  77.              **/
  78.             var resetSettings = function()
  79.             {
  80.                 localStorage.setItem("themeSettings", "");
  81.             }
  82.         </script>
  83.   {% block body %}{% endblock %}
  84.   {% block javascripts %}
  85.     <script src="{{ asset('js/vendors.bundle.js') }}"></script>
  86.     <script src="{{ asset('js/app.bundle.js') }}"></script>
  87.     <script src="{{ asset('js/myd.js') }}"></script>
  88.     <script src="{{ asset('js/notifications/toastr/toastr.js') }}"></script>
  89.   {% endblock %}
  90. </body>
  91. </html>