42 lines
1.1 KiB
Text
42 lines
1.1 KiB
Text
package templates
|
|
|
|
templ Layout(title string, header, main templ.Component) {
|
|
<!DOCTYPE html>
|
|
<html lang="pl">
|
|
<head>
|
|
<meta charset="UTF-8"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
|
<title>{ title } — Zamówienia ciast</title>
|
|
<link rel="stylesheet" href="/static/fonts/inter.css"/>
|
|
<link rel="stylesheet" href="/static/fonts/material.css"/>
|
|
<link rel="stylesheet" href="/static/style.css"/>
|
|
<script src="/static/htmx2.04.js" defer></script>
|
|
<script src="/static/order.js"></script>
|
|
</head>
|
|
<body>
|
|
<aside class="sidebar">
|
|
@Nav()
|
|
</aside>
|
|
<main>
|
|
<header class="topnav">
|
|
<h1>{ title }</h1>
|
|
@header
|
|
</header>
|
|
<div class="main-content">
|
|
@main
|
|
</div>
|
|
</main>
|
|
<script>
|
|
(function() {
|
|
var path = window.location.pathname;
|
|
var links = document.querySelectorAll('.link');
|
|
for (var i = 0; i < links.length; i++) {
|
|
if (links[i].getAttribute('href') === path) {
|
|
links[i].classList.add('active');
|
|
}
|
|
}
|
|
})();
|
|
</script>
|
|
</body>
|
|
</html>
|
|
}
|