mock shop page: can set count
This commit is contained in:
+33
-8
@@ -35,14 +35,16 @@
|
||||
listingID,
|
||||
name,
|
||||
sku,
|
||||
description
|
||||
description,
|
||||
count
|
||||
)
|
||||
send hide to #new-listing-form
|
||||
send show(
|
||||
listingID: listingID,
|
||||
name: name,
|
||||
sku: sku,
|
||||
description: description
|
||||
description: description,
|
||||
count: count
|
||||
) to #edit-listing-form
|
||||
|
||||
on startEditingNewListing
|
||||
@@ -72,6 +74,7 @@
|
||||
set the value of the first <input[name='name']/> in me to ''
|
||||
set the value of the first <input[name='sku']/> in me to ''
|
||||
set the value of the first <input[name='description']/> in me to ''
|
||||
set the value of the first <input[name='count']/> in me to '0'
|
||||
on show
|
||||
remove .hidden from me
|
||||
remove @disabled from <button#save-as-new-listing-button/>
|
||||
@@ -87,7 +90,6 @@
|
||||
type="text"
|
||||
name="name"
|
||||
required
|
||||
minlength="5"
|
||||
placeholder="What's in a name..."
|
||||
class="bg-accent p-[0.25em] rounded-sm"
|
||||
/>
|
||||
@@ -107,10 +109,20 @@
|
||||
type="text"
|
||||
name="description"
|
||||
required
|
||||
minlength="10"
|
||||
placeholder="Anything will do..."
|
||||
class="bg-accent p-[0.25em] rounded-sm"
|
||||
/>
|
||||
<label for="count" class="self-center">
|
||||
Count:
|
||||
</label>
|
||||
<input
|
||||
type="number"
|
||||
name="count"
|
||||
required
|
||||
class="bg-accent p-[0.25em] rounded-sm"
|
||||
value="0"
|
||||
min="0"
|
||||
/>
|
||||
{{ component "button"
|
||||
"Text" "Save"
|
||||
"Class" "self-center p-[1em] col-span-2"
|
||||
@@ -141,11 +153,13 @@
|
||||
set the value of the first <input[name='name']/> in me to ''
|
||||
set the value of the first <input[name='sku']/> in me to ''
|
||||
set the value of the first <input[name='description']/> in me to ''
|
||||
set the value of the first <input[name='count']/> in me to ''
|
||||
on show(
|
||||
listingID,
|
||||
name,
|
||||
sku,
|
||||
description
|
||||
description,
|
||||
count
|
||||
)
|
||||
set :listingID to listingID
|
||||
remove .hidden from me
|
||||
@@ -155,6 +169,7 @@
|
||||
set the value of the first <input[name='name']/> in me to name
|
||||
set the value of the first <input[name='sku']/> in me to sku
|
||||
set the value of the first <input[name='description']/> in me to description
|
||||
set the value of the first <input[name='count']/> in me to count
|
||||
set the innerHTML of the <h3/> in me to ('Editing: ' + name)
|
||||
"
|
||||
>
|
||||
@@ -168,7 +183,6 @@
|
||||
type="text"
|
||||
name="name"
|
||||
required
|
||||
minlength="5"
|
||||
placeholder="What's in a name..."
|
||||
class="bg-accent p-[0.25em] rounded-sm"
|
||||
/>
|
||||
@@ -188,10 +202,20 @@
|
||||
type="text"
|
||||
name="description"
|
||||
required
|
||||
minlength="10"
|
||||
placeholder="Anything will do..."
|
||||
class="bg-accent p-[0.25em] rounded-sm"
|
||||
/>
|
||||
<label for="count" class="self-center">
|
||||
Count:
|
||||
</label>
|
||||
<input
|
||||
type="number"
|
||||
name="count"
|
||||
required
|
||||
class="bg-accent p-[0.25em] rounded-sm"
|
||||
value="0"
|
||||
min="0"
|
||||
/>
|
||||
<input
|
||||
type="hidden"
|
||||
name="listingID"
|
||||
@@ -310,7 +334,8 @@
|
||||
listingID: '{{$listing.ListingID}}',
|
||||
name: '{{$listing.Name}}',
|
||||
sku: '{{$listing.SKU}}',
|
||||
description: '{{$listing.Description}}'
|
||||
description: '{{$listing.Description}}',
|
||||
count: '{{$listing.Count}}'
|
||||
) to #listings-container
|
||||
send reset() to <li/> in the closest <ul/>
|
||||
add .border-foreground to me
|
||||
|
||||
Reference in New Issue
Block a user