Item editor: length reading back under each length row

The admin preferred "1 h 30 min" under the minutes and price, as before
#20, over beside them. Restores that row's earlier markup; the Active
toggle's wrapping text from #20 stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW
This commit is contained in:
agent 2026-10-26 20:11:44 +00:00
parent 4a9d596276
commit 4a374ff22a

View file

@ -320,19 +320,18 @@
<span class="fieldset-legend">Lengths and prices</span> <span class="fieldset-legend">Lengths and prices</span>
<div class="space-y-2"> <div class="space-y-2">
{#each draft.durations as row, i} {#each draft.durations as row, i}
<!-- One line on a phone too: the inputs shrink, the "1 h 30 min" reading stays to their right. --> <div class="flex flex-wrap items-center gap-2">
<div class="flex items-center gap-2"> <label class="input w-36">
<label class="input min-w-0 flex-1 sm:w-36 sm:flex-none">
<input type="number" min="5" max="720" step="5" name="durationMinutes" required aria-label="Length in minutes" bind:value={row.minutes} /> <input type="number" min="5" max="720" step="5" name="durationMinutes" required aria-label="Length in minutes" bind:value={row.minutes} />
<span class="label">min</span> <span class="label">min</span>
</label> </label>
<label class="input min-w-0 flex-1 sm:w-40 sm:flex-none"> <label class="input w-40">
<input type="number" min="0" step="0.01" name="durationPrice" required aria-label="Price for this length" bind:value={row.price} /> <input type="number" min="0" step="0.01" name="durationPrice" required aria-label="Price for this length" bind:value={row.price} />
<span class="label">{data.currency}</span> <span class="label">{data.currency}</span>
</label> </label>
<span class="w-16 shrink-0 text-xs leading-tight text-base-content/60 sm:w-auto sm:text-sm">{Number(row.minutes) >= 5 ? formatDuration(Number(row.minutes)) : ''}</span> {#if Number(row.minutes) >= 5}<span class="text-sm text-base-content/60">{formatDuration(Number(row.minutes))}</span>{/if}
{#if draft.durations.length > 1} {#if draft.durations.length > 1}
<button class="btn btn-ghost btn-sm btn-square shrink-0" type="button" aria-label="Remove this length" onclick={() => draft.durations.splice(i, 1)}>✕</button> <button class="btn btn-ghost btn-sm" type="button" aria-label="Remove this length" onclick={() => draft.durations.splice(i, 1)}>✕</button>
{/if} {/if}
</div> </div>
{/each} {/each}