flattening

This commit is contained in:
bronkuu 2026-06-16 11:19:43 +02:00
parent e829562062
commit 5610b28254
3 changed files with 95 additions and 128 deletions

View file

@ -6,7 +6,7 @@ templ Layout(title string, main templ.Component) {
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>{ title } — Zamówienia ciast</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"/>
@ -14,62 +14,36 @@ templ Layout(title string, main templ.Component) {
<script src="/static/order.js"></script>
</head>
<body>
<header class="topnav">
<h1>{ title }</h1>
<header>
<nav>
<a href="/orders" hx-get="/orders" hx-target="#main" hx-swap="outerHTML" hx-push-url="true">
<a href="/orders" hx-boost="true" hx-target="main" hx-select="main" hx-select-oob="title" hx-swap="outerHTML">
<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">
<a href="/cakes" hx-boost="true" hx-target="main" hx-select="main" hx-select-oob="title" hx-swap="outerHTML">
<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">
<a href="/blocked" hx-boost="true" hx-target="main" hx-select="main" hx-select-oob="title" hx-swap="outerHTML">
<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">
<a href="/order" class="cta" hx-boost="true" hx-target="main" hx-select="main" hx-select-oob="title" hx-swap="outerHTML">
<span class="material-symbols-outlined">add</span>
<span>Nowe zamówienie</span>
</a>
</header>
<main id="main">
<div class="main-content">
@main
</div>
<main>
@main
</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>
<title>{ title }</title>
<main>
@main
</main>
}