lishwist/templates/home.gotmpl

31 lines
773 B
Go Template

{{define "body"}}
<p>Logged in as '{{.Username}}'</p>
<form method="post" action="/logout">
<input type="submit" value="Logout">
</form>
<h1>Lishwist</h1>
<dl>
<dt>User reference:</dt>
<dd>
<pre>{{.Reference}}</pre>
</dd>
</dl>
<h2>Your list</h2>
<form method="post" action="/wishlist/delete" onchange="acceptNames(this, 'deleteSubmit', 'gift')" autocomplete="off">
<button id="deleteSubmit" type="submit" name="mode" value="delete" disabled>Delete</button>
<ul>
{{range .Gifts}}
<li>
<label>
<input type="checkbox" name="gift" value="{{.Id}}">
{{.Name}}
</label>
</li>
{{end}}
</ul>
</form>
<form method="post" action="/wishlist/add">
<input name="gift_name" required>
<input type="submit">
</form>
{{end}}