updated templater library; added accordion component
This commit is contained in:
+2
-1
@@ -7,7 +7,8 @@
|
||||
"HXSwap" "none"
|
||||
"HXSelect" "#accounts-acct-id-inventory-sync-groups-mock-draft-table"
|
||||
"ID" "sync-groups-mock-draft-table-add-listing-button"
|
||||
"Class" "mt-[1em] mb-[1em]"
|
||||
"Class" ""
|
||||
"Style" ""
|
||||
"Text" "Add Listing"
|
||||
"_" `
|
||||
on click
|
||||
|
||||
+11
-4
@@ -2,17 +2,23 @@
|
||||
|
||||
|
||||
{{- $acctID := .PathParams.acctID }}
|
||||
{{- $listings := .Accounts.GetMockSyncGroupListingDrafts $acctID }}
|
||||
|
||||
|
||||
<table
|
||||
id="accounts-acct-id-inventory-sync-groups-mock-draft-table"
|
||||
class="max-w-full overflow-x-auto"
|
||||
class="
|
||||
max-w-full overflow-x-auto
|
||||
|
||||
grid-table-6
|
||||
max-h-[50vh]
|
||||
"
|
||||
hx-get="{{ printf "/ui/accounts/%d/inventory/sync-groups/mock/draft/table" $acctID }}"
|
||||
hx-trigger="sse:{{ printf "accounts_%d_inventory_sync-groups_mock_draft" $acctID }},sse:{{ printf "accounts_%d_inventory_sync-groups_mock_draft_listings" $acctID }}"
|
||||
hx-select="#accounts-acct-id-inventory-sync-groups-mock-draft-table"
|
||||
hx-swap="morph:outerHTML"
|
||||
>
|
||||
<thead>
|
||||
<thead class="sticky top-0">
|
||||
<tr>
|
||||
<th>
|
||||
Shop
|
||||
@@ -58,14 +64,14 @@
|
||||
send setDisabled(disabled: not allRowsFilledOut or numRows < 2) to #create-mock-sync-group-button
|
||||
"
|
||||
>
|
||||
{{- $listings := .Accounts.GetMockSyncGroupListingDrafts $acctID }}
|
||||
{{- range $listing := $listings }}
|
||||
{{- component (printf "accounts/%d/inventory/sync-groups/mock/draft/listings/%d" $acctID $listing.OrderIndex)
|
||||
"Listings" $listings
|
||||
}}
|
||||
{{- end }}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
{{- if gt (len $listings) 5 }}
|
||||
<tfoot class="sticky bottom-0 outline-1 outline-(--table-tfoot)">
|
||||
<tr>
|
||||
<th>
|
||||
Shop
|
||||
@@ -87,6 +93,7 @@
|
||||
</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
{{- end }}
|
||||
</table>
|
||||
|
||||
{{/*
|
||||
|
||||
+2
-1
@@ -18,8 +18,9 @@
|
||||
|
||||
{{ component "button"
|
||||
"ID" "create-mock-sync-group-button"
|
||||
"Class" "mt-[1em] mb-[1em]"
|
||||
"Text" "Save Sync Group"
|
||||
"Class" ""
|
||||
"Style" ""
|
||||
"Disabled" (or (not $enoughListings) (not $allCompleted))
|
||||
"_" `
|
||||
on setDisabled(disabled)
|
||||
|
||||
Reference in New Issue
Block a user