70 lines
3.0 KiB
HTML
70 lines
3.0 KiB
HTML
<!doctype html>
|
|
<html lang="it">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>{{.Title}}</title>
|
|
<script>
|
|
window.__TC_IS_AUTHENTICATED = '{{if .CurrentUser}}true{{else}}false{{end}}';
|
|
window.__TC_SERVER_THEME = '{{printf "%q" .UserTheme}}';
|
|
window.__TC_I18N_CONFIG = {
|
|
defaultLang: 'it',
|
|
storageKey: 'tc_lang',
|
|
serverLang: {{printf "%q" .UserLang}},
|
|
isAuthenticated: {{if .CurrentUser}}true{{else}}false{{end}}
|
|
};
|
|
</script>
|
|
<script src="/static/vendor/theme.js?v={{.BuildHash}}"></script>
|
|
<script src="/static/i18n.js?v={{.BuildHash}}" defer></script>
|
|
<link rel="stylesheet" href="/static/css/app.css?v={{.BuildHash}}">
|
|
<link rel="stylesheet" href="/web-components/user-menu.css?v={{.BuildHash}}">
|
|
<script type="module" src="/web-components/user-menu.es.js?v={{.BuildHash}}"></script>
|
|
|
|
</head>
|
|
<body class="flex min-h-screen flex-col bg-white text-gray-900 antialiased dark:bg-gray-900 dark:text-gray-100">
|
|
{{template "navbar" .}}
|
|
|
|
<main class="mx-auto w-full max-w-7xl flex-1 p-6">
|
|
{{template "_flash.html" .}}
|
|
{{template "content" .}}
|
|
</main>
|
|
|
|
<footer class="border-t border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-900">
|
|
<div class="mx-auto flex max-w-7xl items-center justify-between gap-3 px-6 py-4 text-sm text-gray-500 dark:text-gray-400">
|
|
<span>Trustcontact</span>
|
|
<button id="themeToggle" type="button" aria-label="Toggle dark mode" aria-pressed="false" onclick="window.toggleTheme && window.toggleTheme()" class="rounded-lg bg-gray-100 px-3 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-800 dark:text-gray-100 dark:hover:bg-gray-700">
|
|
Dark mode
|
|
</button>
|
|
</div>
|
|
</footer>
|
|
|
|
<script>
|
|
(function () {
|
|
function initNavbarComponents(root) {
|
|
if (!window.__tcNavbarDocBound) {
|
|
window.__tcNavbarDocBound = true;
|
|
document.addEventListener('click', function (event) {
|
|
var menu = document.getElementById('user-dropdown');
|
|
if(menu.getAttribute('isopen') === 'false') return; // skip if menu is closed with css, to avoid issues with multiple navbars
|
|
menu.setAttribute('isopen', 'false');
|
|
menu.style.left = "-9999px";
|
|
});
|
|
document.addEventListener('keydown', function (event) {
|
|
if (event.key !== 'Escape') return;
|
|
var menu = document.getElementById('user-dropdown');
|
|
if(menu.getAttribute('isopen') === 'false') return; // skip if menu is closed with css, to avoid issues with multiple navbars
|
|
menu.setAttribute('isopen', 'false');
|
|
menu.style.left = "-9999px";
|
|
});
|
|
}
|
|
}
|
|
|
|
initNavbarComponents(document);
|
|
if (typeof window.initThemeToggle === 'function') {
|
|
window.initThemeToggle();
|
|
}
|
|
})();
|
|
</script>
|
|
</body>
|
|
</html>
|