move to templ
This commit is contained in:
parent
31a33cc220
commit
bb32802324
34 changed files with 1011 additions and 528 deletions
43
server/templates/layout.templ
Normal file
43
server/templates/layout.templ
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
package templates
|
||||
|
||||
templ Layout(title string, 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" />
|
||||
<script src="/static/htmx2.04.js" defer></script>
|
||||
<script src="/static/order.js"></script>
|
||||
<link rel="stylesheet" href="/static/style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<aside class="sidebar">
|
||||
@Nav()
|
||||
</aside>
|
||||
<div class="app-body">
|
||||
<header class="topnav">
|
||||
<div class="topnav-left">
|
||||
<h1 class="topnav-title">{ title }</h1>
|
||||
</div>
|
||||
</header>
|
||||
<div class="main-content">
|
||||
@main
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
(function() {
|
||||
var path = window.location.pathname;
|
||||
var links = document.querySelectorAll('.sidebar-link');
|
||||
for (var i = 0; i < links.length; i++) {
|
||||
if (links[i].getAttribute('href') === path) {
|
||||
links[i].classList.add('active');
|
||||
}
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue