tag-lifecycle: owner close (status closed, gating + page) + move (copy details to new tag, close source) + legacy ?productid= redirect — verified with real tags 6 & 17

This commit is contained in:
2026-08-10 11:36:11 +10:00
parent 77a9f803f2
commit 97cf0974a3
8 changed files with 123 additions and 10 deletions

View File

@@ -17,14 +17,24 @@
<td class="px-4 py-2">
{{if eq .Status "active"}}<span class="rounded-full bg-green-100 px-2 py-0.5 text-xs font-medium text-green-800">Active</span>
{{else if eq .Status "suspended"}}<span class="rounded-full bg-red-100 px-2 py-0.5 text-xs font-medium text-red-800">Suspended</span>
{{else if eq .Status "closed"}}<span class="rounded-full bg-stone-200 px-2 py-0.5 text-xs font-medium text-stone-500">Closed</span>
{{else}}<span class="rounded-full bg-stone-200 px-2 py-0.5 text-xs font-medium text-stone-700">Unset</span>{{end}}
</td>
<td class="px-4 py-2">{{if .ItemType.Valid}}{{.ItemType.String}}{{else}}—{{end}}</td>
<td class="px-4 py-2 text-right">
{{if ne .Status "closed"}}
<a href="/account/tags/{{.ID}}/edit" hx-get="/account/tags/{{.ID}}/edit/inline" hx-target="closest tr" hx-swap="outerHTML" class="text-amber-600 hover:underline">Edit</a>
{{end}}
<form hx-post="/account/tags/{{.ID}}/close" hx-target="#account-panel" hx-swap="outerHTML" hx-confirm="Close this tag? It will stop alerts but keep its details." class="inline">
<button class="ml-3 text-stone-500 hover:underline">Close</button>
</form>
<form hx-post="/account/tags/{{.ID}}/delete" hx-target="#account-panel" hx-swap="outerHTML" hx-confirm="Remove this tag from your account?" class="inline fade-row">
<button class="ml-3 text-red-600 hover:underline">Remove</button>
</form>
<form hx-post="/account/tags/{{.ID}}/move" hx-target="#account-panel" hx-swap="outerHTML" class="inline" onsubmit="var c=prompt('Move details to which new tag code?'); if(!c)return false; this.querySelector('input').value=c;">
<input type="hidden" name="new_tag_code" value="">
<button class="ml-3 text-blue-600 hover:underline" type="submit">Move</button>
</form>
</td>
</tr>
{{end}}

View File

@@ -16,6 +16,12 @@
<h1 class="mt-4 text-2xl font-bold">This tag is unavailable</h1>
<p class="mt-2 text-stone-600">The owner has disabled this tag. Please try another way to return the item.</p>
</div>
{{else if eq .Data.Status "closed"}}
<div class="rounded-xl border border-stone-200 bg-white p-8 text-center shadow-sm">
<div class="text-5xl">🔒</div>
<h1 class="mt-4 text-2xl font-bold">This tag has been closed</h1>
<p class="mt-2 text-stone-600">This tag is no longer active. If you found this item, please try to return it another way.</p>
</div>
{{else}}
<div class="overflow-hidden rounded-xl border border-stone-200 bg-white shadow-sm">
<div class="bg-stone-900 px-6 py-5 text-white">