diff --git a/internal/server/api/accounts/router.go b/internal/server/api/accounts/router.go
index d019d0a..83eaa35 100644
--- a/internal/server/api/accounts/router.go
+++ b/internal/server/api/accounts/router.go
@@ -196,7 +196,7 @@ func (s *accountSubrouter) setOrderOfPlatformOnAccountPage(c *gin.Context) (resp
)
err := param.Path("platform", param.Platform(&platform)).
- Form("orderIndex", param.Int(&orderIndex)).
+ Form("order-index", param.Int(&orderIndex)).
Unmarshal(c)
if err != nil {
return nil, err
diff --git a/internal/server/ui/router.go b/internal/server/ui/router.go
index 28673c7..f709817 100644
--- a/internal/server/ui/router.go
+++ b/internal/server/ui/router.go
@@ -84,6 +84,9 @@ func Routes(
}
return strings.Join(us, " ")
},
+ "hasPrefix": func(s, prefix string) bool {
+ return strings.HasPrefix(s, prefix)
+ },
// arithmetic
"addInt": func(a, b int) int {
diff --git a/templates/components/accounts/{acctID.int64}/platforms/{platform}/link-section.html.tmpl b/templates/components/accounts/{acctID.int64}/platforms/{platform}/link-section.html.tmpl
deleted file mode 100644
index 3a08a3c..0000000
--- a/templates/components/accounts/{acctID.int64}/platforms/{platform}/link-section.html.tmpl
+++ /dev/null
@@ -1,182 +0,0 @@
-{{- $acctID := .PathParams.acctID }}
-{{- $platform := .PathParams.platform }}
-{{- $parsedPlatform := parsePlatform $platform }}
-
-
-
-
- Mock Shops
-
-
-
-
- {{- $shops := .Accounts.ListMockShopsForPlatform $acctID $parsedPlatform }}
- {{- range $shop := $shops }}
- -
-
- {{ $shop.Name }}
-
-
- {{- end }}
-
-
-
-
-
-
-
-
- Link Shops
-
-
-
- {{ component ( printf "/accounts/%d/platform-links/%s" $acctID $platform ) }}
-
diff --git a/templates/components/accounts/{acctID.int64}/platforms/{platform}/shops/link-section.html.tmpl b/templates/components/accounts/{acctID.int64}/platforms/{platform}/shops/link-section.html.tmpl
new file mode 100644
index 0000000..3382052
--- /dev/null
+++ b/templates/components/accounts/{acctID.int64}/platforms/{platform}/shops/link-section.html.tmpl
@@ -0,0 +1,85 @@
+{{/* [Mock: bool] */}}
+
+{{- $acctID := .PathParams.acctID }}
+{{- $platform := .PathParams.platform }}
+{{- $parsedPlatform := parsePlatform $platform }}
+
+
+{{- if .Mock }}
+
+ {{- $idPrefix := "mock-" }}
+
+ {{- $shops := .Accounts.ListMockShopsForPlatform $acctID $parsedPlatform }}
+ {{- if $shops }}
+
+ {{- end }}
+
+
+
+
+{{- else -}}
+
+
+ {{ component ( printf "/accounts/%d/platform-links/%s" $acctID $platform ) }}
+
+
+{{- end }}
diff --git a/templates/components/accounts/{acctID.int64}/platforms/{platform}/list-item.html.tmpl b/templates/components/accounts/{acctID.int64}/platforms/{platform}/shops/list-item.html.tmpl
similarity index 89%
rename from templates/components/accounts/{acctID.int64}/platforms/{platform}/list-item.html.tmpl
rename to templates/components/accounts/{acctID.int64}/platforms/{platform}/shops/list-item.html.tmpl
index 3566576..2c4a197 100644
--- a/templates/components/accounts/{acctID.int64}/platforms/{platform}/list-item.html.tmpl
+++ b/templates/components/accounts/{acctID.int64}/platforms/{platform}/shops/list-item.html.tmpl
@@ -1,3 +1,5 @@
+{{/* [Mock: bool] */}}
+
{{- $acctID := .Identity.Account.AccountID }}
{{- $platform := parsePlatform .PathParams.platform -}}
{{- $orderIndex := .OrderIndex }}
@@ -6,10 +8,13 @@
{{- end }}
+{{- $idPrefix := "" }}
+{{- if .Mock }}
+ {{- $idPrefix = "mock-" }}
+{{- end }}
{{- $platformSegment := lowerSnakeCase (printf "%s" $platform) }}
-{{- $updatePath := printf "/accounts/%d/platforms/%s/order-index" $acctID $platformSegment }}
will be NOT be updated by the response (204 response), but instead the following sse events */}}
@@ -47,7 +52,7 @@
"
>
{{- $pathSegment := lowerSnakeCase (printf "%s" $platform) }}
- {{- component (printf "/accounts/%d/platforms/%s/link-section" $acctID $pathSegment) }}
+ {{- component (printf "/accounts/%d/platforms/%s/shops/link-section" $acctID $pathSegment) "Mock" .Mock }}
diff --git a/templates/layout.html.tmpl b/templates/layout.html.tmpl
index a5649ab..086d29d 100644
--- a/templates/layout.html.tmpl
+++ b/templates/layout.html.tmpl
@@ -1,5 +1,6 @@
{{- $loggedIn := and (and .Identity .Identity.AccessToken) true -}}
{{- $hasAccount := and (and .Identity .Identity.Account) true -}}
+{{- $acctID := 0 }}
@@ -47,8 +48,9 @@
{{- end }}
>
-
diff --git a/templates/pages/accounts/{acctID.int64}/index.html.tmpl b/templates/pages/accounts/{acctID.int64}/index.html.tmpl
index 6e5652a..b2c79bc 100644
--- a/templates/pages/accounts/{acctID.int64}/index.html.tmpl
+++ b/templates/pages/accounts/{acctID.int64}/index.html.tmpl
@@ -47,128 +47,3 @@
-
-
-
diff --git a/templates/pages/accounts/{acctID.int64}/inventory.html.tmpl b/templates/pages/accounts/{acctID.int64}/inventory/index.html.tmpl
similarity index 100%
rename from templates/pages/accounts/{acctID.int64}/inventory.html.tmpl
rename to templates/pages/accounts/{acctID.int64}/inventory/index.html.tmpl
diff --git a/templates/pages/accounts/{acctID.int64}/inventory/mock.html.tmpl b/templates/pages/accounts/{acctID.int64}/inventory/mock.html.tmpl
new file mode 100644
index 0000000..d6a3f2f
--- /dev/null
+++ b/templates/pages/accounts/{acctID.int64}/inventory/mock.html.tmpl
@@ -0,0 +1,25 @@
+{{- .Auth.ByMatchingAccountID 2 }}
+
+{{- $acctID := .Identity.Account.AccountID }}
+{{- $stores := .Accounts.GetShops $acctID -}}
+
+
+{{- define "title" }} Inventory++ {{ end }}
+
+Inventory
+
+Synced Listings
+
+
+
+ Create a Sync Group
+
+ {{/*
+ {{ component (printf "accounts/%d/inventory/sync-groups/draft/table" $acctID) }}
+
+
+ {{ 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) }}
+
+ */}}
+
diff --git a/templates/pages/accounts/{acctID.int64}/shops/index.html.tmpl b/templates/pages/accounts/{acctID.int64}/shops/index.html.tmpl
new file mode 100644
index 0000000..d092434
--- /dev/null
+++ b/templates/pages/accounts/{acctID.int64}/shops/index.html.tmpl
@@ -0,0 +1,22 @@
+{{- .Auth.ByMatchingAccountID 2 }}
+
+{{- define "title" }} Inventory++ Shops {{ end }}
+
+{{- $acctID := .Identity.Account.AccountID }}
+
+
+
+
+ {{- range $i, $platform := .Accounts.GetOrderOfPlatformsOnAccountPage $acctID }}
+ {{ component (printf "/accounts/%d/platforms/%s/shops/list-item" $acctID $platform)
+ "OrderIndex" $i
+ }}
+ {{- end }}
+
+
diff --git a/templates/pages/accounts/{acctID.int64}/shops/mocks.html.tmpl b/templates/pages/accounts/{acctID.int64}/shops/mocks.html.tmpl
new file mode 100644
index 0000000..a84e58b
--- /dev/null
+++ b/templates/pages/accounts/{acctID.int64}/shops/mocks.html.tmpl
@@ -0,0 +1,23 @@
+{{- .Auth.ByMatchingAccountID 2 }}
+
+{{- define "title" }} Inventory++ Mock Shops {{ end }}
+
+{{- $acctID := .Identity.Account.AccountID }}
+
+
+
+
+ {{- range $i, $platform := .Accounts.GetOrderOfPlatformsOnAccountPage $acctID }}
+ {{ component (printf "/accounts/%d/platforms/%s/shops/list-item" $acctID $platform)
+ "OrderIndex" $i
+ "Mock" true
+ }}
+ {{- end }}
+
+