From f79249938e2c62b33f2ddcc4531209478ac4c1ea Mon Sep 17 00:00:00 2001 From: agent Date: Mon, 26 Oct 2026 19:46:05 +0000 Subject: [PATCH] Admin Services & products on phones: one card per item The seven-column table didn't fit a phone: Name and Type scrolled off the left and long bundle/duration text wrapped into very tall rows. Below lg (where the sidebar becomes a drawer) each item is now a card: picture, name, type and status badges, price/stock, then the lengths or bundle contents and any warnings, with Edit on the right. The table stays from lg up; its cells now share snippets with the cards. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW --- app-admin/src/routes/items/+page.svelte | 98 +++++++++++++++++++------ 1 file changed, 74 insertions(+), 24 deletions(-) diff --git a/app-admin/src/routes/items/+page.svelte b/app-admin/src/routes/items/+page.svelte index b2ea11a..6d7ea39 100644 --- a/app-admin/src/routes/items/+page.svelte +++ b/app-admin/src/routes/items/+page.svelte @@ -137,7 +137,74 @@ {#if form?.message}{/if} -
+ {#snippet thumbnail(item: ItemRecord)} + {#if item.imageUrl} + + {:else} +
+ {/if} + {/snippet} + + {#snippet typeBadge(item: ItemRecord)} + {item.type === 'item_with_time' ? 'Service' : item.type === 'bundle' ? 'Bundle' : 'Product'} + {/snippet} + + {#snippet price(item: ItemRecord)}{item.durations.length > 1 ? `from ${money.format(item.price)}` : money.format(item.price)}{/snippet} + + {#snippet details(item: ItemRecord)} + {#if item.type === 'item_with_time'} + {durationList(item)}{item.bufferMinutes ? ` + ${item.bufferMinutes} min get-ready` : ''}{(item.capacity ?? 1) > 1 ? ` · ${item.capacity} places` : ''} + {:else if item.type === 'bundle'} + {bundleList(item)} · {item.validMonths ? `valid ${item.validMonths} months` : 'no expiry'} + {:else}—{/if} + {/snippet} + + {#snippet status(item: ItemRecord, problem: string)} + {#if problem} + Not on sale + {:else} + {item.active ? 'Active' : 'Inactive'} + {/if} + {/snippet} + + {#snippet notes(problem: string, waiting: number)} + {#if problem} + {problem} + {/if} + {#if waiting} + {waiting === 1 ? '1 code has' : `${waiting} codes have`} sessions of this left to book — they can’t while it’s inactive. + {/if} + {/snippet} + + +
    + {#each items as item (item.id)} + {@const problem = item.type === 'bundle' && item.active ? bundleProblem(item) : ''} + {@const waiting = !item.active && item.type === 'item_with_time' ? (data.waiting[item.id] ?? 0) : 0} +
  • +
    + {@render thumbnail(item)} +
    + {item.name} +
    + {@render typeBadge(item)} + {@render status(item, problem)} + {@render price(item)}{item.type === 'item' ? ` · stock ${item.stock ?? '∞'}` : ''} +
    + {#if item.type !== 'item'} +

    {@render details(item)}

    + {/if} + {@render notes(problem, waiting)} +
    + +
    +
  • + {:else} +
  • No items yet — create a service or product.
  • + {/each} +
+ +