💄 polish account, marks, and admin surfaces
Browse files at this commit217fc08cfe512ced828e30cb3c627c9682fa0a96Parent: 9362010- style
- 💄 polish account, marks, and admin surfaces
9 changed files +132 -90
- src/components/marks/marks-report-view.tsx +45 -36
- src/components/users/profile-form.tsx +10 -8
- src/components/users/user-table.tsx +24 -22
- src/pages/admin-users-page.tsx +7 -5
- src/pages/login-page.tsx +2 -2
- src/pages/marks-page.tsx +8 -2
- src/pages/profile-page.tsx +9 -6
- src/pages/register-page.tsx +2 -2
- src/pages/student-marks-page.tsx +25 -7
src/components/marks/marks-report-view.tsxmodified+45 -36
| @@ -14,14 +14,14 @@ export function MarksReportView(props: { report: MarksReport }) { | |||
| 14 | <Show | 14 | <Show |
| 15 | when={props.report.courses.length > 0} | 15 | when={props.report.courses.length > 0} |
| 16 | fallback={ | 16 | fallback={ |
| 17 | - <div class="rounded-md border border-dashed px-6 py-12 text-center text-sm text-muted-foreground"> | 17 | + <div class="rounded-lg border border-dashed border-border/80 bg-muted/20 px-4 py-8 text-center text-sm text-muted-foreground"> |
| 18 | {t("marks.empty")} | 18 | {t("marks.empty")} |
| 19 | </div> | 19 | </div> |
| 20 | } | 20 | } |
| 21 | > | 21 | > |
| 22 | <div class="space-y-4"> | 22 | <div class="space-y-4"> |
| 23 | - <div class="surface-card flex items-center justify-between gap-3 p-5"> | 23 | + <div class="surface-card flex flex-wrap items-center justify-between gap-3 p-5"> |
| 24 | - <span class="text-sm text-muted-foreground">{t("marks.overall")}</span> | 24 | + <span class="text-sm font-medium text-muted-foreground">{t("marks.overall")}</span> |
| 25 | <p class="font-display text-3xl font-semibold tabular-nums"> | 25 | <p class="font-display text-3xl font-semibold tabular-nums"> |
| 26 | {props.report.overall_average == null ? "—" : round(props.report.overall_average)} | 26 | {props.report.overall_average == null ? "—" : round(props.report.overall_average)} |
| 27 | <Show when={props.report.overall_average != null}> | 27 | <Show when={props.report.overall_average != null}> |
| @@ -32,49 +32,58 @@ export function MarksReportView(props: { report: MarksReport }) { | |||
| 32 | 32 | ||
| 33 | <For each={props.report.courses}> | 33 | <For each={props.report.courses}> |
| 34 | {(block) => ( | 34 | {(block) => ( |
| 35 | - <article class="surface-card space-y-3 p-5"> | 35 | + <article class="surface-card space-y-4 p-5"> |
| 36 | <header class="flex flex-wrap items-center justify-between gap-2"> | 36 | <header class="flex flex-wrap items-center justify-between gap-2"> |
| 37 | <h3 class="font-display text-lg font-semibold"> | 37 | <h3 class="font-display text-lg font-semibold"> |
| 38 | <Link to="/courses/$id" params={{ id: block.course.id }} class="hover:text-primary hover:underline"> | 38 | <Link to="/courses/$id" params={{ id: block.course.id }} class="hover:text-primary hover:underline"> |
| 39 | {block.course.title} | 39 | {block.course.title} |
| 40 | </Link> | 40 | </Link> |
| 41 | </h3> | 41 | </h3> |
| 42 | - <Badge variant="secondary" title={t("marks.courseAvg")}> | 42 | + <Badge variant="secondary" class="rounded-full px-3 py-1" title={t("marks.courseAvg")}> |
| 43 | {block.average == null ? "—" : round(block.average)} | 43 | {block.average == null ? "—" : round(block.average)} |
| 44 | </Badge> | 44 | </Badge> |
| 45 | </header> | 45 | </header> |
| 46 | 46 | ||
| 47 | - <Show when={block.results.length > 0} fallback={<p class="text-sm text-muted-foreground">{t("exams.noResults")}</p>}> | 47 | + <Show |
| 48 | - <Table> | 48 | + when={block.results.length > 0} |
| 49 | - <TableHeader> | 49 | + fallback={ |
| 50 | - <TableRow> | 50 | + <p class="rounded-lg border border-dashed border-border/80 bg-muted/20 px-4 py-8 text-center text-sm text-muted-foreground"> |
| 51 | - <TableHead>{t("marks.exam")}</TableHead> | 51 | + {t("exams.noResults")} |
| 52 | - <TableHead>{t("exams.kind")}</TableHead> | 52 | + </p> |
| 53 | - <TableHead>{t("marks.weight")}</TableHead> | 53 | + } |
| 54 | - <TableHead>{t("marks.mark")}</TableHead> | 54 | + > |
| 55 | - </TableRow> | 55 | + <div class="overflow-hidden rounded-lg border border-border/70 bg-background/60"> |
| 56 | - </TableHeader> | 56 | + <Table> |
| 57 | - <TableBody> | 57 | + <TableHeader> |
| 58 | - <For each={block.results}> | 58 | + <TableRow> |
| 59 | - {(entry) => ( | 59 | + <TableHead>{t("marks.exam")}</TableHead> |
| 60 | - <TableRow> | 60 | + <TableHead>{t("exams.kind")}</TableHead> |
| 61 | - <TableCell> | 61 | + <TableHead>{t("marks.weight")}</TableHead> |
| 62 | - <Link to="/exams/$id" params={{ id: entry.exam }} class="font-medium hover:underline"> | 62 | + <TableHead>{t("marks.mark")}</TableHead> |
| 63 | - {entry.title} | 63 | + </TableRow> |
| 64 | - </Link> | 64 | + </TableHeader> |
| 65 | - </TableCell> | 65 | + <TableBody> |
| 66 | - <TableCell> | 66 | + <For each={block.results}> |
| 67 | - <Badge variant="outline" class="capitalize"> | 67 | + {(entry) => ( |
| 68 | - {examKindLabel(entry.kind, t)} | 68 | + <TableRow> |
| 69 | - </Badge> | 69 | + <TableCell> |
| 70 | - </TableCell> | 70 | + <Link to="/exams/$id" params={{ id: entry.exam }} class="font-medium hover:underline"> |
| 71 | - <TableCell>{entry.weight}</TableCell> | 71 | + {entry.title} |
| 72 | - <TableCell class="font-semibold tabular-nums">{entry.mark}</TableCell> | 72 | + </Link> |
| 73 | - </TableRow> | 73 | + </TableCell> |
| 74 | - )} | 74 | + <TableCell> |
| 75 | - </For> | 75 | + <Badge variant="outline" class="rounded-full capitalize"> |
| 76 | - </TableBody> | 76 | + {examKindLabel(entry.kind, t)} |
| 77 | - </Table> | 77 | + </Badge> |
| 78 | + </TableCell> | ||
| 79 | + <TableCell class="tabular-nums">{entry.weight}</TableCell> | ||
| 80 | + <TableCell class="font-semibold tabular-nums">{entry.mark}</TableCell> | ||
| 81 | + </TableRow> | ||
| 82 | + )} | ||
| 83 | + </For> | ||
| 84 | + </TableBody> | ||
| 85 | + </Table> | ||
| 86 | + </div> | ||
| 78 | </Show> | 87 | </Show> |
| 79 | </article> | 88 | </article> |
| 80 | )} | 89 | )} |
src/components/users/profile-form.tsxmodified+10 -8
| @@ -74,31 +74,33 @@ export function ProfileForm(props: { user: User; onSaved: () => void }) { | |||
| 74 | }; | 74 | }; |
| 75 | 75 | ||
| 76 | return ( | 76 | return ( |
| 77 | - <form onSubmit={submit} class="space-y-3"> | 77 | + <form onSubmit={submit} class="space-y-4"> |
| 78 | <div class="grid gap-3 sm:grid-cols-2"> | 78 | <div class="grid gap-3 sm:grid-cols-2"> |
| 79 | <div class="space-y-1.5"> | 79 | <div class="space-y-1.5"> |
| 80 | <Label for="pf-name">{t("profile.name")}</Label> | 80 | <Label for="pf-name">{t("profile.name")}</Label> |
| 81 | - <Input id="pf-name" value={name()} onInput={(e) => setName(e.currentTarget.value)} /> | 81 | + <Input id="pf-name" class="h-10" value={name()} onInput={(e) => setName(e.currentTarget.value)} /> |
| 82 | </div> | 82 | </div> |
| 83 | <div class="space-y-1.5"> | 83 | <div class="space-y-1.5"> |
| 84 | <Label for="pf-surname">{t("profile.surname")}</Label> | 84 | <Label for="pf-surname">{t("profile.surname")}</Label> |
| 85 | - <Input id="pf-surname" value={surname()} onInput={(e) => setSurname(e.currentTarget.value)} /> | 85 | + <Input id="pf-surname" class="h-10" value={surname()} onInput={(e) => setSurname(e.currentTarget.value)} /> |
| 86 | </div> | 86 | </div> |
| 87 | </div> | 87 | </div> |
| 88 | <div class="space-y-1.5"> | 88 | <div class="space-y-1.5"> |
| 89 | <Label for="pf-email">{t("profile.email")}</Label> | 89 | <Label for="pf-email">{t("profile.email")}</Label> |
| 90 | - <Input id="pf-email" type="email" value={email()} onInput={(e) => setEmail(e.currentTarget.value)} /> | 90 | + <Input id="pf-email" class="h-10" type="email" value={email()} onInput={(e) => setEmail(e.currentTarget.value)} /> |
| 91 | </div> | 91 | </div> |
| 92 | <div class="space-y-1.5"> | 92 | <div class="space-y-1.5"> |
| 93 | <Label for="pf-phone">{t("profile.phone")}</Label> | 93 | <Label for="pf-phone">{t("profile.phone")}</Label> |
| 94 | - <Input id="pf-phone" type="tel" value={phone()} onInput={(e) => setPhone(e.currentTarget.value)} /> | 94 | + <Input id="pf-phone" class="h-10" type="tel" value={phone()} onInput={(e) => setPhone(e.currentTarget.value)} /> |
| 95 | </div> | 95 | </div> |
| 96 | <div class="space-y-1.5"> | 96 | <div class="space-y-1.5"> |
| 97 | <Label for="pf-birth">{t("profile.birthDate")}</Label> | 97 | <Label for="pf-birth">{t("profile.birthDate")}</Label> |
| 98 | - <Input id="pf-birth" type="date" value={birthDate()} onInput={(e) => setBirthDate(e.currentTarget.value)} /> | 98 | + <Input id="pf-birth" class="h-10" type="date" value={birthDate()} onInput={(e) => setBirthDate(e.currentTarget.value)} /> |
| 99 | + </div> | ||
| 100 | + {error() && <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive">{error()}</p>} | ||
| 101 | + <div class="flex justify-end"> | ||
| 102 | + <Button type="submit" class="w-full sm:w-auto" disabled={pending()}>{t("common.save")}</Button> | ||
| 99 | </div> | 103 | </div> |
| 100 | - {error() && <p class="text-sm text-destructive">{error()}</p>} | ||
| 101 | - <Button type="submit" disabled={pending()}>{t("common.save")}</Button> | ||
| 102 | </form> | 104 | </form> |
| 103 | ); | 105 | ); |
| 104 | } | 106 | } |
src/components/users/user-table.tsxmodified+24 -22
| @@ -33,7 +33,7 @@ function UserRoleRow(props: { | |||
| 33 | <TableCell class="font-mono text-xs text-muted-foreground">{props.user.id}</TableCell> | 33 | <TableCell class="font-mono text-xs text-muted-foreground">{props.user.id}</TableCell> |
| 34 | <TableCell class="space-y-2"> | 34 | <TableCell class="space-y-2"> |
| 35 | <Select | 35 | <Select |
| 36 | - class="rounded-sm" | 36 | + class="h-10 rounded-md" |
| 37 | value={pendingRole()} | 37 | value={pendingRole()} |
| 38 | disabled={isSelf()} | 38 | disabled={isSelf()} |
| 39 | onChange={(e) => setPendingRole(e.currentTarget.value as Role)} | 39 | onChange={(e) => setPendingRole(e.currentTarget.value as Role)} |
| @@ -44,7 +44,7 @@ function UserRoleRow(props: { | |||
| 44 | ))} | 44 | ))} |
| 45 | </Select> | 45 | </Select> |
| 46 | <Show when={!isSelf() && dirty()}> | 46 | <Show when={!isSelf() && dirty()}> |
| 47 | - <Button type="button" size="sm" onClick={() => setConfirmOpen(true)}> | 47 | + <Button type="button" size="sm" class="rounded-md" onClick={() => setConfirmOpen(true)}> |
| 48 | <IconCheck /> | 48 | <IconCheck /> |
| 49 | {t("common.update")} | 49 | {t("common.update")} |
| 50 | </Button> | 50 | </Button> |
| @@ -75,25 +75,27 @@ export function UserTable(props: { | |||
| 75 | }) { | 75 | }) { |
| 76 | const t = useT(); | 76 | const t = useT(); |
| 77 | return ( | 77 | return ( |
| 78 | - <Table> | 78 | + <div class="overflow-hidden rounded-lg border border-border/70 bg-background/60"> |
| 79 | - <TableHeader> | 79 | + <Table> |
| 80 | - <TableRow> | 80 | + <TableHeader> |
| 81 | - <TableHead>{t("admin.username")}</TableHead> | 81 | + <TableRow> |
| 82 | - <TableHead>{t("admin.id")}</TableHead> | 82 | + <TableHead>{t("admin.username")}</TableHead> |
| 83 | - <TableHead class="w-56">{t("admin.role")}</TableHead> | 83 | + <TableHead>{t("admin.id")}</TableHead> |
| 84 | - </TableRow> | 84 | + <TableHead class="w-56">{t("admin.role")}</TableHead> |
| 85 | - </TableHeader> | 85 | + </TableRow> |
| 86 | - <TableBody> | 86 | + </TableHeader> |
| 87 | - <For each={props.users}> | 87 | + <TableBody> |
| 88 | - {(user) => ( | 88 | + <For each={props.users}> |
| 89 | - <UserRoleRow | 89 | + {(user) => ( |
| 90 | - user={user} | 90 | + <UserRoleRow |
| 91 | - currentUserId={props.currentUserId} | 91 | + user={user} |
| 92 | - onRoleChange={props.onRoleChange} | 92 | + currentUserId={props.currentUserId} |
| 93 | - /> | 93 | + onRoleChange={props.onRoleChange} |
| 94 | - )} | 94 | + /> |
| 95 | - </For> | 95 | + )} |
| 96 | - </TableBody> | 96 | + </For> |
| 97 | - </Table> | 97 | + </TableBody> |
| 98 | + </Table> | ||
| 99 | + </div> | ||
| 98 | ); | 100 | ); |
| 99 | } | 101 | } |
src/pages/admin-users-page.tsxmodified+7 -5
| @@ -43,18 +43,20 @@ function AdminUsersContent() { | |||
| 43 | description={t("admin.subtitle")} | 43 | description={t("admin.subtitle")} |
| 44 | /> | 44 | /> |
| 45 | 45 | ||
| 46 | - {error() && ( | 46 | + {error() && <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive">{error()}</p>} |
| 47 | - <p class="rounded-sm bg-destructive/10 px-3 py-2 text-sm text-destructive">{error()}</p> | ||
| 48 | - )} | ||
| 49 | 47 | ||
| 50 | - <div class="surface-card overflow-hidden p-2 sm:p-4"> | 48 | + <div class="surface-card space-y-4 p-5"> |
| 49 | + <div> | ||
| 50 | + <h2 class="font-display text-lg font-semibold">{t("nav.users")}</h2> | ||
| 51 | + <p class="mt-1 text-sm text-muted-foreground">{t("admin.subtitle")}</p> | ||
| 52 | + </div> | ||
| 51 | <Suspense fallback={<PageSpinner />}> | 53 | <Suspense fallback={<PageSpinner />}> |
| 52 | <Show when={users()}> | 54 | <Show when={users()}> |
| 53 | {(list) => ( | 55 | {(list) => ( |
| 54 | <Show | 56 | <Show |
| 55 | when={list().length > 0} | 57 | when={list().length > 0} |
| 56 | fallback={ | 58 | fallback={ |
| 57 | - <div class="rounded-sm border border-dashed border-border bg-muted/20 px-6 py-16 text-center text-sm text-muted-foreground"> | 59 | + <div class="rounded-lg border border-dashed border-border/80 bg-muted/20 px-4 py-8 text-center text-sm text-muted-foreground"> |
| 58 | {t("admin.noUsers")} | 60 | {t("admin.noUsers")} |
| 59 | </div> | 61 | </div> |
| 60 | } | 62 | } |
src/pages/login-page.tsxmodified+2 -2
| @@ -54,8 +54,8 @@ function LoginForm() { | |||
| 54 | }; | 54 | }; |
| 55 | 55 | ||
| 56 | return ( | 56 | return ( |
| 57 | - <div class="-mx-4 -my-6 flex h-[calc(100dvh-3.5rem)] items-center justify-center overflow-hidden px-4 sm:-mx-6 sm:px-6 lg:-mx-8 lg:-my-8 lg:px-8"> | 57 | + <div class="-mx-4 -my-6 flex min-h-[calc(100dvh-3.5rem)] items-center justify-center overflow-hidden px-4 py-8 sm:-mx-6 sm:px-6 lg:-mx-8 lg:-my-8 lg:px-8"> |
| 58 | - <div class="surface-card w-full max-w-sm p-8 shadow-lg"> | 58 | + <div class="surface-card w-full max-w-sm p-6 shadow-lg sm:p-8"> |
| 59 | <div class="mb-8 text-center"> | 59 | <div class="mb-8 text-center"> |
| 60 | <h1 class="font-display text-3xl font-semibold tracking-tight">{t("auth.loginTitle")}</h1> | 60 | <h1 class="font-display text-3xl font-semibold tracking-tight">{t("auth.loginTitle")}</h1> |
| 61 | <p class="mt-1.5 text-sm text-muted-foreground">{t("auth.loginSubtitle")}</p> | 61 | <p class="mt-1.5 text-sm text-muted-foreground">{t("auth.loginSubtitle")}</p> |
src/pages/marks-page.tsxmodified+8 -2
| @@ -33,11 +33,17 @@ function MarksContent() { | |||
| 33 | <Show when={mine.error}> | 33 | <Show when={mine.error}> |
| 34 | <Alert variant="destructive">{formatApiError(mine.error)}</Alert> | 34 | <Alert variant="destructive">{formatApiError(mine.error)}</Alert> |
| 35 | </Show> | 35 | </Show> |
| 36 | - <Show when={mine()} fallback={<p class="text-sm text-muted-foreground">{t("marks.empty")}</p>}> | 36 | + <Show |
| 37 | + when={mine()} | ||
| 38 | + fallback={ | ||
| 39 | + <div class="rounded-lg border border-dashed border-border/80 bg-muted/20 px-4 py-8 text-center text-sm text-muted-foreground"> | ||
| 40 | + {t("marks.empty")} | ||
| 41 | + </div> | ||
| 42 | + } | ||
| 43 | + > | ||
| 37 | {(report) => <MarksReportView report={report()} />} | 44 | {(report) => <MarksReportView report={report()} />} |
| 38 | </Show> | 45 | </Show> |
| 39 | </Suspense> | 46 | </Suspense> |
| 40 | - | ||
| 41 | </div> | 47 | </div> |
| 42 | ); | 48 | ); |
| 43 | } | 49 | } |
src/pages/profile-page.tsxmodified+9 -6
| @@ -32,7 +32,10 @@ function ProfileContent() { | |||
| 32 | 32 | ||
| 33 | <div class="grid gap-6 lg:grid-cols-2"> | 33 | <div class="grid gap-6 lg:grid-cols-2"> |
| 34 | <section class="surface-card p-5"> | 34 | <section class="surface-card p-5"> |
| 35 | - <h2 class="mb-4 font-display text-lg font-semibold">{t("profile.edit")}</h2> | 35 | + <div class="mb-4"> |
| 36 | + <h2 class="font-display text-lg font-semibold">{t("profile.edit")}</h2> | ||
| 37 | + <p class="mt-1 text-sm text-muted-foreground">{t("nav.account")}</p> | ||
| 38 | + </div> | ||
| 36 | <ProfileForm | 39 | <ProfileForm |
| 37 | user={u()} | 40 | user={u()} |
| 38 | onSaved={async () => { | 41 | onSaved={async () => { |
| @@ -44,23 +47,23 @@ function ProfileContent() { | |||
| 44 | <section class="surface-card space-y-4 p-5"> | 47 | <section class="surface-card space-y-4 p-5"> |
| 45 | <h2 class="font-display text-lg font-semibold">{t("nav.account")}</h2> | 48 | <h2 class="font-display text-lg font-semibold">{t("nav.account")}</h2> |
| 46 | <div class="grid gap-3 text-sm"> | 49 | <div class="grid gap-3 text-sm"> |
| 47 | - <div class="rounded-md border p-3"> | 50 | + <div class="rounded-lg border bg-background/60 p-3"> |
| 48 | <p class="text-xs text-muted-foreground">{t("profile.name")}</p> | 51 | <p class="text-xs text-muted-foreground">{t("profile.name")}</p> |
| 49 | <p class="mt-1 font-medium">{u().name || "—"}</p> | 52 | <p class="mt-1 font-medium">{u().name || "—"}</p> |
| 50 | </div> | 53 | </div> |
| 51 | - <div class="rounded-md border p-3"> | 54 | + <div class="rounded-lg border bg-background/60 p-3"> |
| 52 | <p class="text-xs text-muted-foreground">{t("profile.surname")}</p> | 55 | <p class="text-xs text-muted-foreground">{t("profile.surname")}</p> |
| 53 | <p class="mt-1 font-medium">{u().surname || "—"}</p> | 56 | <p class="mt-1 font-medium">{u().surname || "—"}</p> |
| 54 | </div> | 57 | </div> |
| 55 | - <div class="rounded-md border p-3"> | 58 | + <div class="rounded-lg border bg-background/60 p-3"> |
| 56 | <p class="text-xs text-muted-foreground">{t("profile.email")}</p> | 59 | <p class="text-xs text-muted-foreground">{t("profile.email")}</p> |
| 57 | <p class="mt-1 font-medium">{u().email || "—"}</p> | 60 | <p class="mt-1 font-medium">{u().email || "—"}</p> |
| 58 | </div> | 61 | </div> |
| 59 | - <div class="rounded-md border p-3"> | 62 | + <div class="rounded-lg border bg-background/60 p-3"> |
| 60 | <p class="text-xs text-muted-foreground">{t("profile.phone")}</p> | 63 | <p class="text-xs text-muted-foreground">{t("profile.phone")}</p> |
| 61 | <p class="mt-1 font-medium">{u().phone || "—"}</p> | 64 | <p class="mt-1 font-medium">{u().phone || "—"}</p> |
| 62 | </div> | 65 | </div> |
| 63 | - <div class="rounded-md border p-3"> | 66 | + <div class="rounded-lg border bg-background/60 p-3"> |
| 64 | <p class="text-xs text-muted-foreground">{t("profile.birthDate")}</p> | 67 | <p class="text-xs text-muted-foreground">{t("profile.birthDate")}</p> |
| 65 | <p class="mt-1 font-medium">{u().birth_date || "—"}</p> | 68 | <p class="mt-1 font-medium">{u().birth_date || "—"}</p> |
| 66 | </div> | 69 | </div> |
src/pages/register-page.tsxmodified+2 -2
| @@ -60,8 +60,8 @@ function RegisterForm() { | |||
| 60 | }; | 60 | }; |
| 61 | 61 | ||
| 62 | return ( | 62 | return ( |
| 63 | - <div class="-mx-4 -my-6 flex h-[calc(100dvh-3.5rem)] items-center justify-center overflow-hidden px-4 sm:-mx-6 sm:px-6 lg:-mx-8 lg:-my-8 lg:px-8"> | 63 | + <div class="-mx-4 -my-6 flex min-h-[calc(100dvh-3.5rem)] items-center justify-center overflow-hidden px-4 py-8 sm:-mx-6 sm:px-6 lg:-mx-8 lg:-my-8 lg:px-8"> |
| 64 | - <div class="surface-card w-full max-w-sm p-8 shadow-lg"> | 64 | + <div class="surface-card w-full max-w-sm p-6 shadow-lg sm:p-8"> |
| 65 | <div class="mb-8 text-center"> | 65 | <div class="mb-8 text-center"> |
| 66 | <h1 class="font-display text-3xl font-semibold tracking-tight">{t("auth.registerTitle")}</h1> | 66 | <h1 class="font-display text-3xl font-semibold tracking-tight">{t("auth.registerTitle")}</h1> |
| 67 | <p class="mt-1.5 text-sm text-muted-foreground">{t("auth.registerSubtitle")}</p> | 67 | <p class="mt-1.5 text-sm text-muted-foreground">{t("auth.registerSubtitle")}</p> |
src/pages/student-marks-page.tsxmodified+25 -7
| @@ -29,11 +29,20 @@ function StudentMarksContent() { | |||
| 29 | 29 | ||
| 30 | return ( | 30 | return ( |
| 31 | <div class="space-y-6"> | 31 | <div class="space-y-6"> |
| 32 | - <PageHeader accent="violet" eyebrow={t("nav.admin")} title={t("nav.studentMarks")} description={t("marks.lookup")} /> | 32 | + <PageHeader |
| 33 | + accent="violet" | ||
| 34 | + eyebrow={t("nav.admin")} | ||
| 35 | + title={t("nav.studentMarks")} | ||
| 36 | + description={t("marks.lookup")} | ||
| 37 | + /> | ||
| 33 | 38 | ||
| 34 | <section class="surface-card space-y-4 p-5"> | 39 | <section class="surface-card space-y-4 p-5"> |
| 40 | + <div> | ||
| 41 | + <h2 class="font-display text-lg font-semibold">{t("nav.studentMarks")}</h2> | ||
| 42 | + <p class="mt-1 text-sm text-muted-foreground">{t("marks.lookup")}</p> | ||
| 43 | + </div> | ||
| 35 | <form | 44 | <form |
| 36 | - class="flex flex-col gap-2 sm:flex-row sm:items-end" | 45 | + class="grid gap-3 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-end" |
| 37 | onSubmit={(e) => { | 46 | onSubmit={(e) => { |
| 38 | e.preventDefault(); | 47 | e.preventDefault(); |
| 39 | const id = userId().trim(); | 48 | const id = userId().trim(); |
| @@ -43,21 +52,30 @@ function StudentMarksContent() { | |||
| 43 | > | 52 | > |
| 44 | <div class="min-w-0 flex-1 space-y-1.5"> | 53 | <div class="min-w-0 flex-1 space-y-1.5"> |
| 45 | <Label for="student-marks-user">{t("marks.userIdentity")}</Label> | 54 | <Label for="student-marks-user">{t("marks.userIdentity")}</Label> |
| 46 | - <Input id="student-marks-user" class="h-10" value={userId()} onInput={(e) => setUserId(e.currentTarget.value)} /> | 55 | + <Input |
| 56 | + id="student-marks-user" | ||
| 57 | + class="h-10" | ||
| 58 | + value={userId()} | ||
| 59 | + onInput={(e) => setUserId(e.currentTarget.value)} | ||
| 60 | + /> | ||
| 47 | </div> | 61 | </div> |
| 48 | - <Button type="submit" class="h-10">{t("marks.show")}</Button> | 62 | + <Button type="submit" class="h-10 w-full sm:w-auto">{t("marks.show")}</Button> |
| 49 | </form> | 63 | </form> |
| 50 | 64 | ||
| 51 | <Show when={report.error}> | 65 | <Show when={report.error}> |
| 52 | - <p class="text-sm text-destructive">{formatApiError(report.error)}</p> | 66 | + <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive"> |
| 67 | + {formatApiError(report.error)} | ||
| 68 | + </p> | ||
| 53 | </Show> | 69 | </Show> |
| 54 | </section> | 70 | </section> |
| 55 | 71 | ||
| 56 | <Suspense fallback={<PageSpinner />}> | 72 | <Suspense fallback={<PageSpinner />}> |
| 57 | <Show when={report()}> | 73 | <Show when={report()}> |
| 58 | {(r) => ( | 74 | {(r) => ( |
| 59 | - <div class="space-y-3"> | 75 | + <div class="space-y-4"> |
| 60 | - <p class="text-sm text-muted-foreground">{t("marks.forUser", { user: lookupId() ?? "" })}</p> | 76 | + <p class="rounded-lg border bg-background/60 px-4 py-3 text-sm text-muted-foreground"> |
| 77 | + {t("marks.forUser", { user: lookupId() ?? "" })} | ||
| 78 | + </p> | ||
| 61 | <MarksReportView report={r()} /> | 79 | <MarksReportView report={r()} /> |
| 62 | </div> | 80 | </div> |
| 63 | )} | 81 | )} |