Add admin Articles (CRUD) + Bans resources
- Articles: list / new / edit / delete (websiteArticles), unique-slug generation via slugify() (pure, unit-tested); staff-gated server actions. - Bans: list active bans (ban_expire > now), create ban (writes the bans row + RCON disconnect) with type/duration/reason, lift ban; staff-gated actions. - Admin nav extended (Articles, Bans). Verified: tsc exit 0, vitest 48/48, next build exit 0 (7 /admin routes).
This commit is contained in:
1 parent
9f81096f05
commit
5861d9f1f5
9 files changed
+310
-1
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import Link from "next/link";
|
||||
import { createArticle } from "@/actions/admin-articles";
|
||||
|
||||
export default function NewArticle() {
|
||||
return (
|
||||
<main>
|
||||
<p className="muted">
|
||||
<Link href="/admin/articles">← Articles</Link>
|
||||
</p>
|
||||
<h1>New article</h1>
|
||||
<form action={createArticle} className="card" style={{ display: "grid", gap: "0.6rem" }}>
|
||||
<input name="title" placeholder="Title" required />
|
||||
<input name="image" placeholder="Image URL" />
|
||||
<textarea name="shortStory" placeholder="Short story (summary)" rows={2} />
|
||||
<textarea name="fullStory" placeholder="Full story" rows={10} />
|
||||
<button type="submit">Create</button>
|
||||
</form>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user