+ {#if loading}
+
Loading
+ {:else if !adminState}
+
Unable to load the dashboard
+
{pageError}
+ {:else if !adminState.hasAdmin}
+
+
Admin setup
+
Create the first admin
+
+ This notebook doesn't have an admin yet. Verify your Deakin email to take ownership
+ of the dashboard.
+
+
+ {#if setupStep === "email"}
+
+ {:else}
+
+ {/if}
+
+ {:else if !adminState.isAdmin}
+
Admin
+
You need to be an admin to view this page.
+ {#if !adminState.currentUser}
+
+ Sign in
+
+ {/if}
+ {:else}
+
+
+
+
+
+
+
+
+
+
+ {#if pageError}
+
{pageError}
+ {/if}
+
+ {#if tab === "overview"}
+ {#if stats}
+
+
+
Notes
+
{stats.totals.notes}
+
+
+
Questions
+
{stats.totals.questions}
+
+
+
Accounts
+
{stats.totals.users}
+
+
+
Units
+
{stats.totals.units}
+
+
+
+
+
+
Posts โ last {stats.weeks.length} weeks
+
+ โ Notes
+ โ Questions
+
+
+
+
+ {#each stats.weeks as week}
+
+
+
{weekLabel(week.weekStart)}
+
{week.notes} notes ยท {week.questions} questions
+
+ {/each}
+
+
+ {/if}
+ {:else if tab === "units"}
+
+
+
+
All units
+
{units.length} total
+
+
+ {#each units as unit}
+
+
+
{unit.code}
+
{unit.name}
+
+
+
+
+
+
+ {/each}
+
+
+
+
+
+ {:else if tab === "accounts"}
+
+
+
+
All accounts
+
{users.length} total
+
+
+ {#each users as user}
+
+
+
+
{user.name}
+
{user.email}
+
+
+ {user.role}
+
+
+
+
{user.noteCount} note{user.noteCount === 1
+ ? ""
+ : "s"}
+
{user.questionCount} question{user.questionCount === 1
+ ? ""
+ : "s"}
+
+
+
+
+
+
+
+ {/each}
+
+
+ {#if userError}
+
{userError}
+ {/if}
+
+
+
+ {#if userForm}
+
+ {:else}
+
Account editor
+
+ Select an account and choose Edit to change its name, email, or role.
+
+ {/if}
+
+
+ {:else if tab === "notes"}
+
+
+
+
All notes
+
{notes.length} total
+
+
+ {#each notes as note}
+
+
+
+
{note.title}
+
+ {note.unitCode ?? "โ"} ยท {note.authorName} ยท {timeAgo(
+ note.createdAt,
+ )}
+
+
+
+
+
+
+
+
+ {/each}
+
+
+ {#if noteError}
+
{noteError}
+ {/if}
+
+
+
+ {#if noteForm}
+
+ {:else}
+
Note editor
+
+ Select a note and choose Edit to update its title or content.
+
+ {/if}
+
+
+ {/if}
+ {/if}
+