Reapply "Add missing admin action files and navigation links"
This reverts commit 4d515bc400.
This commit is contained in:
1 parent
96ed768f14
commit
5b4228261a
338 files changed
+28143
-5948
No files matched your search
@@ -8,11 +8,7 @@ import { postThread } from "@/actions/social";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function NewThreadPage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ id: string }>;
|
||||
}) {
|
||||
export default async function NewThreadPage({ params }: { params: Promise<{ id: string }> }) {
|
||||
const t = await getTranslations("pages.guildForumNew");
|
||||
const { id } = await params;
|
||||
const guildId = Number(id);
|
||||
|
||||
@@ -22,11 +22,7 @@ function formatTimestamp(ts: number | null | undefined): string {
|
||||
return new Date(ts * 1000).toISOString().slice(0, 10);
|
||||
}
|
||||
|
||||
export default async function GuildForumPage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ id: string }>;
|
||||
}) {
|
||||
export default async function GuildForumPage({ params }: { params: Promise<{ id: string }> }) {
|
||||
const t = await getTranslations("pages.guildForum");
|
||||
const { id } = await params;
|
||||
const guildId = Number(id);
|
||||
@@ -69,13 +65,7 @@ export default async function GuildForumPage({
|
||||
|
||||
// Resolve opener usernames in one query (no relation exists in the schema, so
|
||||
// join the users table manually by id). Falls back to the raw author id.
|
||||
const openerIds = Array.from(
|
||||
new Set(
|
||||
threads
|
||||
.map((t) => t.openerId ?? 0)
|
||||
.filter((v) => v > 0),
|
||||
),
|
||||
);
|
||||
const openerIds = Array.from(new Set(threads.map((t) => t.openerId ?? 0).filter((v) => v > 0)));
|
||||
|
||||
let users: { id: number; username: string }[] = [];
|
||||
try {
|
||||
@@ -128,9 +118,7 @@ export default async function GuildForumPage({
|
||||
return (
|
||||
<tr key={t2.id}>
|
||||
<td style={{ padding: "0.6rem 0.75rem" }}>
|
||||
<span style={{ fontWeight: 700 }}>
|
||||
{t2.subject?.trim() || t("noSubject")}
|
||||
</span>
|
||||
<span style={{ fontWeight: 700 }}>{t2.subject?.trim() || t("noSubject")}</span>
|
||||
{t2.pinned ? (
|
||||
<span className="online-badge online" style={{ marginLeft: "0.5rem" }}>
|
||||
📌 {t("pinned")}
|
||||
@@ -151,9 +139,7 @@ export default async function GuildForumPage({
|
||||
</span>
|
||||
)}
|
||||
</td>
|
||||
<td style={{ padding: "0.6rem 0.75rem" }}>
|
||||
{t2.postsCount ?? 0}
|
||||
</td>
|
||||
<td style={{ padding: "0.6rem 0.75rem" }}>{t2.postsCount ?? 0}</td>
|
||||
<td className="muted" style={{ padding: "0.6rem 0.75rem" }}>
|
||||
{formatTimestamp(t2.createdAt)}
|
||||
</td>
|
||||
|
||||
@@ -31,11 +31,7 @@ function formatTimestamp(ts: number): string {
|
||||
return new Date(ts * 1000).toISOString().slice(0, 10);
|
||||
}
|
||||
|
||||
export default async function GuildPage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ id: string }>;
|
||||
}) {
|
||||
export default async function GuildPage({ params }: { params: Promise<{ id: string }> }) {
|
||||
const t = await getTranslations("pages.guild");
|
||||
const { id } = await params;
|
||||
const guildId = Number(id);
|
||||
@@ -197,10 +193,7 @@ export default async function GuildPage({
|
||||
<Link href={`/u/${m.username}`}>{m.username}</Link>
|
||||
</h3>
|
||||
{m.isOwner ? (
|
||||
<span
|
||||
className="online-badge online"
|
||||
style={{ marginBottom: "0.25rem" }}
|
||||
>
|
||||
<span className="online-badge online" style={{ marginBottom: "0.25rem" }}>
|
||||
👑 {t("owner")}
|
||||
</span>
|
||||
) : null}
|
||||
|
||||
@@ -34,11 +34,7 @@ export default async function GuildsPage() {
|
||||
|
||||
return (
|
||||
<main style={{ display: "grid", gap: "1.5rem" }}>
|
||||
<ContentCard
|
||||
icon="🚪"
|
||||
title={t("title")}
|
||||
subtitle={t("subtitle")}
|
||||
/>
|
||||
<ContentCard icon="🚪" title={t("title")} subtitle={t("subtitle")} />
|
||||
|
||||
<ContentCard padded={guilds.length === 0}>
|
||||
{guilds.length === 0 ? (
|
||||
@@ -69,9 +65,7 @@ export default async function GuildsPage() {
|
||||
/>
|
||||
) : null}
|
||||
<div style={{ minWidth: 0 }}>
|
||||
<h3 style={{ margin: "0 0 0.25rem", fontSize: "1rem" }}>
|
||||
{g.name || t("unnamedGuild")}
|
||||
</h3>
|
||||
<h3 style={{ margin: "0 0 0.25rem", fontSize: "1rem" }}>{g.name || t("unnamedGuild")}</h3>
|
||||
<p className="muted" style={{ margin: 0 }}>
|
||||
{g.description ? excerpt(g.description, 120) : t("noDescription")}
|
||||
</p>
|
||||
|
||||
Reference in new issue
Block a user