Admin — DSEC Notebook
{#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"}
{#if setupError}

{setupError}

{/if}
{:else}

We sent a 6-digit code to {setupEmail}. It expires in 10 minutes.

{#if setupError}

{setupError}

{/if}
{/if}
{:else if !adminState.isAdmin}

Admin

You need to be an admin to view this page.

{#if !adminState.currentUser} Sign in {/if} {:else}

Admin

Dashboard

{#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.code2 ? ` / ${unit.code2}` : ""}

{unit.name}

{/each}

{unitForm.id ? "Edit unit" : "Add unit"}

{#if unitError}

{unitError}

{/if} {#if unitSuccess}

{unitSuccess}

{/if}
{#if unitForm.id} {/if}
{: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}

Edit account

{#if userError}

{userError}

{/if}
{: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.unitCode + (note.unitCode2 ? ` / ${note.unitCode2}` : "") : "—"} · {note.authorName} · {timeAgo( note.createdAt, )}

{/each}
{#if noteError}

{noteError}

{/if}
{#if noteForm}

Edit note

{#if noteError}

{noteError}

{/if}
{:else}

Note editor

Select a note and choose Edit to update its title or content.

{/if}
{/if} {/if}