课程管理新增单词与数学思维内容编辑:单词词库落库(word_entry+0007迁移,表空回退words.json),家长端按天增删改单词;数学思维编辑器对标语法编辑器;课程管理加入两张入口卡片
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
ab84bec1b4
commit
5f207e4a57
@@ -0,0 +1,55 @@
|
||||
import Link from "next/link";
|
||||
import { Pencil } from "lucide-react";
|
||||
import { redirect } from "next/navigation";
|
||||
import { BackgroundBlobs } from "@/components/background-blobs";
|
||||
import { getSessionUser } from "@/lib/auth";
|
||||
import { listMathPoints, MODULES } from "@/lib/math";
|
||||
|
||||
// xuchao: 数学思维课程编辑列表——按七大模块分组,点击进入单课编辑
|
||||
export default async function MathAdmin() {
|
||||
const parent = await getSessionUser();
|
||||
if (!parent) redirect("/login");
|
||||
if (parent.role !== "parent") redirect("/kid");
|
||||
|
||||
const points = await listMathPoints();
|
||||
|
||||
return (
|
||||
<main className="relative mx-auto max-w-2xl space-y-5 p-4 pb-10">
|
||||
<BackgroundBlobs />
|
||||
<header className="flex items-center justify-between">
|
||||
<Link href="/parent" className="text-sm font-medium text-indigo-600">
|
||||
← 返回家长中心
|
||||
</Link>
|
||||
<h1 className="text-xl font-extrabold text-slate-900">数学思维课程编辑</h1>
|
||||
</header>
|
||||
<p className="rounded-lg border-l-4 border-indigo-400 bg-indigo-50 px-3 py-2 text-sm text-indigo-800">
|
||||
点击任意课程即可修改标题、目标与课文内容,保存后孩子端立即生效。
|
||||
</p>
|
||||
|
||||
{MODULES.map((mod) => {
|
||||
const group = points.filter((p) => p.module === mod.id);
|
||||
if (group.length === 0) return null;
|
||||
return (
|
||||
<section key={mod.id} className="rounded-xl border border-slate-100 bg-white p-4 shadow-soft">
|
||||
<h2 className="mb-3 text-lg font-extrabold text-slate-900">
|
||||
{mod.name}
|
||||
<span className="ml-1 text-amber-500">{"★".repeat(mod.stars)}</span>
|
||||
</h2>
|
||||
<div className="grid grid-cols-1 gap-2 sm:grid-cols-2">
|
||||
{group.map((p) => (
|
||||
<Link
|
||||
key={p.pointId}
|
||||
href={`/parent/math/${p.pointId}`}
|
||||
className="flex items-center gap-2 rounded-lg border border-slate-200 bg-white px-3 py-2 text-sm text-slate-700 transition-all duration-200 hover:-translate-y-0.5 hover:border-indigo-300"
|
||||
>
|
||||
<Pencil className="size-3.5 shrink-0 text-indigo-400" />
|
||||
<span className="truncate">{p.title}</span>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
})}
|
||||
</main>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user