feat: empty list prompts
This commit is contained in:
parent
e90ca47c5d
commit
04647f3bcd
|
|
@ -7,13 +7,15 @@
|
|||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<h2>{{.Username}}'s list</h2>
|
||||
<form method="post" action="/{{.UserReference}}/update" autocomplete="off"
|
||||
<section>
|
||||
<h2>{{.Username}}'s list</h2>
|
||||
{{with .Gifts}}
|
||||
<form method="post" action="/{{$.UserReference}}/update" autocomplete="off"
|
||||
onchange="acceptNames(this, 'claimSubmit', 'claimed', 'unclaimed'); acceptNames(this, 'completeSubmit', 'claimed');">
|
||||
<button id="claimSubmit" type="submit" name="mode" value="claim" disabled>Claim/Unclaim</button>
|
||||
<button id="completeSubmit" type="submit" name="mode" value="complete" disabled>Complete</button>
|
||||
<ul>
|
||||
{{range .Gifts}}
|
||||
{{range .}}
|
||||
<li>
|
||||
<label>
|
||||
{{if .ClaimantId}}
|
||||
|
|
@ -41,5 +43,9 @@
|
|||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</form>
|
||||
</form>
|
||||
{{else}}
|
||||
<p>They haven't wished for anything. Ask them to think of some stuff!</p>
|
||||
{{end}}
|
||||
</section>
|
||||
{{end}}
|
||||
|
|
@ -10,11 +10,13 @@
|
|||
<pre>{{.Reference}}</pre>
|
||||
</dd>
|
||||
</dl>
|
||||
<h2>Your wishlist</h2>
|
||||
<form method="post" action="/wishlist/delete" onchange="acceptNames(this, 'deleteSubmit', 'gift')" autocomplete="off">
|
||||
<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 .Gifts}}
|
||||
{{range .}}
|
||||
<li>
|
||||
<label>
|
||||
<input type="checkbox" name="gift" value="{{.Id}}">
|
||||
|
|
@ -23,18 +25,25 @@
|
|||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</form>
|
||||
<form method="post" action="/wishlist/add">
|
||||
</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>
|
||||
<h2>Your todo list</h2>
|
||||
<form method="post" action="/todo/update"
|
||||
onchange="acceptNames(this, 'unclaimSubmit', 'gift'); acceptNames(this, 'completeSubmit', 'gift')" autocomplete="off">
|
||||
</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 .Todo}}
|
||||
{{range .}}
|
||||
<li>
|
||||
<label>
|
||||
{{if .Sent}}
|
||||
|
|
@ -53,5 +62,7 @@
|
|||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</form>
|
||||
</form>
|
||||
</section>
|
||||
{{end}}
|
||||
{{end}}
|
||||
Loading…
Reference in New Issue