Implement platform settings (Stage 9)

- Wire settings to actual platform behavior: maintenance mode, registration toggle,
  notification emails, curator feedback emails, email verification flag
- Add logo (logoUrl, showLogo) and social network links (YouTube, VK, Telegram) settings
- Show logo + school name dynamically in student layout header
- Add footer to student layout with org requisites and social links
- Register page: read settings server-side, validate terms checkbox with legal links
- Login page: show notice when redirected from closed registration
- Settings form: add Logo and Social Networks sections

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-27 15:31:10 +05:00
parent ba0a630fd9
commit c64f393a7b
8 changed files with 223 additions and 24 deletions
@@ -5,6 +5,7 @@ import { auth } from "@/lib/auth";
import { headers } from "next/headers";
import { revalidatePath } from "next/cache";
import { sendFeedbackReceivedEmail } from "@/lib/email";
import { getSetting, asBool } from "@/lib/settings";
async function requireCurator() {
const session = await auth.api.getSession({ headers: await headers() });
@@ -78,14 +79,17 @@ export async function submitFeedback(
});
const { lesson } = submission.homework;
const lessonUrl = `${process.env.BETTER_AUTH_URL ?? "https://school.second-brain.ru"}/courses/${lesson.module.course.slug}/lessons/${lesson.id}`;
await sendFeedbackReceivedEmail(
submission.user.email,
submission.user.name,
lesson.title,
data.text,
lessonUrl
);
const notifySetting = await getSetting("notifyStudentOnFeedback");
if (asBool(notifySetting)) {
const lessonUrl = `${process.env.BETTER_AUTH_URL ?? "https://school.second-brain.ru"}/courses/${lesson.module.course.slug}/lessons/${lesson.id}`;
await sendFeedbackReceivedEmail(
submission.user.email,
submission.user.name,
lesson.title,
data.text,
lessonUrl
);
}
revalidatePath("/curator/homework");
revalidatePath(`/curator/homework/${submissionId}`);