✨ refine detail panels and question bank
Browse files at this commit45223bee181891f7103ae7d187ce1d8f5add7b3fParent: a473470- feat
- ✨ refine detail panels and question bank
11 changed files +90 -61
- src/components/classes/blueprints-tab.tsx +1 -1
- src/components/exams/question-form.tsx +2 -2
- src/components/homework/homework-submissions-panel.tsx +2 -2
- src/components/ui/data-table.tsx +2 -2
- src/components/ui/side-panel.tsx +7 -1
- src/components/users/profile-form.tsx +2 -2
- src/i18n/messages.ts +3 -0
- src/pages/admin-user-detail-page.tsx +32 -32
- src/pages/exam-detail-page.tsx +9 -9
- src/pages/homework-detail-page.tsx +9 -9
- src/pages/question-bank-page.tsx +21 -1
src/components/classes/blueprints-tab.tsxmodified+1 -1
| @@ -184,7 +184,7 @@ export function BlueprintsTab(props: { | |||
| 184 | actions={ | 184 | actions={ |
| 185 | <Button | 185 | <Button |
| 186 | size="sm" | 186 | size="sm" |
| 187 | - class="min-w-30 rounded-lg" | 187 | + class="rounded-lg" |
| 188 | onClick={() => { | 188 | onClick={() => { |
| 189 | setEditing(null); | 189 | setEditing(null); |
| 190 | setPanelOpen(true); | 190 | setPanelOpen(true); |
src/components/exams/question-form.tsxmodified+2 -2
| @@ -246,7 +246,7 @@ export function QuestionForm(props: { | |||
| 246 | }; | 246 | }; |
| 247 | 247 | ||
| 248 | return ( | 248 | return ( |
| 249 | - <form class="space-y-3" onSubmit={(e) => void submit(e)}> | 249 | + <form class="flex min-h-full flex-col space-y-3" onSubmit={(e) => void submit(e)}> |
| 250 | <div class="rounded-lg border bg-card p-3.5 shadow-xs"> | 250 | <div class="rounded-lg border bg-card p-3.5 shadow-xs"> |
| 251 | <div class="space-y-2"> | 251 | <div class="space-y-2"> |
| 252 | <Label for="question-text" class="text-sm font-semibold">{t("questions.text")}</Label> | 252 | <Label for="question-text" class="text-sm font-semibold">{t("questions.text")}</Label> |
| @@ -464,7 +464,7 @@ export function QuestionForm(props: { | |||
| 464 | 464 | ||
| 465 | {error() && <p class="rounded-sm bg-destructive/10 px-3 py-1.5 text-sm text-destructive-text">{error()}</p>} | 465 | {error() && <p class="rounded-sm bg-destructive/10 px-3 py-1.5 text-sm text-destructive-text">{error()}</p>} |
| 466 | 466 | ||
| 467 | - <div class="flex flex-wrap items-center gap-2 pt-1"> | 467 | + <div class="sticky bottom-0 -mx-5 flex flex-wrap items-center gap-2 border-t border-border-hairline bg-surface-base px-5 pb-1 pt-4"> |
| 468 | <Button type="submit" class="h-8 text-xs font-semibold" disabled={pending()}> | 468 | <Button type="submit" class="h-8 text-xs font-semibold" disabled={pending()}> |
| 469 | {props.submitLabel ?? (props.initial ? t("common.update") : t("common.create"))} | 469 | {props.submitLabel ?? (props.initial ? t("common.update") : t("common.create"))} |
| 470 | </Button> | 470 | </Button> |
src/components/homework/homework-submissions-panel.tsxmodified+2 -2
| @@ -160,7 +160,7 @@ export function HomeworkSubmissionsPanel(props: { homeworkId: string; instanceId | |||
| 160 | <DataTable columns={columns()} data={submissions()?.items ?? []} filterColumn="user" enablePagination pageSize={10} empty={t("common.noResults")} /> | 160 | <DataTable columns={columns()} data={submissions()?.items ?? []} filterColumn="user" enablePagination pageSize={10} empty={t("common.noResults")} /> |
| 161 | </Suspense> | 161 | </Suspense> |
| 162 | <SidePanel open={gradeTarget() != null} onOpenChange={(open) => !open && closeGrade()} title={t("homework.grade")} description={gradeTarget() ? studentLabel(gradeTarget()!.user) : ""}> | 162 | <SidePanel open={gradeTarget() != null} onOpenChange={(open) => !open && closeGrade()} title={t("homework.grade")} description={gradeTarget() ? studentLabel(gradeTarget()!.user) : ""}> |
| 163 | - <form class="space-y-4" onSubmit={(event) => void saveGrade(event)}> | 163 | + <form class="flex min-h-full flex-col space-y-4" onSubmit={(event) => void saveGrade(event)}> |
| 164 | <Show when={error()}><Alert variant="destructive">{error()}</Alert></Show> | 164 | <Show when={error()}><Alert variant="destructive">{error()}</Alert></Show> |
| 165 | <div class="space-y-1.5"> | 165 | <div class="space-y-1.5"> |
| 166 | <Label for="homework-grade-status">{t("events.status")}</Label> | 166 | <Label for="homework-grade-status">{t("events.status")}</Label> |
| @@ -174,7 +174,7 @@ export function HomeworkSubmissionsPanel(props: { homeworkId: string; instanceId | |||
| 174 | <Label for="homework-grade-mark">{t("form.mark")}</Label> | 174 | <Label for="homework-grade-mark">{t("form.mark")}</Label> |
| 175 | <Input id="homework-grade-mark" type="number" min="0" max="100" value={mark()} onInput={(event) => setMark(event.currentTarget.value)} /> | 175 | <Input id="homework-grade-mark" type="number" min="0" max="100" value={mark()} onInput={(event) => setMark(event.currentTarget.value)} /> |
| 176 | </div> | 176 | </div> |
| 177 | - <div class="flex gap-2"> | 177 | + <div class="!mt-auto sticky bottom-0 -mx-5 flex gap-2 border-t border-border-hairline bg-surface-base px-5 pb-1 pt-4"> |
| 178 | <Button type="submit" class="rounded-lg" disabled={pending()}>{t("common.save")}</Button> | 178 | <Button type="submit" class="rounded-lg" disabled={pending()}>{t("common.save")}</Button> |
| 179 | <Button type="button" variant="outline" class="rounded-lg" onClick={closeGrade}>{t("common.cancel")}</Button> | 179 | <Button type="button" variant="outline" class="rounded-lg" onClick={closeGrade}>{t("common.cancel")}</Button> |
| 180 | </div> | 180 | </div> |
src/components/ui/data-table.tsxmodified+2 -2
| @@ -306,7 +306,7 @@ export function DataTable<TData, TValue = unknown>(props: DataTableProps<TData, | |||
| 306 | </Show> | 306 | </Show> |
| 307 | </div> | 307 | </div> |
| 308 | <Show when={props.actions}> | 308 | <Show when={props.actions}> |
| 309 | - <div class="flex min-w-0 flex-wrap items-center gap-2 [&_button]:h-9 [&_button]:rounded-md">{props.actions}</div> | 309 | + <div class="flex min-w-0 flex-wrap items-center gap-2 [&_button]:rounded-md">{props.actions}</div> |
| 310 | </Show> | 310 | </Show> |
| 311 | </div> | 311 | </div> |
| 312 | </Show> | 312 | </Show> |
| @@ -327,7 +327,7 @@ export function DataTable<TData, TValue = unknown>(props: DataTableProps<TData, | |||
| 327 | </div> | 327 | </div> |
| 328 | <div class="flex shrink-0 flex-wrap items-center justify-end gap-2"> | 328 | <div class="flex shrink-0 flex-wrap items-center justify-end gap-2"> |
| 329 | <Show when={props.actions}> | 329 | <Show when={props.actions}> |
| 330 | - <div class="flex min-w-0 flex-wrap items-center gap-2 [&_button]:h-9 [&_button]:rounded-md">{props.actions}</div> | 330 | + <div class="flex min-w-0 flex-wrap items-center gap-2 [&_button]:rounded-md">{props.actions}</div> |
| 331 | </Show> | 331 | </Show> |
| 332 | <Show when={showColumnMenu()}> | 332 | <Show when={showColumnMenu()}> |
| 333 | <DataTableViewMenu columns={viewMenuColumns()} /> | 333 | <DataTableViewMenu columns={viewMenuColumns()} /> |
src/components/ui/side-panel.tsxmodified+7 -1
| @@ -112,7 +112,13 @@ export function SidePanel( | |||
| 112 | </DialogPrimitive.CloseButton> | 112 | </DialogPrimitive.CloseButton> |
| 113 | </div> | 113 | </div> |
| 114 | <div | 114 | <div |
| 115 | - class={cn("side-panel-body min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain px-5 py-5", props.bodyClass)} | 115 | + class={cn( |
| 116 | + "side-panel-body min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain px-5 py-5", | ||
| 117 | + // Short forms should still use the full panel height so their | ||
| 118 | + // actions settle at the bottom instead of floating above empty space. | ||
| 119 | + "[&>form]:flex [&>form]:min-h-full [&>form]:flex-col [&>form>div:last-child]:mt-auto", | ||
| 120 | + props.bodyClass, | ||
| 121 | + )} | ||
| 116 | onInput={markTouched} | 122 | onInput={markTouched} |
| 117 | onChange={markTouched} | 123 | onChange={markTouched} |
| 118 | > | 124 | > |
src/components/users/profile-form.tsxmodified+2 -2
| @@ -131,7 +131,7 @@ export function ProfileForm(props: { | |||
| 131 | }; | 131 | }; |
| 132 | 132 | ||
| 133 | return ( | 133 | return ( |
| 134 | - <form onSubmit={submit} class="space-y-4"> | 134 | + <form onSubmit={submit} class="flex min-h-full flex-col space-y-4"> |
| 135 | <Show when={flash()}> | 135 | <Show when={flash()}> |
| 136 | <Alert variant="success">{flash()}</Alert> | 136 | <Alert variant="success">{flash()}</Alert> |
| 137 | </Show> | 137 | </Show> |
| @@ -196,7 +196,7 @@ export function ProfileForm(props: { | |||
| 196 | <DatePicker id="pf-birth" class="h-10" placeholder={t("form.datePlaceholder")} value={birthDate()} onChange={setBirthDate} /> | 196 | <DatePicker id="pf-birth" class="h-10" placeholder={t("form.datePlaceholder")} value={birthDate()} onChange={setBirthDate} /> |
| 197 | </div> | 197 | </div> |
| 198 | {error() && <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive-text">{error()}</p>} | 198 | {error() && <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive-text">{error()}</p>} |
| 199 | - <div class="flex justify-end"> | 199 | + <div class="!mt-auto sticky bottom-0 -mx-5 flex justify-end border-t border-border-hairline bg-surface-base px-5 pb-1 pt-4"> |
| 200 | <Button type="submit" class="w-full sm:w-auto" disabled={pending()}>{t("common.save")}</Button> | 200 | <Button type="submit" class="w-full sm:w-auto" disabled={pending()}>{t("common.save")}</Button> |
| 201 | </div> | 201 | </div> |
| 202 | </form> | 202 | </form> |
src/i18n/messages.tsmodified+3 -0
| @@ -570,6 +570,7 @@ export type MessageKey = | |||
| 570 | | "common.reject" | 570 | | "common.reject" |
| 571 | | "common.action" | 571 | | "common.action" |
| 572 | | "common.actions" | 572 | | "common.actions" |
| 573 | + | "common.filter" | ||
| 573 | | "common.export" | 574 | | "common.export" |
| 574 | | "common.columns" | 575 | | "common.columns" |
| 575 | | "common.visibleColumns" | 576 | | "common.visibleColumns" |
| @@ -2814,6 +2815,7 @@ const en: Dict = { | |||
| 2814 | "common.reject": "Reject", | 2815 | "common.reject": "Reject", |
| 2815 | "common.action": "Action", | 2816 | "common.action": "Action", |
| 2816 | "common.actions": "Actions", | 2817 | "common.actions": "Actions", |
| 2818 | + "common.filter": "Filter", | ||
| 2817 | "common.export": "Export", | 2819 | "common.export": "Export", |
| 2818 | "common.columns": "Columns", | 2820 | "common.columns": "Columns", |
| 2819 | "common.visibleColumns": "Visible columns", | 2821 | "common.visibleColumns": "Visible columns", |
| @@ -5060,6 +5062,7 @@ const tr: Dict = { | |||
| 5060 | "common.reject": "Reddet", | 5062 | "common.reject": "Reddet", |
| 5061 | "common.action": "İşlem", | 5063 | "common.action": "İşlem", |
| 5062 | "common.actions": "İşlemler", | 5064 | "common.actions": "İşlemler", |
| 5065 | + "common.filter": "Filtre", | ||
| 5063 | "common.export": "Dışa aktar", | 5066 | "common.export": "Dışa aktar", |
| 5064 | "common.columns": "Sütunlar", | 5067 | "common.columns": "Sütunlar", |
| 5065 | "common.visibleColumns": "Görünür sütunlar", | 5068 | "common.visibleColumns": "Görünür sütunlar", |
src/pages/admin-user-detail-page.tsxmodified+32 -32
| @@ -65,44 +65,44 @@ function AdminUserDetailContent() { | |||
| 65 | } | 65 | } |
| 66 | > | 66 | > |
| 67 | {(current) => ( | 67 | {(current) => ( |
| 68 | - <div class="space-y-5"> | 68 | + <div class="mx-auto w-full max-w-[1100px] space-y-5"> |
| 69 | <Show when={error()}> | 69 | <Show when={error()}> |
| 70 | <Alert variant="destructive">{error()}</Alert> | 70 | <Alert variant="destructive">{error()}</Alert> |
| 71 | </Show> | 71 | </Show> |
| 72 | - <section class="rounded-xl border border-border-line bg-surface-base px-4 py-3 shadow-xs sm:px-5"> | 72 | + <section class="data-shell space-y-2 p-4 sm:p-5"> |
| 73 | - <Breadcrumbs | 73 | + <Breadcrumbs |
| 74 | - items={[ | 74 | + items={[ |
| 75 | - { label: t("nav.users"), to: "/admin/users" }, | 75 | + { label: t("nav.users"), to: "/admin/users" }, |
| 76 | - { label: [current().name, current().surname].filter(Boolean).join(" ") || current().username }, | 76 | + { label: [current().name, current().surname].filter(Boolean).join(" ") || current().username }, |
| 77 | - ]} | 77 | + ]} |
| 78 | - /> | 78 | + /> |
| 79 | - <PageHeader | 79 | + <PageHeader |
| 80 | - title={[current().name, current().surname].filter(Boolean).join(" ") || current().username} | 80 | + title={[current().name, current().surname].filter(Boolean).join(" ") || current().username} |
| 81 | - description={`@${current().username}`} | 81 | + description={`@${current().username}`} |
| 82 | - actions={ | 82 | + actions={ |
| 83 | - <> | 83 | + <> |
| 84 | - <Link to="/profile/$userId" params={{ userId: current().id }}> | 84 | + <Link to="/profile/$userId" params={{ userId: current().id }}> |
| 85 | - <Button type="button" variant="outline" size="sm"> | 85 | + <Button type="button" variant="ghost" size="sm"> |
| 86 | - <IconExternalLink class="h-4 w-4" /> | 86 | + <IconExternalLink class="h-4 w-4" /> |
| 87 | - {t("profile.viewProfile")} | 87 | + {t("profile.viewProfile")} |
| 88 | - </Button> | 88 | + </Button> |
| 89 | - </Link> | 89 | + </Link> |
| 90 | - <Button type="button" variant="outline" size="sm" onClick={() => setEditing(true)}> | 90 | + <Button type="button" size="sm" onClick={() => setEditing(true)}> |
| 91 | - <IconEdit class="h-4 w-4" /> | 91 | + <IconEdit class="h-4 w-4" /> |
| 92 | - {t("common.edit")} | 92 | + {t("common.edit")} |
| 93 | - </Button> | ||
| 94 | - <Show when={current().role === "parent"}> | ||
| 95 | - <Button type="button" variant="outline" size="sm" onClick={() => setStudentsOpen(true)}> | ||
| 96 | - <IconUsers class="h-4 w-4" /> | ||
| 97 | - {t("parentLink.manage")} | ||
| 98 | </Button> | 93 | </Button> |
| 99 | - </Show> | 94 | + <Show when={current().role === "parent"}> |
| 100 | - </> | 95 | + <Button type="button" variant="outline" size="sm" onClick={() => setStudentsOpen(true)}> |
| 101 | - } | 96 | + <IconUsers class="h-4 w-4" /> |
| 102 | - /> | 97 | + {t("parentLink.manage")} |
| 98 | + </Button> | ||
| 99 | + </Show> | ||
| 100 | + </> | ||
| 101 | + } | ||
| 102 | + /> | ||
| 103 | </section> | 103 | </section> |
| 104 | 104 | ||
| 105 | - <section class="data-shell grid gap-4 p-5 sm:grid-cols-2 lg:grid-cols-3"> | 105 | + <section class="data-shell grid gap-4 p-4 sm:grid-cols-2 sm:p-5 lg:grid-cols-3"> |
| 106 | <DetailField label={t("admin.username")} value={current().username} /> | 106 | <DetailField label={t("admin.username")} value={current().username} /> |
| 107 | <DetailField label={t("profile.email")} value={current().email || "—"} /> | 107 | <DetailField label={t("profile.email")} value={current().email || "—"} /> |
| 108 | <DetailField label={t("profile.phone")} value={current().phone || "—"} /> | 108 | <DetailField label={t("profile.phone")} value={current().phone || "—"} /> |
src/pages/exam-detail-page.tsxmodified+9 -9
| @@ -391,8 +391,8 @@ function ExamDetailContent() { | |||
| 391 | {(ex) => ( | 391 | {(ex) => ( |
| 392 | <Show when={accessReady()} fallback={<PageSpinner />}> | 392 | <Show when={accessReady()} fallback={<PageSpinner />}> |
| 393 | <Show when={canViewExam()} fallback={<Alert variant="destructive">{t("common.accessDenied")}</Alert>}> | 393 | <Show when={canViewExam()} fallback={<Alert variant="destructive">{t("common.accessDenied")}</Alert>}> |
| 394 | - <div class="mx-auto w-full max-w-[1100px] space-y-6"> | 394 | + <div class="mx-auto w-full max-w-[1100px] space-y-5"> |
| 395 | - <div class="sticky top-14 z-10 -mx-4 space-y-2 bg-surface-overlay px-4 pb-1 sm:-mx-6 sm:px-6 lg:-mx-8 lg:px-8"> | 395 | + <section class="data-shell space-y-2 p-4 sm:p-5"> |
| 396 | <Breadcrumbs items={[{ label: t("exams.title"), to: "/exams" }, { label: ex().title }]} /> | 396 | <Breadcrumbs items={[{ label: t("exams.title"), to: "/exams" }, { label: ex().title }]} /> |
| 397 | <PageHeader | 397 | <PageHeader |
| 398 | title={ex().title} | 398 | title={ex().title} |
| @@ -460,9 +460,9 @@ function ExamDetailContent() { | |||
| 460 | </Badge> | 460 | </Badge> |
| 461 | </div> | 461 | </div> |
| 462 | </PageHeader> | 462 | </PageHeader> |
| 463 | - </div> | 463 | + </section> |
| 464 | - <div class="grid gap-2 sm:grid-cols-2 xl:grid-cols-4"> | 464 | + <section class="data-shell grid gap-3 p-4 sm:grid-cols-2 sm:p-5 xl:grid-cols-4"> |
| 465 | - <div class="flex min-w-0 items-center gap-3 rounded-xl border border-border-line bg-surface-base p-3.5"> | 465 | + <div class="flex min-w-0 items-center gap-3 rounded-xl border border-border-hairline bg-surface-tint p-3.5"> |
| 466 | <span class="flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-surface-tint text-text-subtle"> | 466 | <span class="flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-surface-tint text-text-subtle"> |
| 467 | <IconExam class="h-4 w-4" /> | 467 | <IconExam class="h-4 w-4" /> |
| 468 | </span> | 468 | </span> |
| @@ -471,7 +471,7 @@ function ExamDetailContent() { | |||
| 471 | <p class="truncate text-sm font-semibold">{examModeLabel(ex().mode)}</p> | 471 | <p class="truncate text-sm font-semibold">{examModeLabel(ex().mode)}</p> |
| 472 | </div> | 472 | </div> |
| 473 | </div> | 473 | </div> |
| 474 | - <div class="flex min-w-0 items-center gap-3 rounded-xl border border-border-line bg-surface-base p-3.5"> | 474 | + <div class="flex min-w-0 items-center gap-3 rounded-xl border border-border-hairline bg-surface-tint p-3.5"> |
| 475 | <span class="flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-surface-tint text-text-subtle"> | 475 | <span class="flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-surface-tint text-text-subtle"> |
| 476 | <IconRefresh class="h-4 w-4" /> | 476 | <IconRefresh class="h-4 w-4" /> |
| 477 | </span> | 477 | </span> |
| @@ -487,7 +487,7 @@ function ExamDetailContent() { | |||
| 487 | </Show> | 487 | </Show> |
| 488 | </div> | 488 | </div> |
| 489 | </div> | 489 | </div> |
| 490 | - <div class="flex min-w-0 items-center gap-3 rounded-xl border border-border-line bg-surface-base p-3.5"> | 490 | + <div class="flex min-w-0 items-center gap-3 rounded-xl border border-border-hairline bg-surface-tint p-3.5"> |
| 491 | <span class="flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-surface-tint text-text-subtle"> | 491 | <span class="flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-surface-tint text-text-subtle"> |
| 492 | <IconCalendarDays class="h-4 w-4" /> | 492 | <IconCalendarDays class="h-4 w-4" /> |
| 493 | </span> | 493 | </span> |
| @@ -501,7 +501,7 @@ function ExamDetailContent() { | |||
| 501 | </Show> | 501 | </Show> |
| 502 | </div> | 502 | </div> |
| 503 | </div> | 503 | </div> |
| 504 | - <div class="flex min-w-0 items-center gap-3 rounded-xl border border-border-line bg-surface-base p-3.5"> | 504 | + <div class="flex min-w-0 items-center gap-3 rounded-xl border border-border-hairline bg-surface-tint p-3.5"> |
| 505 | <span class="flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-surface-tint text-text-subtle"> | 505 | <span class="flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-surface-tint text-text-subtle"> |
| 506 | <IconClock class="h-4 w-4" /> | 506 | <IconClock class="h-4 w-4" /> |
| 507 | </span> | 507 | </span> |
| @@ -512,7 +512,7 @@ function ExamDetailContent() { | |||
| 512 | </p> | 512 | </p> |
| 513 | </div> | 513 | </div> |
| 514 | </div> | 514 | </div> |
| 515 | - </div> | 515 | + </section> |
| 516 | 516 | ||
| 517 | <SidePanel | 517 | <SidePanel |
| 518 | open={answerSheetOpen()} | 518 | open={answerSheetOpen()} |
src/pages/homework-detail-page.tsxmodified+9 -9
| @@ -50,31 +50,31 @@ export default function HomeworkDetailPage() { | |||
| 50 | fallback={<Show when={homework.error} fallback={<PageSpinner />}><Alert variant="destructive">{formatApiError(homework.error, locale())}</Alert></Show>} | 50 | fallback={<Show when={homework.error} fallback={<PageSpinner />}><Alert variant="destructive">{formatApiError(homework.error, locale())}</Alert></Show>} |
| 51 | > | 51 | > |
| 52 | {(item) => ( | 52 | {(item) => ( |
| 53 | - <div class="space-y-6"> | 53 | + <div class="mx-auto w-full max-w-[1100px] space-y-5"> |
| 54 | - <div class="space-y-2"> | 54 | + <section class="data-shell space-y-2 p-4 sm:p-5"> |
| 55 | <Breadcrumbs items={[{ label: t("homework.title"), to: "/homework" }, { label: item().title }]} /> | 55 | <Breadcrumbs items={[{ label: t("homework.title"), to: "/homework" }, { label: item().title }]} /> |
| 56 | <PageHeader title={item().title} description={item().description || undefined} /> | 56 | <PageHeader title={item().title} description={item().description || undefined} /> |
| 57 | - </div> | 57 | + </section> |
| 58 | - <div class="grid gap-3 text-sm sm:grid-cols-2 lg:grid-cols-4"> | 58 | + <section class="data-shell grid gap-3 p-4 text-sm sm:grid-cols-2 sm:p-5 lg:grid-cols-4"> |
| 59 | - <div class="rounded-xl border border-border-line bg-surface-base px-4 py-4"> | 59 | + <div class="rounded-xl border border-border-hairline bg-surface-tint px-4 py-4"> |
| 60 | <p class="text-xs font-medium uppercase tracking-[0.08em] text-text-subtle">{t("nav.courses")}</p> | 60 | <p class="text-xs font-medium uppercase tracking-[0.08em] text-text-subtle">{t("nav.courses")}</p> |
| 61 | <p class="mt-1 font-medium text-text-default">{course()?.title ?? item().class_course}</p> | 61 | <p class="mt-1 font-medium text-text-default">{course()?.title ?? item().class_course}</p> |
| 62 | </div> | 62 | </div> |
| 63 | - <div class="rounded-xl border border-border-line bg-surface-base px-4 py-4"> | 63 | + <div class="rounded-xl border border-border-hairline bg-surface-tint px-4 py-4"> |
| 64 | <p class="text-xs font-medium uppercase tracking-[0.08em] text-text-subtle">{t("subjects.subject")}</p> | 64 | <p class="text-xs font-medium uppercase tracking-[0.08em] text-text-subtle">{t("subjects.subject")}</p> |
| 65 | <p class="mt-1 font-medium text-text-default">{subject()?.name ?? item().subject}</p> | 65 | <p class="mt-1 font-medium text-text-default">{subject()?.name ?? item().subject}</p> |
| 66 | </div> | 66 | </div> |
| 67 | - <div class="rounded-xl border border-border-line bg-surface-base px-4 py-4"> | 67 | + <div class="rounded-xl border border-border-hairline bg-surface-tint px-4 py-4"> |
| 68 | <p class="text-xs font-medium uppercase tracking-[0.08em] text-text-subtle">{t("homework.dueAt")}</p> | 68 | <p class="text-xs font-medium uppercase tracking-[0.08em] text-text-subtle">{t("homework.dueAt")}</p> |
| 69 | <p class="mt-1 font-medium text-text-default">{formatDateTime(item().due_at, locale())}</p> | 69 | <p class="mt-1 font-medium text-text-default">{formatDateTime(item().due_at, locale())}</p> |
| 70 | </div> | 70 | </div> |
| 71 | - <div class="rounded-xl border border-border-line bg-surface-base px-4 py-4"> | 71 | + <div class="rounded-xl border border-border-hairline bg-surface-tint px-4 py-4"> |
| 72 | <p class="text-xs font-medium uppercase tracking-[0.08em] text-text-subtle">{t("homework.assigned")}</p> | 72 | <p class="text-xs font-medium uppercase tracking-[0.08em] text-text-subtle">{t("homework.assigned")}</p> |
| 73 | <Badge variant="outline" class="mt-2 rounded-full"> | 73 | <Badge variant="outline" class="mt-2 rounded-full"> |
| 74 | {item().assigned?.length ? t("common.countItem", { count: item().assigned!.length, item: t("courses.rosterItem") }) : t("homework.wholeCourse")} | 74 | {item().assigned?.length ? t("common.countItem", { count: item().assigned!.length, item: t("courses.rosterItem") }) : t("homework.wholeCourse")} |
| 75 | </Badge> | 75 | </Badge> |
| 76 | </div> | 76 | </div> |
| 77 | - </div> | 77 | + </section> |
| 78 | <Show when={auth.user()?.role === "student"}> | 78 | <Show when={auth.user()?.role === "student"}> |
| 79 | <HomeworkSubmissionPanel homeworkId={id()} /> | 79 | <HomeworkSubmissionPanel homeworkId={id()} /> |
| 80 | </Show> | 80 | </Show> |
src/pages/question-bank-page.tsxmodified+21 -1
| @@ -15,6 +15,7 @@ import { ComingSoonBadge } from "@/components/ui/coming-soon"; | |||
| 15 | import { ConfirmDialog } from "@/components/ui/confirm-dialog"; | 15 | import { ConfirmDialog } from "@/components/ui/confirm-dialog"; |
| 16 | import { DataTable, DataTableSkeleton } from "@/components/ui/data-table"; | 16 | import { DataTable, DataTableSkeleton } from "@/components/ui/data-table"; |
| 17 | import { IconEdit, IconEye, IconEyeOff, IconPlus, IconTrash, IconUsers } from "@/components/ui/icons"; | 17 | import { IconEdit, IconEye, IconEyeOff, IconPlus, IconTrash, IconUsers } from "@/components/ui/icons"; |
| 18 | +import { PixelIcon } from "@/components/ui/pixel-icon"; | ||
| 18 | import { DropdownSelect } from "@/components/ui/select"; | 19 | import { DropdownSelect } from "@/components/ui/select"; |
| 19 | import { SidePanel } from "@/components/ui/side-panel"; | 20 | import { SidePanel } from "@/components/ui/side-panel"; |
| 20 | import { TableRowActions } from "@/components/ui/table-row-actions"; | 21 | import { TableRowActions } from "@/components/ui/table-row-actions"; |
| @@ -206,6 +207,25 @@ function QuestionBankContent() { | |||
| 206 | <Alert variant="destructive">{error()}</Alert> | 207 | <Alert variant="destructive">{error()}</Alert> |
| 207 | </Show> | 208 | </Show> |
| 208 | 209 | ||
| 210 | + <section class="data-shell relative overflow-hidden p-4 sm:p-5"> | ||
| 211 | + <div class="pointer-events-none absolute -right-3 -top-5 flex rotate-6 items-center gap-3 text-primary/15" aria-hidden="true"> | ||
| 212 | + <PixelIcon name="book-open" class="h-16 w-16" /> | ||
| 213 | + <PixelIcon name="sparkles" class="h-10 w-10" /> | ||
| 214 | + </div> | ||
| 215 | + <div class="relative flex items-start gap-3"> | ||
| 216 | + <span class="flex h-10 w-10 shrink-0 items-center justify-center rounded-xl border border-primary/20 bg-primary/10 text-primary-text"> | ||
| 217 | + <PixelIcon name="users" class="h-5 w-5" /> | ||
| 218 | + </span> | ||
| 219 | + <div class="min-w-0"> | ||
| 220 | + <div class="flex flex-wrap items-center gap-2"> | ||
| 221 | + <h1 class="text-lg font-semibold tracking-tight">{t("bank.title")}</h1> | ||
| 222 | + <PixelIcon name="sparkles" class="h-4 w-4 text-amber-500" /> | ||
| 223 | + </div> | ||
| 224 | + <p class="mt-1 max-w-2xl text-sm text-muted-foreground">{t("bank.subtitle")}</p> | ||
| 225 | + </div> | ||
| 226 | + </div> | ||
| 227 | + </section> | ||
| 228 | + | ||
| 209 | <Tabs | 229 | <Tabs |
| 210 | value={bankTab()} | 230 | value={bankTab()} |
| 211 | onChange={(value) => { | 231 | onChange={(value) => { |
| @@ -230,7 +250,7 @@ function QuestionBankContent() { | |||
| 230 | description={`${t("bank.subtitle")} ${t("bank.countTotal", { total: total() })}`} | 250 | description={`${t("bank.subtitle")} ${t("bank.countTotal", { total: total() })}`} |
| 231 | actions={ | 251 | actions={ |
| 232 | <Show when={manageableCourses().length > 0}> | 252 | <Show when={manageableCourses().length > 0}> |
| 233 | - <Button type="button" size="sm" class="min-w-[7.5rem] rounded-lg" onClick={() => setCreateOpen(true)}> | 253 | + <Button type="button" size="sm" class="rounded-lg" onClick={() => setCreateOpen(true)}> |
| 234 | <IconPlus class="h-4 w-4" /> | 254 | <IconPlus class="h-4 w-4" /> |
| 235 | {t("bank.create")} | 255 | {t("bank.create")} |
| 236 | </Button> | 256 | </Button> |