catalogue in a template

This commit is contained in:
bronku 2025-04-06 16:06:14 +02:00
parent 280c6a92ab
commit 0edd3eb9b1

View file

@ -52,16 +52,23 @@
</div>
{{end}}
{{with .Catalogue}}
<div >
<div>
<h2>Katalog</h2>
<ul class="scrollable">
{{range .}}
<li>
{{.Name}} {{.Price}}
<button type=button onClick="addCake({{.ID}},'{{.Name}} ({{.Price}}PLN)', 1)">dodaj</button>
</li>
{{end}}
</ul>
<div class="scrollable">
<table>
{{range .}}
<tr>
<th>{{.Name}}<br><small>{{.Category}}</small></th>
<th>{{.Price}}PLN</th>
<th>
<button type=button onClick="addCake({{.ID}},'{{.Name}} ({{.Price}}PLN)', 1)">
<i class="fa-solid fa-plus"></i>
</button>
</th>
</tr>
{{end}}
</table>
</div>
</div>
{{end}}
</form>