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