This commit is contained in:
bronku 2026-06-10 22:14:48 +02:00
parent 7c756e87c1
commit d69d8c3857
24 changed files with 3421 additions and 859 deletions

View file

@ -1,37 +1,73 @@
{{define "title"}}
Ciasta
Katalog
{{end}}
{{define "main"}}
<main>
<div class="toolbar">
<a href="/cake" class="btn-primary">
<i class="fa-solid fa-plus"></i>
<section class="card">
<div class="card-header">
<h2>
<span class="material-symbols-outlined">inventory_2</span>
Zarządzanie katalogiem
</h2>
<a href="/cake" class="btn btn-primary btn-sm">
<span class="material-symbols-outlined">add</span>
Nowe ciasto
</a>
</div>
<div id="results-table" class="scrollable">
<table>
<div class="table-container">
<table class="data-table">
<thead>
<tr>
<th></th>
<th style="width:32px"></th>
<th>Nazwa</th>
<th>Cena</th>
<th>SKU</th>
<th class="right">Cena bazowa</th>
<th>Kategoria</th>
<th>Dostępność</th>
<th class="center"></th>
</tr>
</thead>
<tbody>
{{range .}}
<tr>
<th><a href="/cake/{{.ID}}">Edytuj</a></th>
<th>{{.Name}}</th>
<th>{{.Price}} PLN</th>
<th>{{.Category}}</th>
<th>{{.Availability}}</th>
<td>
<div class="catalogue-item-icon icon-cake" style="width:28px;height:28px">
<span class="material-symbols-outlined" style="font-size:14px">cake</span>
</div>
</td>
<td style="font-weight:500">{{.Name}}</td>
<td class="text-on-surface-variant">#{{.ID}}</td>
<td class="text-right">{{.Price}} PLN</td>
<td>
<span class="badge-pill {{if eq .Category "common"}}signature{{else}}seasonal{{end}}">
{{if eq .Category "common"}}Zwykłe
{{else if eq .Category "christmas"}}Bożonarodzeniowe
{{else if eq .Category "easter"}}Wielkanocne
{{else if eq .Category "donuts"}}Pączki
{{else}}{{.Category}}{{end}}
</span>
</td>
<td>{{if eq .Availability "available"}}Dostępne{{else}}Niedostępne{{end}}</td>
<td class="text-center">
<a href="/cake/{{.ID}}" class="action-btn">
<span class="material-symbols-outlined">edit</span>
</a>
</td>
</tr>
{{end}}
</tbody>
</table>
</div>
</main>
<div class="table-footer">
<span>Pokazuje 1-{{len .}} z {{len .}}</span>
<div class="pagination">
<button class="pagination-btn" disabled>
<span class="material-symbols-outlined">chevron_left</span>
</button>
<button class="pagination-btn active">1</button>
<button class="pagination-btn" disabled>
<span class="material-symbols-outlined">chevron_right</span>
</button>
</div>
</div>
</section>
{{end}}