cake-order-tracker/server/templates/layout.templ
2026-06-15 20:30:15 +02:00

75 lines
2.6 KiB
Text

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"/>
<link rel="stylesheet" href="/static/style.css"/>
<script src="/static/htmx2.04.js" defer></script>
<script src="/static/order.js"></script>
</head>
<body>
<header class="topnav">
<h1>{ title }</h1>
<nav>
<a href="/orders" hx-get="/orders" hx-target="#main" hx-swap="outerHTML" hx-push-url="true">
<span class="material-symbols-outlined">dashboard</span>
<span>Panel główny</span>
</a>
<a href="/cakes" hx-get="/cakes" hx-target="#main" hx-swap="outerHTML" hx-push-url="true">
<span class="material-symbols-outlined">inventory_2</span>
<span>Katalog</span>
</a>
<a href="/blocked" hx-get="/blocked" hx-target="#main" hx-swap="outerHTML" hx-push-url="true">
<span class="material-symbols-outlined">event_busy</span>
<span>Terminy zablokowane</span>
</a>
</nav>
<a href="/order" class="cta" hx-get="/order" hx-target="#main" hx-swap="outerHTML" hx-push-url="true">
<span class="material-symbols-outlined">add</span>
<span>Nowe zamówienie</span>
</a>
</header>
<main id="main">
<div class="main-content">
@main
</div>
</main>
</body>
</html>
}
templ MainContent(title string, main templ.Component) {
<header class="topnav" hx-swap-oob="true">
<h1>{ title }</h1>
<nav>
<a href="/orders" hx-get="/orders" hx-target="#main" hx-swap="outerHTML" hx-push-url="true">
<span class="material-symbols-outlined">dashboard</span>
<span>Panel główny</span>
</a>
<a href="/cakes" hx-get="/cakes" hx-target="#main" hx-swap="outerHTML" hx-push-url="true">
<span class="material-symbols-outlined">inventory_2</span>
<span>Katalog</span>
</a>
<a href="/blocked" hx-get="/blocked" hx-target="#main" hx-swap="outerHTML" hx-push-url="true">
<span class="material-symbols-outlined">event_busy</span>
<span>Terminy zablokowane</span>
</a>
</nav>
<a href="/order" class="cta" hx-get="/order" hx-target="#main" hx-swap="outerHTML" hx-push-url="true">
<span class="material-symbols-outlined">add</span>
<span>Nowe zamówienie</span>
</a>
</header>
<main id="main">
<title hx-swap-oob="true">{ title } — Zamówienia ciast</title>
<div class="main-content">
@main
</div>
</main>
}