69 lines
2.1 KiB
Text
69 lines
2.1 KiB
Text
package html
|
|
|
|
import "piekarnikgosipl/types"
|
|
|
|
func step(in types.Product ) string {
|
|
if in.Halveable {
|
|
return "0.5"
|
|
}
|
|
return "1"
|
|
}
|
|
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 name={product.Id} id={product.Id} value="0" type="number" step={step(product)} 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">
|
|
<header>
|
|
<div>
|
|
<span>✦ BOŻE NARODZENIE 2026 ✦</span>
|
|
<h1>Święta smakują domowo</h1>
|
|
<p>
|
|
Tradycyjne świąteczne wypieki z naszej pracowni. Z naturalnych składników, według rodzinnych receptur.
|
|
</p>
|
|
</div>
|
|
</header>
|
|
<section>
|
|
<h2>Święteczne Słodkości</h2>
|
|
<div id="wyroby" class="swieta">
|
|
for _, product:= range products {
|
|
@card(product)
|
|
}
|
|
</div>
|
|
</section>
|
|
<section id="additional-info">
|
|
<h2>Informacje odnośnie zamówień świątecznych</h2>
|
|
<div class="card">
|
|
<span>ODBIÓR ZAMÓWIEŃ</span>
|
|
<h3>24 grudnia (wigilia)</h3>
|
|
<p>Wszystkie zamówienia wydajemy w wigilię w Kawiarnii</p>
|
|
</div>
|
|
<div class="card">
|
|
<span>ZAMÓWIENIA PRZYJMUJEMY DO</span>
|
|
<h3>15 grudnia</h3>
|
|
<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">
|
|
<div>
|
|
<h2>Złóż zamówienie</h2>
|
|
<p>Odbiór wszystkich zamówień: <b>24 grudnia</b>. Zamówienia przyjmujemy do <b>15 grudnia</b>. Potwierdzimy zamówienie telefonicznie.</p>
|
|
<form method="post" action="/order" >
|
|
<fieldset>
|
|
for _, product := range products {
|
|
@product_form(product)
|
|
}
|
|
</fieldset>
|
|
<input name="name" type="text" required placeholder="Imie i Nazwisko"/>
|
|
<input name="phone" type="tel" required placeholder="Numer Telefonu"/>
|
|
<button type="submit">Wyślij zamówienie</button>
|
|
</form>
|
|
</div>
|
|
</section>
|
|
</main>
|
|
}
|