lishwist/templates/home.gotmpl

30 lines
727 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="this.mode.disabled = !someChecked(this.gift)"
autocomplete="off">
<button type="submit" name="mode" value="delete" disabled>Delete</button>
<ul>
{{range .Gifts}}
<li>
<input type="checkbox" name="gift" value="{{.Id}}">
{{.Name}}
</li>
{{end}}
</ul>
</form>
<form method="post" action="/wishlist/add">
<input name="gift_name" required>
<input type="submit">
</form>
{{end}}