e77588deb8
- Settings key-value table in Prisma with migration - getSettings() / getSetting() helpers in lib/settings.ts - Admin UI at /admin/settings with 6 sections: General, Notifications, Student profile, Legal docs, Curator permissions, Code injection - saveSettings() server action with admin-only guard - Maintenance mode: non-admin users redirected to /maintenance page - schoolName propagated to page metadata and all email templates - headCode / bodyCode injected into root layout <head> and <body> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
import type { Metadata } from "next";
|
|
import { Fira_Mono } from "next/font/google";
|
|
import "./globals.css";
|
|
import { getSettings } from "@/lib/settings";
|
|
|
|
const firaMono = Fira_Mono({
|
|
weight: ["400", "500", "700"],
|
|
subsets: ["latin", "cyrillic"],
|
|
variable: "--font-fira",
|
|
display: "swap",
|
|
});
|
|
|
|
export async function generateMetadata(): Promise<Metadata> {
|
|
const settings = await getSettings();
|
|
return {
|
|
title: `${settings.schoolName} — Обучение`,
|
|
description: settings.schoolDescription || "Образовательная платформа",
|
|
keywords: settings.schoolKeywords || undefined,
|
|
};
|
|
}
|
|
|
|
export default async function RootLayout({
|
|
children,
|
|
}: Readonly<{
|
|
children: React.ReactNode;
|
|
}>) {
|
|
const settings = await getSettings();
|
|
|
|
return (
|
|
<html lang="ru" className={`${firaMono.variable} h-full antialiased`}>
|
|
{settings.headCode ? (
|
|
<head dangerouslySetInnerHTML={{ __html: settings.headCode }} />
|
|
) : null}
|
|
<body className="min-h-full flex flex-col">
|
|
{children}
|
|
{settings.bodyCode ? (
|
|
<div dangerouslySetInnerHTML={{ __html: settings.bodyCode }} />
|
|
) : null}
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|