updated accounts page: display user info and list shops

This commit is contained in:
2026-01-25 01:23:52 -07:00
parent 1c305cd494
commit 2b1cc7af75
17 changed files with 469 additions and 18 deletions
@@ -0,0 +1 @@
<em>Coming soon!</em>
@@ -0,0 +1 @@
<em>Coming soon!</em>
@@ -0,0 +1,2 @@
<em>Coming soon!</em>
@@ -0,0 +1,2 @@
<em>Coming soon!</em>
@@ -0,0 +1,13 @@
{{- $acctID := .Identity.Account }}
{{- $etsyUser := .Etsy.GetUserPointerByAccountID $acctID.AccountID }}
{{- if $etsyUser }}
<h3>Etsy User: {{ $etsyUser.UserID }}; Shop ID: {{ $etsyUser.ShopID }}</h3>
{{- else }}
<h3>
{{/* TODO: create this link dynamically, not EVERYTIME THE PAGE IS LOADED */}}
<a href="{{ printf "/webhooks/etsy/%d/new-account-link" $acctID.AccountID }}">
Link Your Etsy Store!
</a>
</h3>
{{- end }}
@@ -0,0 +1,2 @@
<em>Coming soon!</em>
@@ -0,0 +1,2 @@
<em>Coming soon!</em>
@@ -0,0 +1,2 @@
<em>Coming soon!</em>
@@ -0,0 +1 @@
<em>Coming soon!</em>
@@ -0,0 +1,2 @@
<em>Coming soon!</em>
@@ -0,0 +1 @@
<em>Coming soon!</em>
@@ -0,0 +1,2 @@
<em>Coming soon!</em>
@@ -0,0 +1,2 @@
<em>Coming soon!</em>
+2 -2
View File
@@ -107,7 +107,7 @@
</nav>
</header>
<main class="basis-full grow p-[1em] max-w-full">
<main class="basis-full grow max-w-full">
{{/* This is where the page_body template will be inserted into the page */}}
{{- block "body" . }}{{ end }}
</main>
@@ -132,9 +132,9 @@
>
<img
src="{{ .Identity.Claims.Picture }}"
class="rounded-[50%]"
style="
max-height: 3rem;
border-radius: 50%;
margin: 1rem 0;
"
/>
@@ -2,22 +2,113 @@
{{- define "title" }} Inventory++ Account {{ end }}
{{- $acctID := .Identity.Account }}
{{- $acctID := .Identity.Account.AccountID }}
<section>
<h2>Account: {{ $acctID.Email }}</h2>
<h3>{{ .Identity.Claims.Name }}</h3>
<section class="m-[1rem]">
<h2>
<div class="
flex
justify-start
items-center
gap-[1em]
pb-[0.5em]
border-b-[2px]
border-sidebar-border
">
<div
class="
flex
justify-center
items-center
"
style="
flex-basis: 4em;
flex-shrink: 0;
"
>
<img
src="{{ .Identity.Claims.Picture }}"
class="rounded-[50%] height-[3em]"
/>
</div>
<div class="flex flex-col">
<span class="font-display" style="word-break: break-word;">
{{ .Identity.Claims.Name }}
</span>
<span style="word-break: break-word;">
{{ or .Identity.Claims.Nickname .Identity.Claims.Subject }}
</span>
</div>
</div>
</h2>
</section>
{{- $etsyUser := .Etsy.GetUserPointerByAccountID $acctID.AccountID }}
{{- if $etsyUser }}
<h3>Etsy User: {{ $etsyUser.UserID }}; Shop ID: {{ $etsyUser.ShopID }}</h3>
{{- else }}
<h3>
{{/* TODO: create this link dynamically, not EVERYTIME THE PAGE IS LOADED */}}
<a href="{{ printf "/webhooks/etsy/%d/new-account-link" $acctID.AccountID }}">
Link Your Etsy Store!
</a>
</h3>
{{- end }}
<h2><a href="/ui/accounts/{{$acctID.AccountID}}/reports">View Reports</a></h2>
<section
class="
m-[1rem]
pb-[1rem]
border-b-[2px]
border-sidebar-border
"
>
<details class="flex flex-col items-stretch">
<summary class="list-none cursor-pointer self-center">
<h2 class="bg-card my-[0.5em] px-[2em] py-[0.5em] rounded-lg">
Shops
</h2>
</summary>
<ul class="list-none">
{{- define "shop-list-entry" }}
{{/* .Platform, .AccountID */}}
<li class="my-[1rem] rounded-lg bg-accent">
<details class="group">
<summary class="
list-none
p-[1em]
after:content-['+']
group-open:after:content-['-']
after:float-right
after:font-bold
after:text-[2em]
after:leading-[1em]
cursor-pointer
group-open:border-b-background
group-open:border-b-[0.25rem]
border-dotted
">
<h3 class="inline-block">{{.Platform}}</h3>
</summary>
<div class="p-[1em] text-center">
{{- $pathSegment := lowerCamelCase .Platform }}
{{-
component
(printf "/accounts/%d/shops/link-sections/%s" .AccountID $pathSegment)
}}
</div>
</details>
</li>
{{- end }}
{{- template "shop-list-entry" (props "Platform" "Amazon" "AccountID" $acctID) }}
{{- template "shop-list-entry" (props "Platform" "Big Cartel" "AccountID" $acctID) }}
{{- template "shop-list-entry" (props "Platform" "eBay" "AccountID" $acctID) }}
{{- template "shop-list-entry" (props "Platform" "Etsy" "AccountID" $acctID) }}
{{- template "shop-list-entry" (props "Platform" "Ecwid" "AccountID" $acctID) }}
{{- template "shop-list-entry" (props "Platform" "Shopify" "AccountID" $acctID) }}
{{- template "shop-list-entry" (props "Platform" "Square Online" "AccountID" $acctID) }}
{{- template "shop-list-entry" (props "Platform" "Squarespace" "AccountID" $acctID) }}
{{- template "shop-list-entry" (props "Platform" "Tiktok" "AccountID" $acctID) }}
{{- template "shop-list-entry" (props "Platform" "Walmart Marketplace" "AccountID" $acctID) }}
{{- template "shop-list-entry" (props "Platform" "Wix" "AccountID" $acctID) }}
{{- template "shop-list-entry" (props "Platform" "Woo Commerce" "AccountID" $acctID) }}
{{- template "shop-list-entry" (props "Platform" "Zoho" "AccountID" $acctID) }}
</ul>
</details>
</section>