{#- templates/base.html.twig -#}
<!DOCTYPE html>
<html lang="{{ app.request.locale|default('en')|replace({'_': '-'}) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>{% block title %}MapYourDream{% endblock %}</title>
{# <link rel="canonical" href="{{ url(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) }}"> #}
<link id="vendorsbundle" rel="stylesheet" media="screen, print" href="{{ asset('css/vendors.bundle.css') }}">
<link id="appbundle" rel="stylesheet" media="screen, print" href="{{ asset('css/app.bundle.css') }}">
<link id="active_theme" rel="stylesheet" media="screen, print" href="{{ asset('css/themes/cust-theme-' ~ app.session.get('userStructure').color_structure|default(7) ~ '.css') }}">
<!-- Place favicon.ico in the root directory -->
<link rel="apple-touch-icon" sizes="180x180" href="{{ asset('img/favicon/apple-touch-icon.png') }}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ asset('img/favicon/favicon-32x32.png') }}">
<link rel="mask-icon" href="{{ asset('img/favicon/safari-pinned-tab.svg') }}" color="#5bbad5">
<link rel="stylesheet" href="{{ asset('css/myd.css') }}">
<link rel="stylesheet" href="{{ asset('css/notifications/toastr/toastr.css') }}">
{% block stylesheets %}{% endblock %}
</head>
<body class="mod-bg-1 mod-nav-link nav-function-fixed ">
<!-- DOC: script to save and load page settings -->
<script>
/**
* This script should be placed right after the body tag for fast execution
* Note: the script is written in pure javascript and does not depend on thirdparty library
**/
'use strict';
var classHolder = document.getElementsByTagName("BODY")[0],
/**
* Load from localstorage
**/
themeSettings = (localStorage.getItem('themeSettings')) ? JSON.parse(localStorage.getItem('themeSettings')) :
{},
themeURL = themeSettings.themeURL || '',
themeOptions = themeSettings.themeOptions || '';
/**
* Load theme options
**/
if (themeSettings.themeOptions)
{
classHolder.className = themeSettings.themeOptions;
console.log("%c✔ Theme settings loaded", "color: #148f32");
}
else
{
console.log("%c✔ Heads up! Theme settings is empty or does not exist, loading default settings...", "color: #ed1c24");
}
if (themeSettings.themeURL && !document.getElementById('mytheme'))
{
var cssfile = document.createElement('link');
cssfile.id = 'mytheme';
cssfile.rel = 'stylesheet';
cssfile.href = themeURL;
document.getElementsByTagName('head')[0].appendChild(cssfile);
}
else if (themeSettings.themeURL && document.getElementById('mytheme'))
{
document.getElementById('mytheme').href = themeSettings.themeURL;
}
/**
* Save to localstorage
**/
var saveSettings = function()
{
themeSettings.themeOptions = String(classHolder.className).split(/[^\w-]+/).filter(function(item)
{
return /^(nav|header|footer|mod|display)-/i.test(item);
}).join(' ');
if (document.getElementById('mytheme'))
{
themeSettings.themeURL = document.getElementById('mytheme').getAttribute("href");
};
localStorage.setItem('themeSettings', JSON.stringify(themeSettings));
}
/**
* Reset settings
**/
var resetSettings = function()
{
localStorage.setItem("themeSettings", "");
}
</script>
{% block body %}{% endblock %}
{% block javascripts %}
<script src="{{ asset('js/vendors.bundle.js') }}"></script>
<script src="{{ asset('js/app.bundle.js') }}"></script>
<script src="{{ asset('js/myd.js') }}"></script>
<script src="{{ asset('js/notifications/toastr/toastr.js') }}"></script>
{% endblock %}
</body>
</html>