forge
Explore
Log in

Don't you dare go Hollow

💄 enhance UI consistency across attendance, course, event, and exam detail pages

Browse files at this commit

93620103c343a9d18f5f9cc69c0bc5240b4a6dadBurak BoduroğluParent: 57e942f
  • style
    • 💄 enhance UI consistency across attendance, course, event, and exam detail pages
Show full message
style: 💄 enhance UI consistency across attendance, course, event, and exam detail pages
src/components/events/attendance-table.tsxmodified+42 -40
@@ -28,52 +28,54 @@ export function AttendanceTable(props: {
28 <Show28 <Show
29 when={props.rows.length > 0}29 when={props.rows.length > 0}
30 fallback={30 fallback={
31- <p class="rounded-sm bg-muted/40 px-3 py-4 text-sm text-muted-foreground">31+ <p class="rounded-lg border border-dashed border-border/80 bg-muted/20 px-4 py-8 text-center text-sm text-muted-foreground">
32 {props.emptyLabel ?? t("events.noAttendance")}32 {props.emptyLabel ?? t("events.noAttendance")}
33 </p>33 </p>
34 }34 }
35 >35 >
36- <Table>36+ <div class="overflow-hidden rounded-lg border border-border/70 bg-background/60">
37- <TableHeader>37+ <Table>
38- <TableRow>38+ <TableHeader>
39- <TableHead>{t("events.userId")}</TableHead>39+ <TableRow>
40- <TableHead>{t("events.status")}</TableHead>40+ <TableHead>{t("events.userId")}</TableHead>
41- <TableHead>{t("events.markedBy")}</TableHead>41+ <TableHead>{t("events.status")}</TableHead>
42- <Show when={props.canRemove}>42+ <TableHead>{t("events.markedBy")}</TableHead>
43- <TableHead class="w-28" />43+ <Show when={props.canRemove}>
44- </Show>44+ <TableHead class="w-28" />
45- </TableRow>45+ </Show>
46- </TableHeader>46+ </TableRow>
47- <TableBody>47+ </TableHeader>
48- <For each={props.rows}>48+ <TableBody>
49- {(row) => (49+ <For each={props.rows}>
50- <TableRow class="h-12">50+ {(row) => (
51- <TableCell class="font-mono text-xs">{row.user}</TableCell>51+ <TableRow class="h-12">
52- <TableCell>52+ <TableCell class="font-mono text-xs">{row.user}</TableCell>
53- <Badge variant="secondary" class="capitalize">
54- {row.status}
55- </Badge>
56- </TableCell>
57- <TableCell class="font-mono text-xs">{row.marked_by}</TableCell>
58- <Show when={props.canRemove && props.onRemove}>
59 <TableCell>53 <TableCell>
60- <Button54+ <Badge variant="secondary" class="capitalize">
61- type="button"55+ {row.status}
62- variant="ghost"56+ </Badge>
63- size="sm"
64- class="text-destructive hover:bg-destructive/10 hover:text-destructive"
65- onClick={() => setTargetUser(row.user)}
66- >
67- <IconTrash class="h-4 w-4" />
68- {t("common.remove")}
69- </Button>
70 </TableCell>57 </TableCell>
71- </Show>58+ <TableCell class="font-mono text-xs">{row.marked_by}</TableCell>
72- </TableRow>59+ <Show when={props.canRemove && props.onRemove}>
73- )}60+ <TableCell>
74- </For>61+ <Button
75- </TableBody>62+ type="button"
76- </Table>63+ variant="ghost"
64+ size="sm"
65+ class="text-destructive hover:bg-destructive/10 hover:text-destructive"
66+ onClick={() => setTargetUser(row.user)}
67+ >
68+ <IconTrash class="h-4 w-4" />
69+ {t("common.remove")}
70+ </Button>
71+ </TableCell>
72+ </Show>
73+ </TableRow>
74+ )}
75+ </For>
76+ </TableBody>
77+ </Table>
78+ </div>
77 </Show>79 </Show>
78 80
79 <ConfirmDialog81 <ConfirmDialog
src/pages/course-detail-page.tsxmodified+25 -18
@@ -134,20 +134,20 @@ function CourseDetailContent() {
134 title={c().title}134 title={c().title}
135 description={c().description || undefined}135 description={c().description || undefined}
136 actions={136 actions={
137- <div class="flex flex-wrap items-center gap-1 rounded-md border bg-background/70 p-1 shadow-sm">137+ <div class="flex w-full flex-wrap items-center gap-1 rounded-lg border bg-background/80 p-1 shadow-sm sm:w-auto">
138 <Link to="/courses">138 <Link to="/courses">
139- <Button variant="ghost" size="sm" class="rounded-sm">139+ <Button variant="ghost" size="sm" class="w-full rounded-md sm:w-auto">
140 <IconChevronLeft class="h-4 w-4" />140 <IconChevronLeft class="h-4 w-4" />
141 {t("common.back")}141 {t("common.back")}
142 </Button>142 </Button>
143 </Link>143 </Link>
144 <Show when={canManage()}>144 <Show when={canManage()}>
145- <div class="ml-1 flex items-center gap-1 border-l border-border pl-1">145+ <div class="flex flex-1 items-center gap-1 border-t border-border pt-1 sm:ml-1 sm:flex-none sm:border-l sm:border-t-0 sm:pl-1 sm:pt-0">
146 <Button146 <Button
147 type="button"147 type="button"
148 variant="outline"148 variant="outline"
149 size="sm"149 size="sm"
150- class="rounded-sm"150+ class="flex-1 rounded-md sm:flex-none"
151 onClick={() => (editing() ? setEditing(false) : startEdit())}151 onClick={() => (editing() ? setEditing(false) : startEdit())}
152 >152 >
153 <IconEdit class="h-4 w-4" />153 <IconEdit class="h-4 w-4" />
@@ -157,7 +157,7 @@ function CourseDetailContent() {
157 type="button"157 type="button"
158 variant="destructive"158 variant="destructive"
159 size="sm"159 size="sm"
160- class="rounded-sm"160+ class="flex-1 rounded-md sm:flex-none"
161 onClick={() => setDeleteOpen(true)}161 onClick={() => setDeleteOpen(true)}
162 >162 >
163 <IconTrash class="h-4 w-4" />163 <IconTrash class="h-4 w-4" />
@@ -205,7 +205,7 @@ function CourseDetailContent() {
205 205
206 <Show when={editing()}>206 <Show when={editing()}>
207 <form207 <form
208- class="surface-card max-w-xl space-y-3 p-5"208+ class="surface-card max-w-2xl space-y-4 p-5"
209 onSubmit={(e) => {209 onSubmit={(e) => {
210 e.preventDefault();210 e.preventDefault();
211 void wrap(async () => {211 void wrap(async () => {
@@ -236,9 +236,11 @@ function CourseDetailContent() {
236 onInput={(e) => setDescription(e.currentTarget.value)}236 onInput={(e) => setDescription(e.currentTarget.value)}
237 />237 />
238 </div>238 </div>
239- <Button type="submit" disabled={pending()}>239+ <div class="flex justify-end">
240- {t("common.update")}240+ <Button type="submit" class="w-full sm:w-auto" disabled={pending()}>
241- </Button>241+ {t("common.update")}
242+ </Button>
243+ </div>
242 </form>244 </form>
243 </Show>245 </Show>
244 246
@@ -247,7 +249,7 @@ function CourseDetailContent() {
247 )}249 )}
248 250
249 <section class="grid gap-3 sm:grid-cols-3">251 <section class="grid gap-3 sm:grid-cols-3">
250- <div class="surface-card p-4">252+ <div class="surface-card bg-card/80 p-4">
251 <p class="text-xs font-semibold uppercase tracking-wider text-muted-foreground">253 <p class="text-xs font-semibold uppercase tracking-wider text-muted-foreground">
252 {t("courses.exams")}254 {t("courses.exams")}
253 </p>255 </p>
@@ -256,7 +258,7 @@ function CourseDetailContent() {
256 </div>258 </div>
257 259
258 <Show when={isTeacherPlus()}>260 <Show when={isTeacherPlus()}>
259- <div class="surface-card p-4">261+ <div class="surface-card bg-card/80 p-4">
260 <p class="text-xs font-semibold uppercase tracking-wider text-muted-foreground">262 <p class="text-xs font-semibold uppercase tracking-wider text-muted-foreground">
261 {t("courses.roster")}263 {t("courses.roster")}
262 </p>264 </p>
@@ -265,7 +267,7 @@ function CourseDetailContent() {
265 </div>267 </div>
266 </Show>268 </Show>
267 269
268- <div class="surface-card p-4">270+ <div class="surface-card bg-card/80 p-4">
269 <p class="text-xs font-semibold uppercase tracking-wider text-muted-foreground">271 <p class="text-xs font-semibold uppercase tracking-wider text-muted-foreground">
270 {t("courses.weight")}272 {t("courses.weight")}
271 </p>273 </p>
@@ -276,8 +278,13 @@ function CourseDetailContent() {
276 278
277 {/* Course exams */}279 {/* Course exams */}
278 <section class="surface-card space-y-4 p-5">280 <section class="surface-card space-y-4 p-5">
279- <div class="flex flex-wrap items-center justify-between gap-2">281+ <div class="flex flex-wrap items-center justify-between gap-3">
280- <h2 class="font-display text-lg font-semibold">{t("courses.exams")}</h2>282+ <div>
283+ <h2 class="font-display text-lg font-semibold">{t("courses.exams")}</h2>
284+ <p class="mt-1 text-sm text-muted-foreground">
285+ {examCount()} {t("nav.exams")}
286+ </p>
287+ </div>
281 <Show when={canManage()}>288 <Show when={canManage()}>
282 <Button289 <Button
283 type="button"290 type="button"
@@ -292,7 +299,7 @@ function CourseDetailContent() {
292 </div>299 </div>
293 300
294 <Show when={showExamForm() && canManage()}>301 <Show when={showExamForm() && canManage()}>
295- <div class="rounded-md border p-4">302+ <div class="rounded-lg border bg-background/60 p-4">
296 <ExamForm303 <ExamForm
297 submitLabel={t("common.create")}304 submitLabel={t("common.create")}
298 onSubmit={async (values) => {305 onSubmit={async (values) => {
@@ -416,13 +423,13 @@ function CourseDetailContent() {
416 </div>423 </div>
417 }424 }
418 >425 >
419- <div class="overflow-hidden rounded-lg border border-border/70">426+ <div class="overflow-hidden rounded-lg border border-border/70 bg-background/60">
420 <Table>427 <Table>
421 <TableHeader>428 <TableHeader>
422 <TableRow>429 <TableRow>
423 <TableHead>{t("admin.username")}</TableHead>430 <TableHead>{t("admin.username")}</TableHead>
424 <TableHead>{t("admin.id")}</TableHead>431 <TableHead>{t("admin.id")}</TableHead>
425- <TableHead class="w-24" />432+ <TableHead class="w-16 text-right" />
426 </TableRow>433 </TableRow>
427 </TableHeader>434 </TableHeader>
428 <TableBody>435 <TableBody>
@@ -441,7 +448,7 @@ function CourseDetailContent() {
441 type="button"448 type="button"
442 variant="ghost"449 variant="ghost"
443 size="sm"450 size="sm"
444- class="text-destructive"451+ class="text-destructive hover:bg-destructive/10 hover:text-destructive"
445 onClick={() =>452 onClick={() =>
446 setRemoveTarget({453 setRemoveTarget({
447 userId: row.user.id,454 userId: row.user.id,
src/pages/event-detail-page.tsxmodified+22 -13
@@ -93,20 +93,20 @@ function EventDetailContent() {
93 title={ev().title}93 title={ev().title}
94 description={`${formatDateTime(ev().starts_at, locale())} → ${formatDateTime(ev().ends_at, locale())}`}94 description={`${formatDateTime(ev().starts_at, locale())} → ${formatDateTime(ev().ends_at, locale())}`}
95 actions={95 actions={
96- <div class="flex flex-wrap items-center gap-1 rounded-md border bg-background/70 p-1 shadow-sm">96+ <div class="flex w-full flex-wrap items-center gap-1 rounded-lg border bg-background/80 p-1 shadow-sm sm:w-auto">
97 <Link to="/events">97 <Link to="/events">
98- <Button variant="ghost" size="sm" class="rounded-sm">98+ <Button variant="ghost" size="sm" class="w-full rounded-md sm:w-auto">
99 <IconChevronLeft class="h-4 w-4" />99 <IconChevronLeft class="h-4 w-4" />
100 {t("common.back")}100 {t("common.back")}
101 </Button>101 </Button>
102 </Link>102 </Link>
103 <Show when={canManage()}>103 <Show when={canManage()}>
104- <div class="ml-1 flex items-center gap-1 border-l border-border pl-1">104+ <div class="flex flex-1 items-center gap-1 border-t border-border pt-1 sm:ml-1 sm:flex-none sm:border-l sm:border-t-0 sm:pl-1 sm:pt-0">
105 <Button105 <Button
106 type="button"106 type="button"
107 variant="outline"107 variant="outline"
108 size="sm"108 size="sm"
109- class="rounded-sm"109+ class="flex-1 rounded-md sm:flex-none"
110 onClick={() => setEditing((v) => !v)}110 onClick={() => setEditing((v) => !v)}
111 >111 >
112 <IconEdit class="h-4 w-4" />112 <IconEdit class="h-4 w-4" />
@@ -116,7 +116,7 @@ function EventDetailContent() {
116 type="button"116 type="button"
117 variant="destructive"117 variant="destructive"
118 size="sm"118 size="sm"
119- class="rounded-sm"119+ class="flex-1 rounded-md sm:flex-none"
120 disabled={pending()}120 disabled={pending()}
121 onClick={() => setDeleteOpen(true)}121 onClick={() => setDeleteOpen(true)}
122 >122 >
@@ -148,7 +148,7 @@ function EventDetailContent() {
148 />148 />
149 149
150 <Show when={editing()}>150 <Show when={editing()}>
151- <section class="surface-card max-w-2xl p-5">151+ <section class="surface-card max-w-3xl p-5">
152 <EventForm152 <EventForm
153 initial={ev()}153 initial={ev()}
154 submitLabel={t("common.update")}154 submitLabel={t("common.update")}
@@ -170,12 +170,15 @@ function EventDetailContent() {
170 170
171 <div class="grid gap-4 lg:grid-cols-2">171 <div class="grid gap-4 lg:grid-cols-2">
172 <section class="surface-card p-5">172 <section class="surface-card p-5">
173- <h2 class="font-display text-lg font-semibold">{t("events.markSelf")}</h2>173+ <div>
174+ <h2 class="font-display text-lg font-semibold">{t("events.markSelf")}</h2>
175+ <p class="mt-1 text-sm text-muted-foreground">{t("events.status")}</p>
176+ </div>
174 <div class="mt-4 space-y-3">177 <div class="mt-4 space-y-3">
175 <AttendanceStatusPicker value={status()} onChange={setStatus} label={t("events.status")} />178 <AttendanceStatusPicker value={status()} onChange={setStatus} label={t("events.status")} />
176 <Button179 <Button
177 type="button"180 type="button"
178- class="rounded-sm"181+ class="w-full rounded-md sm:w-auto"
179 disabled={pending()}182 disabled={pending()}
180 onClick={() =>183 onClick={() =>
181 void wrap(async () => {184 void wrap(async () => {
@@ -191,13 +194,16 @@ function EventDetailContent() {
191 194
192 <Show when={isTeacherPlus()}>195 <Show when={isTeacherPlus()}>
193 <section class="surface-card p-5">196 <section class="surface-card p-5">
194- <h2 class="font-display text-lg font-semibold">{t("events.markOther")}</h2>197+ <div>
198+ <h2 class="font-display text-lg font-semibold">{t("events.markOther")}</h2>
199+ <p class="mt-1 text-sm text-muted-foreground">{t("events.userId")}</p>
200+ </div>
195 <div class="mt-4 grid gap-3">201 <div class="mt-4 grid gap-3">
196 <div class="space-y-1.5">202 <div class="space-y-1.5">
197 <Label for="other-user">{t("events.userId")}</Label>203 <Label for="other-user">{t("events.userId")}</Label>
198 <Input204 <Input
199 id="other-user"205 id="other-user"
200- class="rounded-sm"206+ class="h-10 rounded-md"
201 value={otherUserId()}207 value={otherUserId()}
202 onInput={(e) => setOtherUserId(e.currentTarget.value)}208 onInput={(e) => setOtherUserId(e.currentTarget.value)}
203 />209 />
@@ -210,7 +216,7 @@ function EventDetailContent() {
210 />216 />
211 <Button217 <Button
212 type="button"218 type="button"
213- class="rounded-sm"219+ class="w-full rounded-md sm:w-auto"
214 disabled={pending()}220 disabled={pending()}
215 onClick={() =>221 onClick={() =>
216 void wrap(async () => {222 void wrap(async () => {
@@ -239,8 +245,11 @@ function EventDetailContent() {
239 <p class="rounded-sm bg-destructive/10 px-3 py-2 text-sm text-destructive">{error()}</p>245 <p class="rounded-sm bg-destructive/10 px-3 py-2 text-sm text-destructive">{error()}</p>
240 )}246 )}
241 247
242- <section class="surface-card p-5">248+ <section class="surface-card space-y-4 p-5">
243- <h2 class="mb-4 font-display text-lg font-semibold">{t("events.attendance")}</h2>249+ <div>
250+ <h2 class="font-display text-lg font-semibold">{t("events.attendance")}</h2>
251+ <p class="mt-1 text-sm text-muted-foreground">{t("events.markedBy")}</p>
252+ </div>
244 <Suspense fallback={<PageSpinner />}>253 <Suspense fallback={<PageSpinner />}>
245 <Show when={attendance()}>254 <Show when={attendance()}>
246 {(rows) => (255 {(rows) => (
src/pages/exam-detail-page.tsxmodified+71 -68
@@ -169,16 +169,16 @@ function ExamDetailContent() {
169 title={ex().title}169 title={ex().title}
170 description={ex().description || "—"}170 description={ex().description || "—"}
171 actions={171 actions={
172- <div class="flex flex-wrap items-center gap-1 rounded-md border bg-background/70 p-1 shadow-sm">172+ <div class="flex w-full flex-wrap items-center gap-1 rounded-lg border bg-background/80 p-1 shadow-sm sm:w-auto">
173 <Link to="/exams">173 <Link to="/exams">
174- <Button variant="ghost" size="sm" class="rounded-sm">174+ <Button variant="ghost" size="sm" class="w-full rounded-md sm:w-auto">
175 <IconChevronLeft class="h-4 w-4" />175 <IconChevronLeft class="h-4 w-4" />
176 {t("common.back")}176 {t("common.back")}
177 </Button>177 </Button>
178 </Link>178 </Link>
179 <Show when={!isFinished() && !isUpcoming() && (ex().mode === "sync" || ex().mode === "async")}>179 <Show when={!isFinished() && !isUpcoming() && (ex().mode === "sync" || ex().mode === "async")}>
180 <Link to="/exam-room/$id" params={{ id: id() }}>180 <Link to="/exam-room/$id" params={{ id: id() }}>
181- <Button size="sm" class="rounded-sm">181+ <Button size="sm" class="flex-1 rounded-md sm:flex-none">
182 <IconExam class="h-4 w-4" />182 <IconExam class="h-4 w-4" />
183 {t("attempt.openRoom")}183 {t("attempt.openRoom")}
184 </Button>184 </Button>
@@ -186,19 +186,19 @@ function ExamDetailContent() {
186 </Show>186 </Show>
187 <Show when={isTeacherPlus() && !isUpcoming() && (ex().mode === "sync" || ex().mode === "async")}>187 <Show when={isTeacherPlus() && !isUpcoming() && (ex().mode === "sync" || ex().mode === "async")}>
188 <Link to="/exams/$id/live" params={{ id: id() }}>188 <Link to="/exams/$id/live" params={{ id: id() }}>
189- <Button variant="outline" size="sm" class="rounded-sm">189+ <Button variant="outline" size="sm" class="flex-1 rounded-md sm:flex-none">
190 <IconEye class="h-4 w-4" />190 <IconEye class="h-4 w-4" />
191 {isFinished() ? t("exams.finalState") : t("exams.liveMonitor")}191 {isFinished() ? t("exams.finalState") : t("exams.liveMonitor")}
192 </Button>192 </Button>
193 </Link>193 </Link>
194 </Show>194 </Show>
195 <Show when={canManage()}>195 <Show when={canManage()}>
196- <div class="ml-1 flex items-center gap-1 border-l border-border pl-1">196+ <div class="flex flex-1 items-center gap-1 border-t border-border pt-1 sm:ml-1 sm:flex-none sm:border-l sm:border-t-0 sm:pl-1 sm:pt-0">
197 <Button197 <Button
198 type="button"198 type="button"
199 variant="outline"199 variant="outline"
200 size="sm"200 size="sm"
201- class="rounded-sm"201+ class="flex-1 rounded-md sm:flex-none"
202 onClick={() => setEditing((v) => !v)}202 onClick={() => setEditing((v) => !v)}
203 >203 >
204 <IconEdit class="h-4 w-4" />204 <IconEdit class="h-4 w-4" />
@@ -208,6 +208,7 @@ function ExamDetailContent() {
208 type="button"208 type="button"
209 variant="destructive"209 variant="destructive"
210 size="sm"210 size="sm"
211+ class="flex-1 rounded-md sm:flex-none"
211 disabled={pending()}212 disabled={pending()}
212 onClick={() => setDeleteOpen(true)}213 onClick={() => setDeleteOpen(true)}
213 >214 >
@@ -277,22 +278,22 @@ function ExamDetailContent() {
277 </section>278 </section>
278 </Show>279 </Show>
279 280
280- <section class="surface-card p-5">281+ <section class="surface-card space-y-4 p-5">
281- <h2 class="mb-4 font-display text-lg font-semibold">{t("exams.schedule")}</h2>282+ <h2 class="font-display text-lg font-semibold">{t("exams.schedule")}</h2>
282 <div class="grid gap-3 text-sm sm:grid-cols-2 lg:grid-cols-4">283 <div class="grid gap-3 text-sm sm:grid-cols-2 lg:grid-cols-4">
283- <div class="rounded-md border p-3">284+ <div class="rounded-lg border bg-background/60 p-3">
284 <p class="text-xs text-muted-foreground">{t("exams.mode")}</p>285 <p class="text-xs text-muted-foreground">{t("exams.mode")}</p>
285 <p class="mt-1 font-medium">{examModeLabel(ex().mode)}</p>286 <p class="mt-1 font-medium">{examModeLabel(ex().mode)}</p>
286 </div>287 </div>
287- <div class="rounded-md border p-3">288+ <div class="rounded-lg border bg-background/60 p-3">
288 <p class="text-xs text-muted-foreground">{t("events.starts")}</p>289 <p class="text-xs text-muted-foreground">{t("events.starts")}</p>
289 <p class="mt-1 font-medium">{formatDateTime(ex().starts_at, locale())}</p>290 <p class="mt-1 font-medium">{formatDateTime(ex().starts_at, locale())}</p>
290 </div>291 </div>
291- <div class="rounded-md border p-3">292+ <div class="rounded-lg border bg-background/60 p-3">
292 <p class="text-xs text-muted-foreground">{t("events.ends")}</p>293 <p class="text-xs text-muted-foreground">{t("events.ends")}</p>
293 <p class="mt-1 font-medium">{formatDateTime(ex().ends_at, locale())}</p>294 <p class="mt-1 font-medium">{formatDateTime(ex().ends_at, locale())}</p>
294 </div>295 </div>
295- <div class="rounded-md border p-3">296+ <div class="rounded-lg border bg-background/60 p-3">
296 <p class="text-xs text-muted-foreground">{t("exams.durationMinutes")}</p>297 <p class="text-xs text-muted-foreground">{t("exams.durationMinutes")}</p>
297 <p class="mt-1 font-medium">{formatDurationMinutes(examDurationMs(ex().duration_ms, ex().starts_at, ex().ends_at), locale())}</p>298 <p class="mt-1 font-medium">{formatDurationMinutes(examDurationMs(ex().duration_ms, ex().starts_at, ex().ends_at), locale())}</p>
298 </div>299 </div>
@@ -313,8 +314,8 @@ function ExamDetailContent() {
313 </Show>314 </Show>
314 315
315 <Show when={isTeacherPlus() && sheetUserId()}>316 <Show when={isTeacherPlus() && sheetUserId()}>
316- <section class="surface-card p-5">317+ <section class="surface-card space-y-4 p-5">
317- <h2 class="mb-4 font-display text-lg font-semibold">{t("exams.answerSheet")} — {sheetUserId()}</h2>318+ <h2 class="font-display text-lg font-semibold">{t("exams.answerSheet")} — {sheetUserId()}</h2>
318 <Suspense fallback={<PageSpinner />}>319 <Suspense fallback={<PageSpinner />}>
319 <AnswerSheetView examId={id()} userId={sheetUserId()!} />320 <AnswerSheetView examId={id()} userId={sheetUserId()!} />
320 </Suspense>321 </Suspense>
@@ -322,25 +323,25 @@ function ExamDetailContent() {
322 </Show>323 </Show>
323 324
324 <Show when={isTeacherPlus()}>325 <Show when={isTeacherPlus()}>
325- <section class="surface-card p-5">326+ <section class="surface-card space-y-4 p-5">
326- <h2 class="mb-4 font-display text-lg font-semibold">{t("exams.statistics")}</h2>327+ <h2 class="font-display text-lg font-semibold">{t("exams.statistics")}</h2>
327 <Suspense fallback={<PageSpinner />}>328 <Suspense fallback={<PageSpinner />}>
328 <Show when={stats()}>329 <Show when={stats()}>
329 {(s) => (330 {(s) => (
330 <div class="grid gap-3 text-sm sm:grid-cols-4">331 <div class="grid gap-3 text-sm sm:grid-cols-4">
331- <div class="rounded-md border p-3">332+ <div class="rounded-lg border bg-background/60 p-3">
332 <p class="text-xs text-muted-foreground">{t("exams.graded")}</p>333 <p class="text-xs text-muted-foreground">{t("exams.graded")}</p>
333 <p class="mt-1 font-display text-2xl font-semibold tabular-nums">{s().graded}</p>334 <p class="mt-1 font-display text-2xl font-semibold tabular-nums">{s().graded}</p>
334 </div>335 </div>
335- <div class="rounded-md border p-3">336+ <div class="rounded-lg border bg-background/60 p-3">
336 <p class="text-xs text-muted-foreground">{t("exams.average")}</p>337 <p class="text-xs text-muted-foreground">{t("exams.average")}</p>
337 <p class="mt-1 font-display text-2xl font-semibold tabular-nums">{s().average == null ? "—" : s().average}</p>338 <p class="mt-1 font-display text-2xl font-semibold tabular-nums">{s().average == null ? "—" : s().average}</p>
338 </div>339 </div>
339- <div class="rounded-md border p-3">340+ <div class="rounded-lg border bg-background/60 p-3">
340 <p class="text-xs text-muted-foreground">{t("exams.min")}</p>341 <p class="text-xs text-muted-foreground">{t("exams.min")}</p>
341 <p class="mt-1 font-display text-2xl font-semibold tabular-nums">{s().min == null ? "—" : s().min}</p>342 <p class="mt-1 font-display text-2xl font-semibold tabular-nums">{s().min == null ? "—" : s().min}</p>
342 </div>343 </div>
343- <div class="rounded-md border p-3">344+ <div class="rounded-lg border bg-background/60 p-3">
344 <p class="text-xs text-muted-foreground">{t("exams.max")}</p>345 <p class="text-xs text-muted-foreground">{t("exams.max")}</p>
345 <p class="mt-1 font-display text-2xl font-semibold tabular-nums">{s().max == null ? "—" : s().max}</p>346 <p class="mt-1 font-display text-2xl font-semibold tabular-nums">{s().max == null ? "—" : s().max}</p>
346 </div>347 </div>
@@ -353,8 +354,8 @@ function ExamDetailContent() {
353 <ExamQuestionsPanel examId={id()} readOnly={isFinished() || isUpcoming()} />354 <ExamQuestionsPanel examId={id()} readOnly={isFinished() || isUpcoming()} />
354 355
355 <Show when={!isFinished()}>356 <Show when={!isFinished()}>
356- <section class="surface-card p-5">357+ <section class="surface-card space-y-4 p-5">
357- <h2 class="mb-4 font-display text-lg font-semibold">{t("exams.gradeStudent")}</h2>358+ <h2 class="font-display text-lg font-semibold">{t("exams.gradeStudent")}</h2>
358 <GradeForm359 <GradeForm
359 students={gradeStudents()}360 students={gradeStudents()}
360 onSubmit={async (values) => {361 onSubmit={async (values) => {
@@ -365,68 +366,70 @@ function ExamDetailContent() {
365 </section>366 </section>
366 </Show>367 </Show>
367 368
368- <section class="surface-card p-5">369+ <section class="surface-card space-y-4 p-5">
369- <h2 class="mb-4 font-display text-lg font-semibold">{t("exams.results")}</h2>370+ <h2 class="font-display text-lg font-semibold">{t("exams.results")}</h2>
370 <Suspense fallback={<PageSpinner />}>371 <Suspense fallback={<PageSpinner />}>
371 <Show372 <Show
372 when={(results() ?? []).length > 0}373 when={(results() ?? []).length > 0}
373 fallback={374 fallback={
374- <p class="rounded-sm bg-muted/40 px-3 py-4 text-sm text-muted-foreground">375+ <p class="rounded-lg border border-dashed border-border/80 bg-muted/20 px-4 py-8 text-center text-sm text-muted-foreground">
375 {t("exams.noResults")}376 {t("exams.noResults")}
376 </p>377 </p>
377 }378 }
378 >379 >
379- <Table>380+ <div class="overflow-hidden rounded-lg border border-border/70 bg-background/60">
380- <TableHeader>381+ <Table>
381- <TableRow>382+ <TableHeader>
382- <TableHead>{t("events.userId")}</TableHead>383+ <TableRow>
383- <TableHead>{t("form.mark")}</TableHead>384+ <TableHead>{t("events.userId")}</TableHead>
384- <TableHead>{t("exams.gradedBy")}</TableHead>385+ <TableHead>{t("form.mark")}</TableHead>
385- <TableHead>{t("exams.answerSheet")}</TableHead>386+ <TableHead>{t("exams.gradedBy")}</TableHead>
386- <Show when={!isFinished()}>387+ <TableHead>{t("exams.answerSheet")}</TableHead>
387- <TableHead class="w-24" />388+ <Show when={!isFinished()}>
388- </Show>389+ <TableHead class="w-24" />
389- </TableRow>390+ </Show>
390- </TableHeader>391+ </TableRow>
391- <TableBody>392+ </TableHeader>
392- <For each={results() ?? []}>393+ <TableBody>
393- {(row) => (394+ <For each={results() ?? []}>
394- <TableRow class="h-12">395+ {(row) => (
395- <TableCell class="font-mono text-xs">{row.user}</TableCell>396+ <TableRow class="h-12">
396- <TableCell>397+ <TableCell class="font-mono text-xs">{row.user}</TableCell>
397- <ExamResultBadge mark={row.mark} />398+ <TableCell>
398- </TableCell>399+ <ExamResultBadge mark={row.mark} />
399- <TableCell class="font-mono text-xs">{row.graded_by}</TableCell>400+ </TableCell>
400- <TableCell>401+ <TableCell class="font-mono text-xs">{row.graded_by}</TableCell>
401- <Button
402- type="button"
403- variant="ghost"
404- size="sm"
405- class="rounded-sm"
406- onClick={() => setSheetUserId(sheetUserId() === row.user ? null : row.user)}
407- >
408- <IconEye class="h-4 w-4" />
409- </Button>
410- </TableCell>
411- <Show when={!isFinished()}>
412 <TableCell>402 <TableCell>
413 <Button403 <Button
414 type="button"404 type="button"
415 variant="ghost"405 variant="ghost"
416 size="sm"406 size="sm"
417- class="text-destructive hover:bg-destructive/10 hover:text-destructive"407+ class="rounded-md"
418- onClick={() => setRemoveUserId(row.user)}408+ onClick={() => setSheetUserId(sheetUserId() === row.user ? null : row.user)}
419 >409 >
420- <IconTrash class="h-4 w-4" />410+ <IconEye class="h-4 w-4" />
421- {t("common.remove")}
422 </Button>411 </Button>
423 </TableCell>412 </TableCell>
424- </Show>413+ <Show when={!isFinished()}>
425- </TableRow>414+ <TableCell>
426- )}415+ <Button
427- </For>416+ type="button"
428- </TableBody>417+ variant="ghost"
429- </Table>418+ size="sm"
419+ class="text-destructive hover:bg-destructive/10 hover:text-destructive"
420+ onClick={() => setRemoveUserId(row.user)}
421+ >
422+ <IconTrash class="h-4 w-4" />
423+ {t("common.remove")}
424+ </Button>
425+ </TableCell>
426+ </Show>
427+ </TableRow>
428+ )}
429+ </For>
430+ </TableBody>
431+ </Table>
432+ </div>
430 </Show>433 </Show>
431 </Suspense>434 </Suspense>
432 </section>435 </section>