not really working
This commit is contained in:
parent
8081d61f2f
commit
56fff533f2
3 changed files with 53 additions and 14 deletions
65
order.html
Normal file
65
order.html
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
<header>
|
||||
<h1>New Order</h1>
|
||||
</header>
|
||||
<nav>
|
||||
<a href="/">back</a>
|
||||
</nav>
|
||||
<main>
|
||||
<form method="post">
|
||||
{{with .Order}}
|
||||
<div>
|
||||
<h2>Info</h2>
|
||||
<input hidden="true" name="id" value="{{.ID}}">
|
||||
<label>name</label>
|
||||
<input type="text" name="name" value="{{.Name}}">
|
||||
<label>surname</label>
|
||||
<input type="text" name="surname" value="{{.Surname}}">
|
||||
<label>phone</label>
|
||||
<input type="tel" name="phone" value="{{.Phone}}">
|
||||
<label>location</label>
|
||||
<select name="location">
|
||||
<option value="Kartuzy">Kartuzy</option>
|
||||
<option value="Somonino">Somonino</option>
|
||||
</select>
|
||||
<label>date</label>
|
||||
<input type="date" name="date" value="{{.Date.Format "2006-01-02"}}">
|
||||
<label>paid</label>
|
||||
<input type="number" name="paid" min="0" value="{{.Paid}}">
|
||||
</div>
|
||||
<div>
|
||||
<h2>Basket</h2>
|
||||
<ul>
|
||||
{{range .Cakes}}
|
||||
<li>
|
||||
<label>{{.Name}} {{.Price}}</label>
|
||||
<input id="cake[{{.ID}}]" type="number" min="0" name="cake[{{.ID}}]" value="{{.Amount}}">
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
{{end}}
|
||||
{{with .Catalogue}}
|
||||
<div>
|
||||
<h2>Catalogue</h2>
|
||||
<ul>
|
||||
{{range .}}
|
||||
<li>
|
||||
{{.Name}} {{.Price}} <button type=button onClick="addCake({{.ID}})">add</button>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
{{end}}
|
||||
<button type="submit">submit</button>
|
||||
</form>
|
||||
</main>
|
||||
|
||||
<script>
|
||||
function addCake(id){
|
||||
var cake = document.getElementById("cake["+id+"]")
|
||||
if (cake != null){
|
||||
return;
|
||||
}
|
||||
console.log(cake)
|
||||
}
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue