mock shop sync group listing draft page
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
{{- $stores := .Accounts.GetShops $acctID -}}
|
||||
|
||||
|
||||
{{- define "title" }} Inventory++ {{ end }}
|
||||
{{- define "title" }} Manage Inventory ⋅ Inventory++ {{ end }}
|
||||
|
||||
<h1 class="text-center mb-[0.5em]">Inventory</h1>
|
||||
|
||||
|
||||
@@ -4,22 +4,70 @@
|
||||
{{- $stores := .Accounts.GetShops $acctID -}}
|
||||
|
||||
|
||||
{{- define "title" }} Inventory++ {{ end }}
|
||||
{{- define "title" }} Manage Mock Inventory ⋅ Inventory++ {{ end }}
|
||||
|
||||
<h1 class="text-center mb-[0.5em]">Inventory</h1>
|
||||
|
||||
<h2 class="text-center mb-[0.5em]">Synced Listings</h2>
|
||||
<section class="py-[2em] flex flex-col items-center">
|
||||
<details
|
||||
class="
|
||||
group
|
||||
|
||||
<section class="w-full flex flex-col items-center">
|
||||
<h3 class="mb-[1.25rem]">
|
||||
Create a Sync Group
|
||||
</h3>
|
||||
{{/*
|
||||
{{ component (printf "accounts/%d/inventory/sync-groups/draft/table" $acctID) }}
|
||||
flex
|
||||
flex-col
|
||||
items-center
|
||||
|
||||
<div>
|
||||
{{ component (printf "accounts/%d/inventory/sync-groups/draft/table/add-listing-button" $acctID) }}
|
||||
{{ component (printf "accounts/%d/inventory/sync-groups/draft/table/save-sync-group-button" $acctID) }}
|
||||
</div>
|
||||
*/}}
|
||||
{{/* TODO: make custom class for all this */}}
|
||||
details-content:opacity-[0]
|
||||
open:details-content:opacity-[1]
|
||||
|
||||
details-content:transform-[translate(0px,-2em)]
|
||||
open:details-content:transform-[translate(0px,0px)]
|
||||
|
||||
details-content:border-transparent
|
||||
open:details-content:border-dotted
|
||||
open:details-content:border-x-[0px]
|
||||
open:details-content:border-x-transparent
|
||||
open:details-content:border-b-[0px]
|
||||
open:details-content:border-b-transparent
|
||||
open:details-content:border-t-background
|
||||
open:details-content:border-t-[0.25rem]
|
||||
details-content:outline-transparent
|
||||
|
||||
details-content:transition-[opacity_transform]
|
||||
"
|
||||
hx-preserve
|
||||
open
|
||||
>
|
||||
|
||||
<summary
|
||||
class="
|
||||
flex
|
||||
items-center
|
||||
gap-[1em]
|
||||
list-none
|
||||
p-[1em]
|
||||
mb-[1em]
|
||||
cursor-pointer
|
||||
bg-accent
|
||||
rounded-lg
|
||||
|
||||
after:content-['+']
|
||||
group-open:after:content-['-']
|
||||
after:font-bold
|
||||
after:text-[2em]
|
||||
after:leading-[1em]
|
||||
"
|
||||
>
|
||||
<h2 class="inline-block">
|
||||
New Sync Group
|
||||
</h2>
|
||||
</summary>
|
||||
|
||||
{{ component (printf "accounts/%d/inventory/sync-groups/mock/draft/table" $acctID) }}
|
||||
|
||||
<div class="flex justify-center gap-[0.5em]">
|
||||
{{ component (printf "accounts/%d/inventory/sync-groups/mock/draft/table/add-listing-button" $acctID) }}
|
||||
{{ component (printf "accounts/%d/inventory/sync-groups/mock/draft/table/save-sync-group-button" $acctID) }}
|
||||
</div>
|
||||
</details>
|
||||
</section>
|
||||
|
||||
+6
-5
@@ -14,8 +14,8 @@
|
||||
|
||||
<section
|
||||
id="listing-section"
|
||||
hx-get={{ printf "/ui/accounts/%d/platforms/amazon/shops/mocks/%s" $acctID $shopID }}
|
||||
hx-trigger={{ printf "sse:accounts_%d_platforms_amazon_shops_mocks_%s_listings" $acctID $shopID }}
|
||||
hx-get={{ printf "/ui/accounts/%d/platforms/%s/shops/mocks/%s" $acctID .PathParams.platform $shopID }}
|
||||
hx-trigger={{ printf "sse:accounts_%d_platforms_%s_shops_mocks_%s_listings" $acctID .PathParams.platform $shopID }}
|
||||
hx-select="#listing-section"
|
||||
>
|
||||
<header class="p-[1em]">
|
||||
@@ -55,7 +55,7 @@
|
||||
>
|
||||
<form
|
||||
id="new-listing-form"
|
||||
hx-post={{ printf "/api/accounts/%d/platforms/amazon/shops/mocks/%s/listings" $acctID $shopID }}
|
||||
hx-post={{ printf "/api/accounts/%d/platforms/%s/shops/mocks/%s/listings" $acctID .PathParams.platform $shopID }}
|
||||
hx-swap="none"
|
||||
class="
|
||||
grid
|
||||
@@ -132,7 +132,7 @@
|
||||
|
||||
<form
|
||||
id="edit-listing-form"
|
||||
hx-put={{ printf "/api/accounts/%d/platforms/amazon/shops/mocks/%s/listings/{listingID}" $acctID $shopID }}
|
||||
hx-put={{ printf "/api/accounts/%d/platforms/%s/shops/mocks/%s/listings/{listingID}" $acctID .PathParams.platform $shopID }}
|
||||
hx-swap="none"
|
||||
class="
|
||||
grid
|
||||
@@ -316,6 +316,7 @@
|
||||
</form>
|
||||
|
||||
<ul class="max-h-[80vh] overflow-y-auto flex flex-col gap-[1em]">
|
||||
{{- $dot := . }}
|
||||
{{- range $listing := .Accounts.ListMockListingsForShop $acctID $platform $shopID }}
|
||||
<li
|
||||
id="listing-{{$listing.ListingID}}"
|
||||
@@ -387,7 +388,7 @@
|
||||
{{ component "button"
|
||||
"Title" "Delete Listing"
|
||||
"Text" (rawHTML "🗑")
|
||||
"HXDelete" (printf "/api/accounts/%d/platforms/amazon/shops/mocks/%s/listings/%s" $acctID $shopID $listing.ListingID)
|
||||
"HXDelete" (printf "/api/accounts/%d/platforms/%s/shops/mocks/%s/listings/%s" $acctID $dot.PathParams.platform $shopID $listing.ListingID)
|
||||
"_" "on click event.preventDefault() then event.stopPropagation()"
|
||||
}}
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user