100 lines
3.8 KiB
Text
100 lines
3.8 KiB
Text
{{define "title"}}
|
|
{{if .Order.ID}}
|
|
Edytuj zamówienie #{{.Order.ID}}
|
|
{{else}}
|
|
Nowe zamówienie
|
|
{{end}}
|
|
{{end}}
|
|
{{define "main"}}
|
|
<main>
|
|
<form method="post" class="order">
|
|
{{with .Order}}
|
|
<div class="order-contents">
|
|
<div>
|
|
<h2>Dane zamówienia</h2>
|
|
<label>
|
|
<input hidden="hidden" name="id" value="{{.ID}}">
|
|
</label>
|
|
<label>Imię
|
|
<input type="text" name="name" value="{{.Name}}">
|
|
</label>
|
|
<label>Nazwisko
|
|
<input type="text" name="surname" value="{{.Surname}}">
|
|
</label>
|
|
<label>Numer telefonu
|
|
<input type="tel" name="phone" value="{{.Phone}}">
|
|
</label>
|
|
<label>Lokalizacja
|
|
<select name="location">
|
|
<option {{ if eq .Location "Kartuzy" }}selected{{ end }} value="Kartuzy">Kartuzy</option>
|
|
<option {{ if eq .Location "Somonino" }}selected{{ end }} value="Somonino">Somonino</option>
|
|
</select>
|
|
</label>
|
|
<label>Data dostawy
|
|
<input type="date" name="date" value="{{.Date.Format "2006-01-02"}}">
|
|
</label>
|
|
<label>Status
|
|
<select name="status">
|
|
<option {{ if eq .Status "accepted" }}selected{{ end }} value="accepted">accepted</option>
|
|
<option {{ if eq .Status "done" }}selected{{ end }} value="done">done</option>
|
|
</select>
|
|
</label>
|
|
<label>Zaliczka
|
|
<input type="number" name="paid" min="0" value="{{.Paid}}">
|
|
</label>
|
|
</div>
|
|
<div>
|
|
<h2>Dodane Ciasta</h2>
|
|
<div class="scrollable">
|
|
<table id="basket_table" >
|
|
</table>
|
|
</div>
|
|
<ul id="basket" class="scrollable">
|
|
</ul>
|
|
</div>
|
|
<button type="submit">Zapisz</button>
|
|
</div>
|
|
{{end}}
|
|
{{with .Catalogue}}
|
|
<div>
|
|
<h2>Katalog</h2>
|
|
<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>
|
|
</main>
|
|
<template id="basket_element_template">
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>
|
|
<label>
|
|
<input type="text">
|
|
</label>
|
|
</th>
|
|
<th>
|
|
<button type=button onClick="">
|
|
<i class="fa-solid fa-minus"></i>
|
|
</button>
|
|
</th>
|
|
</tr>
|
|
</template>
|
|
<script>
|
|
{{range .Order.Cakes}}
|
|
addCake({{.ID}},'{{.Name}} ({{.Price}}PLN)', {{.Amount}})
|
|
{{end}}
|
|
</script>
|
|
{{end}}
|