68 lines
1.8 KiB
Go Template
68 lines
1.8 KiB
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>
|
|
<section>
|
|
<h2>Your wishlist</h2>
|
|
{{with .Gifts}}
|
|
<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 .}}
|
|
<li>
|
|
<label>
|
|
<input type="checkbox" name="gift" value="{{.Id}}">
|
|
{{.Name}}
|
|
</label>
|
|
</li>
|
|
{{end}}
|
|
</ul>
|
|
</form>
|
|
{{else}}
|
|
<p>Your list is empty. Think of some things to add!</p>
|
|
{{end}}
|
|
<form method="post" action="/wishlist/add">
|
|
<input name="gift_name" required>
|
|
<button type="submit">Add gift idea</button>
|
|
</form>
|
|
</section>
|
|
{{with .Todo}}
|
|
<section>
|
|
<h2>Your todo list</h2>
|
|
<form method="post" action="/todo/update"
|
|
onchange="acceptNames(this, 'unclaimSubmit', 'gift'); acceptNames(this, 'completeSubmit', 'gift')"
|
|
autocomplete="off">
|
|
<button id="unclaimSubmit" type="submit" name="mode" value="unclaim" disabled>Unclaim</button>
|
|
<button id="completeSubmit" type="submit" name="mode" value="complete" disabled>Complete</button>
|
|
<ul>
|
|
{{range .}}
|
|
<li>
|
|
<label>
|
|
{{if .Sent}}
|
|
<input type="checkbox" disabled>
|
|
{{else}}
|
|
<input type="checkbox" name="gift" value="{{.Id}}">
|
|
{{end}}
|
|
<em>
|
|
{{if .Sent}}
|
|
<s>{{.Name}}</s>
|
|
{{else}}
|
|
{{.Name}}
|
|
{{end}}
|
|
</em> for <a href="/{{.RecipientRef}}">{{.RecipientName}}</a>
|
|
</label>
|
|
</li>
|
|
{{end}}
|
|
</ul>
|
|
</form>
|
|
</section>
|
|
{{end}}
|
|
{{end}} |