updated templater library

This commit is contained in:
2026-01-19 11:13:16 -07:00
parent 690923efb3
commit af903512be
9 changed files with 69 additions and 221 deletions
@@ -1,12 +1,8 @@
{{/* TODO: make the save button disabled based on an api call */}}
{{/* .Identity.Account.AccountID, .Accounts */}}
{{- $dot := or .dot . -}}
{{- $acctID := $dot.Identity.Account.AccountID }}
{{- $orderIndex := or $dot.OrderIndex (parseInt $dot.PathParams.orderIndex) -}}
{{- $entry := $dot.Accounts.GetSyncGroupListingDraft $acctID $orderIndex }}
{{- $acctID := .PathParams.acctID }}
{{- $orderIndex := .PathParams.orderIndex }}
{{- $entry := .Accounts.GetSyncGroupListingDraft $acctID $orderIndex }}
{{- $selectedShopPlatform := $entry.Platform }}
{{- $selectedShopID := $entry.ShopID }}
{{- $selectedListingID := $entry.ListingID }}
@@ -30,7 +26,7 @@
"
>
<td>
{{- $shops := $dot.Accounts.GetShops $acctID -}}
{{- $shops := .Accounts.GetShops $acctID -}}
<select
class="min-w-fit cursor-pointer"
hx-put="/api/accounts/{{$acctID}}/inventory/sync-groups/draft/listings/{{$orderIndex}}/shop"
@@ -64,7 +60,7 @@
<td>
{{- $selectedListing := "" }}
{{- if $selectedShopID }}
{{- $listings := $dot.Accounts.GetListingsForShop $acctID $selectedShopPlatform $selectedShopID }}
{{- $listings := .Accounts.GetListingsForShop $acctID $selectedShopPlatform $selectedShopID }}
{{- if $listings }}
<select
class="min-w-fit cursor-pointer"
@@ -1,17 +1,8 @@
{{- $dot := or .dot . }}
{{- .Auth.ByMatchingAccountID 2 }}
{{- $acctID := 0 }}
{{- if $dot.Identity }}
{{- $acctID = $dot.Identity.Account.AccountID }}
{{- else if .PathParams }}
{{- $acctID = $dot.PathParams.acctID | parseInt64 }}
{{- else }}
{{- $acctID = $dot.AccountID }}
{{- end }}
{{- $stores := $dot.Accounts.GetShops $acctID -}}
{{- $acctID := .PathParams.acctID }}
{{- $stores := .Accounts.GetShops $acctID -}}
<table id="accounts-acct-id-inventory-sync-groups-draft-table" class="max-w-full overflow-x-auto">
@@ -58,11 +49,9 @@
send setDisabled(disabled: not allRowsFilledOut or numRows < 2) to #create-sync-group-button
"
>
{{- $listings := $dot.Accounts.GetSyncGroupListingDrafts $acctID }}
{{- $listings := .Accounts.GetSyncGroupListingDrafts $acctID }}
{{- range $listing := $listings }}
{{- component "accounts/{acctID}/inventory/sync-groups/draft/listings/{orderIndex}"
"dot" ($dot | addPathParam "orderIndex" $listing.OrderIndex)
}}
{{- component (printf "accounts/%d/inventory/sync-groups/draft/listings/%d" $acctID $listing.OrderIndex) }}
{{- end }}
</tbody>
<tfoot>