diff --git a/app-admin/src/routes/+page.svelte b/app-admin/src/routes/+page.svelte index e88543c..4719824 100644 --- a/app-admin/src/routes/+page.svelte +++ b/app-admin/src/routes/+page.svelte @@ -1,6 +1,6 @@ Dashboard | CMS {#snippet tile(label: string, value: string, note: string)} -
+

{label}

-

{value}

+

{value}

{note}

{/snippet} @@ -60,90 +70,126 @@

How the studio is doing. Income is paid orders, in the month they were paid; hours are booked appointment time, with group sessions counted once.

-
- {@render tile(`Income in ${thisMonthName}`, money(dashboard.thisMonth.income), `${incomeChange >= 0 ? '+' : '−'}${money(Math.abs(incomeChange))} on ${monthLabel(dashboard.lastMonth.month, { month: 'long' })}`)} - {@render tile( - `Income in ${dashboard.thisMonth.month.slice(0, 4)}`, - money(dashboard.incomeThisYear), - `${dashboard.thisMonth.orders} ${dashboard.thisMonth.orders === 1 ? 'order' : 'orders'} this month${dashboard.thisMonth.orders ? `, ${money(dashboard.thisMonth.income / dashboard.thisMonth.orders)} on average` : ''}` - )} - {@render tile(`Hours worked in ${thisMonthName}`, hours(dashboard.minutesDoneThisMonth), `${hours(dashboard.minutesAheadThisMonth)} still booked this month`)} - {@render tile( - 'Opened time booked', - utilisationPercent === null ? '—' : `${utilisationPercent} %`, - dashboard.utilisation ? `${hours(dashboard.utilisation.booked)} of ${hours(dashboard.utilisation.open)} opened in Slots this month` : 'No slots opened this month' - )} - {@render tile(`Next ${dashboard.upcomingDays} days`, `${dashboard.upcoming.length} ${dashboard.upcoming.length === 1 ? 'booking' : 'bookings'}`, `${hours(dashboard.upcomingMinutes)} of appointments`)} - {@render tile(`Customers in ${thisMonthName}`, String(customersThisMonth), `${dashboard.newCustomers} new, ${dashboard.returningCustomers} returning`)} - {@render tile('Vouchers & codes owed', money(dashboard.valueOutstanding), `${dashboard.codesOutstanding} ${dashboard.codesOutstanding === 1 ? 'code' : 'codes'} with sessions still to book`)} - {@render tile('Needs attention', String(dashboard.attention.length), dashboard.attention.length ? 'See the list below' : 'Nothing right now')} -
- -{#if dashboard.attention.length} -
-

Needs attention

- -

Sessions and codes in the next {dashboard.attentionDays} days.

-
-{/if} - -
-
-

Income per month

- -
- -
-

Coming up

- {#if dashboard.upcoming.length} - +
{:else}

Nothing booked in the next {dashboard.upcomingDays} days.

{/if} All orders + +
+
+

Needs attention

+

Sessions and codes: next {dashboard.attentionDays} days

+
+ {#if dashboard.attention.length} + + {:else} +

✓ All clear: no failed emails, nearly full sessions or codes about to expire.

+ {/if} +
-
-
-

What sells

- {@render salesTable(dashboard.sales, (row) => row.name, 'Nothing sold yet.')} -
-
-

Popular lengths

- {@render salesTable(dashboard.lengths, (row) => `${row.name} · ${formatDuration(row.minutes)}`, 'No bookings yet.')} -
-
-

Regulars

+
+ {@render tile(`Income in ${thisMonthName}`, money(dashboard.thisMonth.income), `${incomeChange >= 0 ? '+' : '−'}${money(Math.abs(incomeChange))} on ${monthLabel(dashboard.lastMonth.month, { month: 'long' })}`)} + {@render tile(`Hours worked in ${thisMonthName}`, hours(dashboard.minutesDoneThisMonth), `${hours(dashboard.minutesAheadThisMonth)} still booked`)} + {@render tile( + 'Opened time booked', + utilisationPercent === null ? '—' : `${utilisationPercent} %`, + dashboard.utilisation ? `${hours(dashboard.utilisation.booked)} of ${hours(dashboard.utilisation.open)} in Slots this month` : 'No slots opened this month' + )} + {@render tile('Codes owed', money(dashboard.valueOutstanding), `${dashboard.codesOutstanding} ${dashboard.codesOutstanding === 1 ? 'code' : 'codes'} with sessions to book`)} +
+ +
+
+
+

Income

+

Per month, last {dashboard.months.length} months

+
+
+

Income in {dashboard.thisMonth.month.slice(0, 4)}

+

{money(dashboard.incomeThisYear)}

+

+ {dashboard.thisMonth.orders} {dashboard.thisMonth.orders === 1 ? 'order' : 'orders'} this month{#if dashboard.thisMonth.orders}, {money(dashboard.thisMonth.income / dashboard.thisMonth.orders)} on average{/if} +

+
+
+ +
+ Show as table +
+ + + + + + {#each [...dashboard.months].reverse() as row (row.month)} + + + + + + + {/each} + +
MonthOrdersIncomeHours
{monthLabel(row.month, { month: 'short', year: 'numeric' })}{row.orders}{money(row.income)}{hours(row.minutes)}
+
+
+
+ +
+
+

Customers

+

+ {dashboard.newCustomers + dashboard.returningCustomers} in {thisMonthName}: {dashboard.newCustomers} new, {dashboard.returningCustomers} returning +

+

Regulars

{#if dashboard.regulars.length} @@ -157,26 +203,13 @@

Nobody has ordered more than once yet.

{/if} +
+

What sells

+ {@render salesTable(dashboard.sales, (row) => row.name, 'Nothing sold yet.')} +
+
+

Popular lengths

+ {@render salesTable(dashboard.lengths, (row) => `${row.name} · ${formatDuration(row.minutes)}`, 'No bookings yet.')} +
-

What sells, popular lengths and regulars cover the last {dashboard.months.length} months.

- -
-

Month by month

-
-
OrdersSpent
- - - - - {#each [...dashboard.months].reverse() as row (row.month)} - - - - - - - {/each} - -
MonthOrdersIncomeHours
{monthLabel(row.month)}{row.orders}{money(row.income)}{hours(row.minutes)}
-
-
+

Regulars, what sells and popular lengths cover the last {dashboard.months.length} months.