forge
Explore
Log in

Don't you dare go Hollow

💄 polish account, marks, and admin surfaces

Browse files at this commit

217fc08cfe512ced828e30cb3c627c9682fa0a96Burak BoduroğluParent: 9362010
  • style
    • 💄 polish account, marks, and admin surfaces
Show full message
style: 💄 polish account, marks, and admin surfaces

- tighten marks report cards, table wrappers, badges, and empty states

- refine student mark lookup spacing, error display, and result context

- polish admin user table container, role controls, and empty state

- align profile form controls, save action, and account detail cards

- improve login and register card spacing on smaller screens
src/components/marks/marks-report-view.tsxmodified+45 -36
@@ -14,14 +14,14 @@ export function MarksReportView(props: { report: MarksReport }) {
1414 <Show
1515 when={props.report.courses.length > 0}
1616 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">
1818 {t("marks.empty")}
1919 </div>
2020 }
2121 >
2222 <div class="space-y-4">
23- <div class="surface-card flex items-center justify-between gap-3 p-5">
24- <span class="text-sm text-muted-foreground">{t("marks.overall")}</span>
23+ <div class="surface-card flex flex-wrap items-center justify-between gap-3 p-5">
24+ <span class="text-sm font-medium text-muted-foreground">{t("marks.overall")}</span>
2525 <p class="font-display text-3xl font-semibold tabular-nums">
2626 {props.report.overall_average == null ? "—" : round(props.report.overall_average)}
2727 <Show when={props.report.overall_average != null}>
@@ -32,49 +32,58 @@ export function MarksReportView(props: { report: MarksReport }) {
3232
3333 <For each={props.report.courses}>
3434 {(block) => (
35- <article class="surface-card space-y-3 p-5">
35+ <article class="surface-card space-y-4 p-5">
3636 <header class="flex flex-wrap items-center justify-between gap-2">
3737 <h3 class="font-display text-lg font-semibold">
3838 <Link to="/courses/$id" params={{ id: block.course.id }} class="hover:text-primary hover:underline">
3939 {block.course.title}
4040 </Link>
4141 </h3>
42- <Badge variant="secondary" title={t("marks.courseAvg")}>
42+ <Badge variant="secondary" class="rounded-full px-3 py-1" title={t("marks.courseAvg")}>
4343 {block.average == null ? "—" : round(block.average)}
4444 </Badge>
4545 </header>
4646
47- <Show when={block.results.length > 0} fallback={<p class="text-sm text-muted-foreground">{t("exams.noResults")}</p>}>
48- <Table>
49- <TableHeader>
50- <TableRow>
51- <TableHead>{t("marks.exam")}</TableHead>
52- <TableHead>{t("exams.kind")}</TableHead>
53- <TableHead>{t("marks.weight")}</TableHead>
54- <TableHead>{t("marks.mark")}</TableHead>
55- </TableRow>
56- </TableHeader>
57- <TableBody>
58- <For each={block.results}>
59- {(entry) => (
60- <TableRow>
61- <TableCell>
62- <Link to="/exams/$id" params={{ id: entry.exam }} class="font-medium hover:underline">
63- {entry.title}
64- </Link>
65- </TableCell>
66- <TableCell>
67- <Badge variant="outline" class="capitalize">
68- {examKindLabel(entry.kind, t)}
69- </Badge>
70- </TableCell>
71- <TableCell>{entry.weight}</TableCell>
72- <TableCell class="font-semibold tabular-nums">{entry.mark}</TableCell>
73- </TableRow>
74- )}
75- </For>
76- </TableBody>
77- </Table>
47+ <Show
48+ when={block.results.length > 0}
49+ fallback={
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+ {t("exams.noResults")}
52+ </p>
53+ }
54+ >
55+ <div class="overflow-hidden rounded-lg border border-border/70 bg-background/60">
56+ <Table>
57+ <TableHeader>
58+ <TableRow>
59+ <TableHead>{t("marks.exam")}</TableHead>
60+ <TableHead>{t("exams.kind")}</TableHead>
61+ <TableHead>{t("marks.weight")}</TableHead>
62+ <TableHead>{t("marks.mark")}</TableHead>
63+ </TableRow>
64+ </TableHeader>
65+ <TableBody>
66+ <For each={block.results}>
67+ {(entry) => (
68+ <TableRow>
69+ <TableCell>
70+ <Link to="/exams/$id" params={{ id: entry.exam }} class="font-medium hover:underline">
71+ {entry.title}
72+ </Link>
73+ </TableCell>
74+ <TableCell>
75+ <Badge variant="outline" class="rounded-full capitalize">
76+ {examKindLabel(entry.kind, t)}
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>
7887 </Show>
7988 </article>
8089 )}
src/components/users/profile-form.tsxmodified+10 -8
@@ -74,31 +74,33 @@ export function ProfileForm(props: { user: User; onSaved: () => void }) {
7474 };
7575
7676 return (
77- <form onSubmit={submit} class="space-y-3">
77+ <form onSubmit={submit} class="space-y-4">
7878 <div class="grid gap-3 sm:grid-cols-2">
7979 <div class="space-y-1.5">
8080 <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)} />
8282 </div>
8383 <div class="space-y-1.5">
8484 <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)} />
8686 </div>
8787 </div>
8888 <div class="space-y-1.5">
8989 <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)} />
9191 </div>
9292 <div class="space-y-1.5">
9393 <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)} />
9595 </div>
9696 <div class="space-y-1.5">
9797 <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>
99103 </div>
100- {error() && <p class="text-sm text-destructive">{error()}</p>}
101- <Button type="submit" disabled={pending()}>{t("common.save")}</Button>
102104 </form>
103105 );
104106 }
src/components/users/user-table.tsxmodified+24 -22
@@ -33,7 +33,7 @@ function UserRoleRow(props: {
3333 <TableCell class="font-mono text-xs text-muted-foreground">{props.user.id}</TableCell>
3434 <TableCell class="space-y-2">
3535 <Select
36- class="rounded-sm"
36+ class="h-10 rounded-md"
3737 value={pendingRole()}
3838 disabled={isSelf()}
3939 onChange={(e) => setPendingRole(e.currentTarget.value as Role)}
@@ -44,7 +44,7 @@ function UserRoleRow(props: {
4444 ))}
4545 </Select>
4646 <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)}>
4848 <IconCheck />
4949 {t("common.update")}
5050 </Button>
@@ -75,25 +75,27 @@ export function UserTable(props: {
7575 }) {
7676 const t = useT();
7777 return (
78- <Table>
79- <TableHeader>
80- <TableRow>
81- <TableHead>{t("admin.username")}</TableHead>
82- <TableHead>{t("admin.id")}</TableHead>
83- <TableHead class="w-56">{t("admin.role")}</TableHead>
84- </TableRow>
85- </TableHeader>
86- <TableBody>
87- <For each={props.users}>
88- {(user) => (
89- <UserRoleRow
90- user={user}
91- currentUserId={props.currentUserId}
92- onRoleChange={props.onRoleChange}
93- />
94- )}
95- </For>
96- </TableBody>
97- </Table>
78+ <div class="overflow-hidden rounded-lg border border-border/70 bg-background/60">
79+ <Table>
80+ <TableHeader>
81+ <TableRow>
82+ <TableHead>{t("admin.username")}</TableHead>
83+ <TableHead>{t("admin.id")}</TableHead>
84+ <TableHead class="w-56">{t("admin.role")}</TableHead>
85+ </TableRow>
86+ </TableHeader>
87+ <TableBody>
88+ <For each={props.users}>
89+ {(user) => (
90+ <UserRoleRow
91+ user={user}
92+ currentUserId={props.currentUserId}
93+ onRoleChange={props.onRoleChange}
94+ />
95+ )}
96+ </For>
97+ </TableBody>
98+ </Table>
99+ </div>
98100 );
99101 }
src/pages/admin-users-page.tsxmodified+7 -5
@@ -43,18 +43,20 @@ function AdminUsersContent() {
4343 description={t("admin.subtitle")}
4444 />
4545
46- {error() && (
47- <p class="rounded-sm bg-destructive/10 px-3 py-2 text-sm text-destructive">{error()}</p>
48- )}
46+ {error() && <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive">{error()}</p>}
4947
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>
5153 <Suspense fallback={<PageSpinner />}>
5254 <Show when={users()}>
5355 {(list) => (
5456 <Show
5557 when={list().length > 0}
5658 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">
5860 {t("admin.noUsers")}
5961 </div>
6062 }
src/pages/login-page.tsxmodified+2 -2
@@ -54,8 +54,8 @@ function LoginForm() {
5454 };
5555
5656 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">
58- <div class="surface-card w-full max-w-sm p-8 shadow-lg">
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-6 shadow-lg sm:p-8">
5959 <div class="mb-8 text-center">
6060 <h1 class="font-display text-3xl font-semibold tracking-tight">{t("auth.loginTitle")}</h1>
6161 <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() {
3333 <Show when={mine.error}>
3434 <Alert variant="destructive">{formatApiError(mine.error)}</Alert>
3535 </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+ >
3744 {(report) => <MarksReportView report={report()} />}
3845 </Show>
3946 </Suspense>
40-
4147 </div>
4248 );
4349 }
src/pages/profile-page.tsxmodified+9 -6
@@ -32,7 +32,10 @@ function ProfileContent() {
3232
3333 <div class="grid gap-6 lg:grid-cols-2">
3434 <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>
3639 <ProfileForm
3740 user={u()}
3841 onSaved={async () => {
@@ -44,23 +47,23 @@ function ProfileContent() {
4447 <section class="surface-card space-y-4 p-5">
4548 <h2 class="font-display text-lg font-semibold">{t("nav.account")}</h2>
4649 <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">
4851 <p class="text-xs text-muted-foreground">{t("profile.name")}</p>
4952 <p class="mt-1 font-medium">{u().name || "—"}</p>
5053 </div>
51- <div class="rounded-md border p-3">
54+ <div class="rounded-lg border bg-background/60 p-3">
5255 <p class="text-xs text-muted-foreground">{t("profile.surname")}</p>
5356 <p class="mt-1 font-medium">{u().surname || "—"}</p>
5457 </div>
55- <div class="rounded-md border p-3">
58+ <div class="rounded-lg border bg-background/60 p-3">
5659 <p class="text-xs text-muted-foreground">{t("profile.email")}</p>
5760 <p class="mt-1 font-medium">{u().email || "—"}</p>
5861 </div>
59- <div class="rounded-md border p-3">
62+ <div class="rounded-lg border bg-background/60 p-3">
6063 <p class="text-xs text-muted-foreground">{t("profile.phone")}</p>
6164 <p class="mt-1 font-medium">{u().phone || "—"}</p>
6265 </div>
63- <div class="rounded-md border p-3">
66+ <div class="rounded-lg border bg-background/60 p-3">
6467 <p class="text-xs text-muted-foreground">{t("profile.birthDate")}</p>
6568 <p class="mt-1 font-medium">{u().birth_date || "—"}</p>
6669 </div>
src/pages/register-page.tsxmodified+2 -2
@@ -60,8 +60,8 @@ function RegisterForm() {
6060 };
6161
6262 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">
64- <div class="surface-card w-full max-w-sm p-8 shadow-lg">
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-6 shadow-lg sm:p-8">
6565 <div class="mb-8 text-center">
6666 <h1 class="font-display text-3xl font-semibold tracking-tight">{t("auth.registerTitle")}</h1>
6767 <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() {
2929
3030 return (
3131 <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+ />
3338
3439 <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>
3544 <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"
3746 onSubmit={(e) => {
3847 e.preventDefault();
3948 const id = userId().trim();
@@ -43,21 +52,30 @@ function StudentMarksContent() {
4352 >
4453 <div class="min-w-0 flex-1 space-y-1.5">
4554 <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+ />
4761 </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>
4963 </form>
5064
5165 <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>
5369 </Show>
5470 </section>
5571
5672 <Suspense fallback={<PageSpinner />}>
5773 <Show when={report()}>
5874 {(r) => (
59- <div class="space-y-3">
60- <p class="text-sm text-muted-foreground">{t("marks.forUser", { user: lookupId() ?? "" })}</p>
75+ <div class="space-y-4">
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>
6179 <MarksReportView report={r()} />
6280 </div>
6381 )}