rudimentary form

This commit is contained in:
bronku 2026-11-08 15:40:41 +01:00
parent eab2134685
commit b86f7f6ea0
7 changed files with 121 additions and 23 deletions

View file

@ -2,18 +2,14 @@ package html
import "piekarnikgosipl/types"
// templ card-swieta(product types.Product) {
// <div class="card">
// <div>
// @AvifImage("wyroby/"+product.Image+".avif", product.Name, true)
// </div>
// <div>
// <h3>{ product.Name }</h3>
// <span>{ product.Price }zł</span>
// <p>{ product.Description }</p>
// </div>
// </div>
// }
templ product_form(product types.Product) {
<div>
<span>{product.Name} <span> · {product.Price} zł</span></span>
<button type="button" onClick={templ.JSFuncCall("decrease", product.Id)}> - </button>
<input id={product.Id} value="0" type="number" min="0" max="100"/>
<button type="button" onClick={templ.JSFuncCall("increase", product.Id)}> + </button>
</div>
}
templ Swieta(products []types.Product) {
<main tabindex="-1" id="swieta">
@ -47,5 +43,19 @@ templ Swieta(products []types.Product) {
<p>Zamówienia można złożyć telefonicznie <a href="tel:+48690214515">690 214 515</a><br>lub osobiście w kawiarnii</p>
</div>
</section>
<section id="order-form">
<h2>Złóż zamówienie</h2>
<p>Odbiór wszystkich zamówień: <b>24 grudnia</b>. Zamówienia przyjmujemy do <b>25 grudnia</b>. Potwierdzimy zamówienie telefonicznie.</p>
<form>
<fieldset>
for _, product := range products {
@product_form(product)
}
</fieldset>
<input type="text" placeholder="Imie i Nazwisko"/>
<input type="tel" placeholder="Numer Telefonu"/>
<button type="submit">Wyślij zamówienie</button>
</form>
</section>
</main>
}