removed old components

This commit is contained in:
2026-01-13 22:48:09 -07:00
parent 7481cec0d5
commit 717956790f
14 changed files with 19 additions and 307 deletions
@@ -38,7 +38,7 @@
platform: event.target.value.replace(/-[^ ]*/, ""),
"shop-id": event.target.value.replace(/[^ ]*-/, "")
}'
hx-target="closest tr"
hx-target="#accounts-acct-id-inventory-sync-groups-draft-table"
hx-swap="outerHTML"
_="
on change
@@ -73,7 +73,7 @@
hx-vals='js:{
"listing-id": event.target.value,
}'
hx-target="closest tr"
hx-target="#accounts-acct-id-inventory-sync-groups-draft-table"
hx-swap="outerHTML"
_="
@@ -116,9 +116,9 @@
</td>
<td data-id="remove">
{{ componentBody "button-dev"
{{ componentBody "button"
"HXDelete" (printf "/api/accounts/%d/inventory/sync-groups/draft/listings/%d" $acctID $orderIndex)
"HXTarget" "closest tr"
"HXTarget" "#accounts-acct-id-inventory-sync-groups-draft-table"
"HXSwap" "outerHTML"
"Text" "Remove"
}}
@@ -14,7 +14,7 @@
{{- $stores := $dot.Accounts.GetShops $acctID -}}
<table id="inventory-table-2" class="max-w-full overflow-x-auto">
<table id="accounts-acct-id-inventory-sync-groups-draft-table" class="max-w-full overflow-x-auto">
<thead>
<tr>
<th>
@@ -1,46 +0,0 @@
{{- $dot := or .dot . }}
{{- $dot.Auth.ByMatchingAccountID 2 }}
{{- $acctID := $dot.Identity.Account.AccountID }}
{{- $stores := $dot.Accounts.GetShops $acctID -}}
<table id="inventory-table" class="max-w-full overflow-x-scroll">
<thead>
<tr>
{{- range $store := $stores }}
<th class="text-nowrap">
{{ $store.Platform }}: {{ $store.Name }}
</th>
<th class="text-nowrap">
Count
</th>
{{- end }}
<th>
</th>
</tr>
</thead>
<tbody>
{{- componentBody "accounts/{acctID}/inventory/sync-table/new-row" "dot" $dot }}
</tbody>
<tfoot>
<tr>
{{- range $store := $stores }}
<th class="text-nowrap">
{{ $store.Platform }}: {{ $store.Name }}
</th>
<th class="text-nowrap">
Count
</th>
{{- end }}
<th>
</th>
</tr>
</tfoot>
</table>
@@ -1,55 +0,0 @@
{{/* TODO: delete when done with the newer draft */}}
{{- $dot := or .dot .}}
{{- $dot.Auth.ByMatchingAccountID 2 }}
{{- $acctID := $dot.Identity.Account.AccountID }}
{{- $shops := $dot.Accounts.GetShops $acctID -}}
<tr>
{{- range $shop := $shops }}
<td>
<select
class="min-w-fit cursor-pointer"
_="
on change
set dataset to the dataset of the first of my selectedOptions
set listingShowcase to the <#listing-showcase/>
if <#listing-showcase/> then
send displayListing(
id: dataset.id,
name: dataset.name,
description: dataset.description,
count: dataset.count
) to listingShowcase
end
set the innerHTML of the next <td/> to the dataset.count
"
>
<option disabled selected>- Listings -</option>
{{/*- $listings := $dot.Accounts.GetListingsForShop $acctID $shop.ShopID }}
{{- range $listing := $listings }}
<option
value="{{$listing.ListingID}}"
data-id="{{$listing.ListingID}}"
data-name="{{$listing.Name}}"
data-description="{{$listing.Description}}"
data-count="{{$listing.Count}}"
>
{{ $listing.Name }}
</option>
{{- end */}}
</select>
</td>
<td>
</td>
{{- end }}
<td>
<button class="cursor-pointer underline w-full">
Save
</button>
</td>
</tr>
@@ -1,40 +0,0 @@
<table class="max-w-full"
id="listing-showcase"
_="
on displayListing(id, name, description, count)
set innerHTML of <#listing-showcase-id/> to id
set innerHTML of <#listing-showcase-name/> to name
set innerHTML of <#listing-showcase-description/> to description
set innerHTML of <#listing-showcase-count/> to count
"
>
<thead>
<th>
ID
</th>
<th>
Name
</th>
<th>
Description
</th>
<th>
Count
</th>
</thead>
<tbody>
<th id="listing-showcase-id">
-
</th>
<th id="listing-showcase-name">
-
</th>
<th id="listing-showcase-description">
-
</th>
<th id="listing-showcase-count">
-
</th>
</tbody>
</table>
@@ -1,70 +0,0 @@
{{/* TODO: delete, once not needed */}}
{{/* "dot" . */}}
<nav
style="
margin: 0;
padding: 1em;
background-color: #bdf;
font-size: 1.25em;
display: flex;
flex-direction: column;
align-items: center;
"
>
<ul>
<li>
<a href="/ui">
Home
</a>
</li>
{{/* */}}
{{- $userID := .dot.Identity.User.UserID }}
{{- $acct := .dot.Identity.Account }}
{{- $acctID := 0 }}
{{- if $acct }}
{{- $acctID = $acct.AccountID }}
{{- end }}
{{- if not $userID }}
<li>
<a href="/api/auth/login">
Log In / Sign Up
</a>
</li>
{{- else if $acctID }}
<li>
<a href="/ui/accounts/{{$acctID}}">
Account
</a>
</li>
<li>
<a href="/ui/accounts/{{$acctID}}/reports">
Reports
</a>
</li>
<li>
<a href="/ui/accounts/{{$acctID}}/inventory">
Inventory
</a>
</li>
<li>
<a href="/api/auth/logout">
Log Out
</a>
</li>
{{- end }}
</ul>
</nav>