Ship site UI checklist, move admin to /mstcontroller, and add safe taxonomy label migration.
Deploy edu.mstaut.ir / deploy (push) Has been cancelled

Production already has migrations through 008; 009 only updates four seed labels by id. Faculty sync remains upsert-by-email/name and does not wipe curated data.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
smhk1376andCursor committed 2026-10-16 16:26:21 +03:30
1 parent 3eea1c35a6
commit 2b0db26a93
171 files changed
+1477 -807

No files matched your search

+7 -1
View File
@@ -7,6 +7,7 @@ import { FormCard } from "@/components/molecules/FormCard";
import { PageHero } from "@/components/molecules/PageHero";
import { ContactInterestForm } from "@/components/organisms/ContactInterestForm";
import { getLegalPage } from "@/lib/data/site";
import { pageMetadata, truncateMetaDescription } from "@/lib/seo/metadata";
type Props = { params: Promise<{ slug: string }> };
@@ -20,7 +21,12 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
const { slug } = await params;
const page = await getLegalPage(slug);
if (!page) return { title: "صفحه یافت نشد" };
return { title: page.title, description: page.body[0] };
const description = page.body[0] ?? page.title;
return pageMetadata({
title: page.title,
description: truncateMetaDescription(description),
path: `/${slug}`,
});
}
export default async function LegalSlugPage({ params }: Props) {
+5 -3
View File
@@ -2,14 +2,16 @@ import type { Metadata } from "next";
import { getTranslations } from "next-intl/server";
import { AboutTemplate } from "@/components/templates/AboutTemplate";
import { getTopics } from "@/lib/data/site";
import { pageMetadata } from "@/lib/seo/metadata";
import { aboutContent } from "@/lib/site-config";
export async function generateMetadata(): Promise<Metadata> {
const t = await getTranslations("pages");
return {
return pageMetadata({
title: t("aboutTitle"),
description: aboutContent.intro,
};
description: aboutContent.seoDescription,
path: "/about",
});
}
export default async function AboutPage() {
+11 -2
View File
@@ -8,10 +8,15 @@ import { BadgeLabel } from "@/components/atoms/BadgeLabel";
import { PageHero } from "@/components/molecules/PageHero";
import { SurfaceCard } from "@/components/molecules/SurfaceCard";
import { getAlumniStories } from "@/lib/data/site";
import { pageMetadata } from "@/lib/seo/metadata";
export async function generateMetadata(): Promise<Metadata> {
const t = await getTranslations("pages");
return { title: t("alumniTitle"), description: t("alumniIntro") };
return pageMetadata({
title: t("alumniTitle"),
description: t("alumniIntro"),
path: "/alumni",
});
}
export default async function AlumniPage() {
@@ -20,7 +25,11 @@ export default async function AlumniPage() {
return (
<main id="main-content">
<PageHero title={t("alumniTitle")} intro={t("alumniIntro")} />
<PageHero
title={t("alumniTitle")}
intro={t("alumniIntro")}
imageUrl="/brand/graduation-cap-neural.png"
/>
<Section tone="subtle">
<Container>
<div className="grid gap-5 md:grid-cols-3">
+6 -1
View File
@@ -6,10 +6,15 @@ import { PageHero } from "@/components/molecules/PageHero";
import { ContactDetails } from "@/components/molecules/ContactDetails";
import { FormCard } from "@/components/molecules/FormCard";
import { ContactInterestForm } from "@/components/organisms/ContactInterestForm";
import { pageMetadata } from "@/lib/seo/metadata";
export async function generateMetadata(): Promise<Metadata> {
const t = await getTranslations("pages");
return { title: t("contactTitle"), description: t("contactIntro") };
return pageMetadata({
title: t("contactTitle"),
description: t("contactIntro"),
path: "/contact",
});
}
export default async function ContactPage() {
+23 -1
View File
@@ -9,6 +9,12 @@ import { DetailList } from "@/components/molecules/DetailList";
import { PageHero } from "@/components/molecules/PageHero";
import { SurfaceCard } from "@/components/molecules/SurfaceCard";
import { getEventById } from "@/lib/data/events";
import { JsonLd } from "@/lib/seo/json-ld";
import {
absoluteUrl,
pageMetadata,
truncateMetaDescription,
} from "@/lib/seo/metadata";
type Props = { params: Promise<{ id: string }> };
@@ -22,7 +28,11 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
const { id } = await params;
const event = await getEventById(id);
if (!event) return { title: "رویداد یافت نشد" };
return { title: event.title, description: event.summary };
return pageMetadata({
title: event.title,
description: truncateMetaDescription(event.summary),
path: `/events/${id}`,
});
}
export default async function EventDetailPage({ params }: Props) {
@@ -37,6 +47,18 @@ export default async function EventDetailPage({ params }: Props) {
return (
<main id="main-content">
<JsonLd
data={{
"@context": "https://schema.org",
"@type": "Event",
name: event.title,
description: event.summary,
startDate: event.startDate,
...(event.endDate ? { endDate: event.endDate } : {}),
location: { "@type": "Place", name: event.location },
url: absoluteUrl(`/events/${id}`),
}}
/>
<PageHero title={event.title} intro={event.summary} />
<Section tone="subtle">
<Container narrow className="space-y-6">
+6 -1
View File
@@ -5,10 +5,15 @@ import { Section } from "@/components/atoms/Section";
import { EventCard } from "@/components/molecules/Cards";
import { PageHero } from "@/components/molecules/PageHero";
import { getEvents } from "@/lib/data/events";
import { pageMetadata } from "@/lib/seo/metadata";
export async function generateMetadata(): Promise<Metadata> {
const t = await getTranslations("pages");
return { title: t("eventsTitle"), description: t("eventsIntro") };
return pageMetadata({
title: t("eventsTitle"),
description: t("eventsIntro"),
path: "/events",
});
}
export default async function EventsPage() {
+2 -2
View File
@@ -1,6 +1,6 @@
import { redirect } from "next/navigation";
import { facultyNetworkUrl } from "@/lib/site-config";
/** Faculty are not introduced on this site; send visitors home. */
export default function FacultyPage() {
redirect(facultyNetworkUrl);
redirect("/");
}
+12 -1
View File
@@ -7,6 +7,11 @@ import { TextLink } from "@/components/atoms/TextLink";
import { PageHero } from "@/components/molecules/PageHero";
import { getArticleById } from "@/lib/data/articles";
import { JsonLd } from "@/lib/seo/json-ld";
import {
absoluteUrl,
pageMetadata,
truncateMetaDescription,
} from "@/lib/seo/metadata";
type Props = { params: Promise<{ id: string }> };
@@ -14,7 +19,12 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
const { id } = await params;
const article = await getArticleById(id);
if (!article) return { title: "مقاله یافت نشد" };
return { title: article.title, description: article.excerpt };
return pageMetadata({
title: article.title,
description: truncateMetaDescription(article.excerpt),
path: `/insights/${id}`,
image: article.imageUrl,
});
}
export default async function InsightDetailPage({ params }: Props) {
@@ -35,6 +45,7 @@ export default async function InsightDetailPage({ params }: Props) {
datePublished: article.publishedAt,
author: { "@type": "Person", name: article.author },
image: article.imageUrl,
url: absoluteUrl(`/insights/${id}`),
}}
/>
<PageHero
+11 -2
View File
@@ -5,10 +5,15 @@ import { Section } from "@/components/atoms/Section";
import { ArticleCard } from "@/components/molecules/Cards";
import { PageHero } from "@/components/molecules/PageHero";
import { getArticles } from "@/lib/data/articles";
import { pageMetadata } from "@/lib/seo/metadata";
export async function generateMetadata(): Promise<Metadata> {
const t = await getTranslations("pages");
return { title: t("insightsTitle"), description: t("insightsIntro") };
return pageMetadata({
title: t("insightsTitle"),
description: t("insightsIntro"),
path: "/insights",
});
}
export default async function InsightsPage() {
@@ -17,7 +22,11 @@ export default async function InsightsPage() {
return (
<main id="main-content">
<PageHero title={t("insightsTitle")} intro={t("insightsIntro")} />
<PageHero
title={t("insightsTitle")}
intro={t("insightsIntro")}
imageUrl="/brand/neural-open-book.png"
/>
<Section tone="subtle">
<Container>
<div className="mx-auto max-w-5xl">
+1 -6
View File
@@ -7,11 +7,7 @@ import { getCourses } from "@/lib/data/courses";
import { listPublishedCourseTags } from "@/lib/data/taxonomy";
import { getPrograms } from "@/lib/data/programs";
import { getCampaignBanners } from "@/lib/data/site";
import {
facultyNetworkUrl,
facultySiteUrl,
siteShortName,
} from "@/lib/site-config";
import { facultySiteUrl, siteShortName } from "@/lib/site-config";
// Public CMS pages must read Postgres at request time — static bake at Docker
// build often has no DATABASE_URL and ships empty lists.
@@ -60,7 +56,6 @@ export default async function MainLayout({
linksTitle={t("footer.links")}
links={[
{ label: t("footer.facultySite"), href: facultySiteUrl },
{ label: t("footer.facultyNetwork"), href: facultyNetworkUrl },
{ label: t("footer.press"), href: "/press" },
{ label: t("footer.careers"), href: "/careers" },
]}
+3 -3
View File
@@ -8,12 +8,12 @@ export default function NotFound() {
return (
<main id="main-content" className="bg-background">
<Container className="flex min-h-[60vh] flex-col items-start justify-center py-20">
<p className="text-sm font-bold text-primary sm:text-base">۴۰۴</p>
<p className="text-sm font-bold text-accent sm:text-base">۴۰۴</p>
<Heading as="h1" level={2} className="mt-3">
صفحه مورد نظر یافت نشد
</Heading>
<p className="mt-4 max-w-md text-base leading-8 text-muted-foreground">
ممکن است این صفحه جابه‌جا یا حذف شده باشد.
ممکن است این صفحه جابه جا یا حذف شده باشد.
</p>
<div className="mt-8 flex flex-wrap gap-3">
<Link href="/" className={cn(buttonVariants({ size: "lg" }), "font-bold")}>
@@ -23,7 +23,7 @@ export default function NotFound() {
href="/professional"
className={buttonVariants({ variant: "outline", size: "lg" })}
>
مشاهده دوره‌ها
مشاهده دوره ها
</Link>
</div>
</Container>
+19 -32
View File
@@ -1,36 +1,33 @@
import type { Metadata } from "next";
import { getTranslations } from "next-intl/server";
import { pageMetadata } from "@/lib/seo/metadata";
import {
HomeApproach,
HomeClosing,
HomeCourseSearch,
HomeEventsTeaser,
HomeHero,
HomeIdeas,
HomeRest,
HomeTeams,
type HomeLabels,
} from "@/components/templates/HomeTemplate";
import { getFeaturedArticle } from "@/lib/data/articles";
import { getLatestCourses } from "@/lib/data/courses";
import { getSiteStats, getTopics } from "@/lib/data/site";
export async function generateMetadata(): Promise<Metadata> {
const t = await getTranslations("meta");
return pageMetadata({
title: t("homeTitle"),
description: t("homeDescription"),
path: "/",
absoluteTitle: true,
});
}
async function getLabels(): Promise<HomeLabels> {
const t = await getTranslations();
return {
executiveLabel: t("home.executiveLabel"),
exploreOurPrograms: t("home.exploreOurPrograms"),
ideasTitle: t("home.ideasTitle"),
eventsTitle: t("home.eventsTitle"),
seeAllEvents: t("nav.seeAllEvents"),
intersectionsTitle: t("home.intersectionsTitle"),
intersectionsSubtitle: t("home.intersectionsSubtitle"),
moreThanDegree: t("home.moreThanDegree"),
moreThanDegreeBody: t("home.moreThanDegreeBody"),
keepExploring: t("home.keepExploring"),
hireTitle: t("home.hireTitle"),
hireBody: t("home.hireBody"),
registerCta: t("nav.registerCta"),
missionTitle: t("home.missionTitle"),
findUsTitle: t("home.findUsTitle"),
ideasEyebrow: t("home.ideasEyebrow"),
linksTitle: t("footer.links"),
exploreCourses: t("nav.exploreCourses"),
};
}
@@ -59,8 +56,7 @@ async function HeroSection() {
async function CourseSearchSection() {
const data = await orFallback(
"latest courses",
() =>
Promise.all([getLatestCourses(6), getLabels()]),
() => Promise.all([getLatestCourses(6), getLabels()]),
null,
);
if (!data) return null;
@@ -73,17 +69,6 @@ async function CourseSearchSection() {
);
}
async function RestSection() {
const [intersections, stats, labels] = await Promise.all([
orFallback("topics", getTopics, []),
orFallback("site stats", getSiteStats, []),
getLabels(),
]);
return (
<HomeRest labels={labels} intersections={intersections} stats={stats} />
);
}
export default function HomePage() {
return (
<main id="main-content">
@@ -91,7 +76,9 @@ export default function HomePage() {
<HomeIdeas />
<CourseSearchSection />
<HomeApproach />
<RestSection />
<HomeEventsTeaser />
<HomeTeams />
<HomeClosing />
</main>
);
}
+7 -5
View File
@@ -15,6 +15,7 @@ import { buttonVariants } from "@/components/ui/button";
import { cn } from "@/lib/utils";
import { getCourses } from "@/lib/data/courses";
import { getProgramBySlug } from "@/lib/data/programs";
import { pageMetadata, truncateMetaDescription } from "@/lib/seo/metadata";
type Props = { params: Promise<{ slug: string }> };
@@ -22,10 +23,11 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
const { slug } = await params;
const program = await getProgramBySlug(slug);
if (!program) return { title: "برنامه یافت نشد" };
return {
return pageMetadata({
title: program.title,
description: program.blurb,
};
description: truncateMetaDescription(program.blurb),
path: `/programs/${slug}`,
});
}
export default async function ProgramDetailPage({ params }: Props) {
@@ -72,7 +74,7 @@ export default async function ProgramDetailPage({ params }: Props) {
href="/professional"
className={cn(buttonVariants({ size: "lg" }), "mt-6 w-full font-bold")}
>
مشاهده دوره‌ها
مشاهده دوره ها
</Link>
</SurfaceCard>
<TextLink href="/programs" className="block px-1 text-sm">
@@ -93,7 +95,7 @@ export default async function ProgramDetailPage({ params }: Props) {
<Heading
as="h3"
level={4}
className="transition-colors group-hover:text-primary"
className="transition-colors group-hover:text-accent"
>
{course.title}
</Heading>
+10 -4
View File
@@ -12,13 +12,15 @@ import { SurfaceCard } from "@/components/molecules/SurfaceCard";
import { buttonVariants } from "@/components/ui/button";
import { cn } from "@/lib/utils";
import { getPrograms } from "@/lib/data/programs";
import { pageMetadata } from "@/lib/seo/metadata";
export async function generateMetadata(): Promise<Metadata> {
const t = await getTranslations("pages");
return {
return pageMetadata({
title: t("programsTitle"),
description: t("programsIntro"),
};
path: "/programs",
});
}
export default async function ProgramsPage() {
@@ -29,7 +31,11 @@ export default async function ProgramsPage() {
return (
<main id="main-content">
<PageHero title={t("programsTitle")} intro={t("programsIntro")} />
<PageHero
title={t("programsTitle")}
intro={t("programsIntro")}
imageUrl="/brand/neural-tree-knowledge.png"
/>
<Section tone="subtle">
<Container className="space-y-16">
<ProgramGroup title={t("standardGroup")} items={standard} />
@@ -58,7 +64,7 @@ function ProgramGroup({
<BadgeLabel className="w-fit">{program.tagline}</BadgeLabel>
) : null}
<Heading as="h3" level={3} className="mt-3">
<Link href={program.href} className="transition-colors hover:text-primary">
<Link href={program.href} className="transition-colors hover:text-accent">
{program.title}
</Link>
</Heading>
+9 -3
View File
@@ -3,6 +3,7 @@ import { notFound } from "next/navigation";
import { getTranslations } from "next-intl/server";
import { CourseDetailTemplate } from "@/components/templates/CourseDetailTemplate";
import { getCourseById } from "@/lib/data/courses";
import { pageMetadata, truncateMetaDescription } from "@/lib/seo/metadata";
type Props = { params: Promise<{ slug: string }> };
@@ -10,10 +11,15 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
const { slug } = await params;
const course = await getCourseById(slug);
if (!course) return { title: "دوره یافت نشد" };
return {
const pathSlug = course.slug || slug;
return pageMetadata({
title: course.title,
description: course.seoDescription || course.summary,
};
description: truncateMetaDescription(
course.seoDescription || course.summary,
),
path: `/register/${pathSlug}`,
...(course.posterImageUrl ? { image: course.posterImageUrl } : {}),
});
}
export default async function CourseRegisterPage({ params }: Props) {
+9 -3
View File
@@ -10,6 +10,7 @@ import { SurfaceCard } from "@/components/molecules/SurfaceCard";
import { buttonVariants } from "@/components/ui/button";
import { cn } from "@/lib/utils";
import { getTopicBySlug } from "@/lib/data/site";
import { pageMetadata, truncateMetaDescription } from "@/lib/seo/metadata";
type Props = { params: Promise<{ slug: string }> };
@@ -17,7 +18,12 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
const { slug } = await params;
const topic = await getTopicBySlug(slug);
if (!topic) return { title: "موضوع یافت نشد" };
return { title: topic.title, description: topic.description };
return pageMetadata({
title: topic.title,
description: truncateMetaDescription(topic.description),
path: `/topics/${slug}`,
image: topic.imageUrl,
});
}
export default async function TopicPage({ params }: Props) {
@@ -43,13 +49,13 @@ export default async function TopicPage({ params }: Props) {
<aside className="min-w-0 space-y-4 lg:sticky lg:top-28">
<SurfaceCard padded as="div">
<p className="text-sm leading-7 text-muted-foreground">
دوره‌های مرتبط با این موضوع را در فهرست دوره‌های کوتاه ببینید.
دوره های مرتبط با این موضوع را در فهرست دوره های کوتاه ببینید.
</p>
<Link
href="/professional"
className={cn(buttonVariants({ size: "lg" }), "mt-5 w-full font-bold")}
>
مشاهده دوره‌ها
مشاهده دوره ها
</Link>
</SurfaceCard>
<TextLink href="/" className="block px-1 text-sm">
+10 -4
View File
@@ -8,13 +8,18 @@ import { Section } from "@/components/atoms/Section";
import { PageHero } from "@/components/molecules/PageHero";
import { SectionHeader } from "@/components/molecules/SectionHeader";
import { SurfaceCard } from "@/components/molecules/SurfaceCard";
import { pageMetadata } from "@/lib/seo/metadata";
import { valuesContent } from "@/lib/site-config";
const FA_INDEX = ["۱", "۲", "۳", "۴", "۵", "۶"] as const;
export async function generateMetadata(): Promise<Metadata> {
const t = await getTranslations("pages");
return { title: t("valuesTitle"), description: valuesContent.intro };
return pageMetadata({
title: t("valuesTitle"),
description: valuesContent.seoDescription,
path: "/values",
});
}
export default async function ValuesPage() {
@@ -24,6 +29,7 @@ export default async function ValuesPage() {
eyebrow={valuesContent.eyebrow}
title={valuesContent.title}
intro={valuesContent.intro}
imageUrl="/brand/collective-intelligence.png"
/>
<Section tone="subtle">
@@ -31,7 +37,7 @@ export default async function ValuesPage() {
<div className="grid gap-4 sm:grid-cols-2 xl:grid-cols-3">
{valuesContent.items.map((item, index) => (
<SurfaceCard key={item.title} padded>
<p className="text-xs font-semibold text-primary/80">
<p className="text-xs font-semibold text-accent/80">
{FA_INDEX[index] ?? String(index + 1)}
</p>
<Heading as="h2" level={4} className="mt-2">
@@ -60,13 +66,13 @@ export default async function ValuesPage() {
className="group block min-w-0 rounded-xl focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50"
>
<SurfaceCard padded interactive className="h-full transition-shadow">
<Heading as="h3" level={4} className="group-hover:text-primary">
<Heading as="h3" level={4} className="group-hover:text-accent">
{example.title}
</Heading>
<p className="mt-2 text-sm leading-7 text-muted-foreground">
{example.text}
</p>
<span className="mt-4 inline-flex items-center gap-1.5 text-sm font-semibold text-primary">
<span className="mt-4 inline-flex items-center gap-1.5 text-sm font-semibold text-accent">
مشاهده دوره
<ArrowLeft className="size-3.5 transition-transform group-hover:-translate-x-0.5" />
</span>
+3 -3
View File
@@ -37,7 +37,7 @@ export async function PATCH(
try {
body = await parseJsonBody(request);
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = alumniPatchSchema.safeParse(body);
@@ -50,7 +50,7 @@ export async function PATCH(
try {
const res = await query<AlumniStoryRow>(spec.sql, [...spec.params, id]);
if (res.rows.length === 0) return errorResponse("داستان دانش‌آموخته یافت نشد", 404);
if (res.rows.length === 0) return errorResponse("داستان دانش آموخته یافت نشد", 404);
const row = res.rows[0];
return NextResponse.json({
ok: true,
@@ -76,7 +76,7 @@ export async function DELETE(
const { id } = await params;
try {
const res = await query(`DELETE FROM alumni_stories WHERE id = $1 RETURNING id`, [id]);
if (res.rows.length === 0) return errorResponse("داستان دانش‌آموخته یافت نشد", 404);
if (res.rows.length === 0) return errorResponse("داستان دانش آموخته یافت نشد", 404);
revalidateSite();
return NextResponse.json({ ok: true });
} catch (err) {
+1 -1
View File
@@ -21,7 +21,7 @@ export async function POST(request: NextRequest) {
try {
body = await parseJsonBody(request);
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = alumniCreateSchema.safeParse(body);
+2 -2
View File
@@ -40,7 +40,7 @@ export async function PATCH(
try {
body = await request.json();
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = articlePatchSchema.safeParse(body);
@@ -76,7 +76,7 @@ export async function PATCH(
});
} catch (err) {
if (isUniqueViolation(err) && err.constraint === "articles_one_featured") {
return errorResponse("فقط یک مقالهٔ ویژهٔ منتشرشده مجاز است", 409);
return errorResponse("فقط یک مقاله ویژه منتشر شده مجاز است", 409);
}
console.error("admin update article error:", err);
return errorResponse("خطای سرور", 500);
+2 -2
View File
@@ -23,7 +23,7 @@ export async function POST(request: NextRequest) {
try {
body = await request.json();
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = articleCreateSchema.safeParse(body);
@@ -52,7 +52,7 @@ export async function POST(request: NextRequest) {
);
} catch (err) {
if (isUniqueViolation(err) && err.constraint === "articles_one_featured") {
return errorResponse("فقط یک مقالهٔ ویژهٔ منتشرشده مجاز است", 409);
return errorResponse("فقط یک مقاله ویژه منتشر شده مجاز است", 409);
}
console.error("admin create article error:", err);
return errorResponse("خطای سرور", 500);
+1 -1
View File
@@ -31,7 +31,7 @@ export async function PATCH(
try {
body = await parseJsonBody(request);
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = bannerPatchSchema.safeParse(body);
+1 -1
View File
@@ -17,7 +17,7 @@ export async function POST(request: NextRequest) {
try {
body = await parseJsonBody(request);
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = bannerCreateSchema.safeParse(body);
@@ -30,7 +30,7 @@ export async function PATCH(
try {
body = await parseJsonBody(request);
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = courseCategoryPatchSchema.safeParse(body);
@@ -48,7 +48,7 @@ export async function PATCH(
return NextResponse.json({ ok: true, data });
} catch (err) {
if (isUniqueViolation(err) && err.constraint === "course_categories_slug_key") {
return errorResponse("این slug قبلاً استفاده شده است", 409);
return errorResponse("این slug قبلا استفاده شده است", 409);
}
console.error("admin update course-category error:", err);
return errorResponse("خطای سرور", 500);
+2 -2
View File
@@ -17,7 +17,7 @@ export async function POST(request: Request) {
try {
body = await parseJsonBody(request);
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = courseCategoryCreateSchema.safeParse(body);
@@ -38,7 +38,7 @@ export async function POST(request: Request) {
return NextResponse.json({ ok: true, data }, { status: 201 });
} catch (err) {
if (isUniqueViolation(err) && err.constraint === "course_categories_slug_key") {
return errorResponse("این slug قبلاً استفاده شده است", 409);
return errorResponse("این slug قبلا استفاده شده است", 409);
}
console.error("admin create course-category error:", err);
return errorResponse("خطای سرور", 500);
+2 -2
View File
@@ -31,7 +31,7 @@ export async function PATCH(
try {
body = await parseJsonBody(request);
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = courseTagPatchSchema.safeParse(body);
@@ -49,7 +49,7 @@ export async function PATCH(
return NextResponse.json({ ok: true, data });
} catch (err) {
if (isUniqueViolation(err) && err.constraint === "course_tags_slug_key") {
return errorResponse("این slug قبلاً استفاده شده است", 409);
return errorResponse("این slug قبلا استفاده شده است", 409);
}
console.error("admin update course-tag error:", err);
return errorResponse("خطای سرور", 500);
+2 -2
View File
@@ -17,7 +17,7 @@ export async function POST(request: Request) {
try {
body = await parseJsonBody(request);
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = courseTagCreateSchema.safeParse(body);
@@ -54,7 +54,7 @@ export async function POST(request: Request) {
return NextResponse.json({ ok: true, data }, { status: 201 });
} catch (err) {
if (isUniqueViolation(err) && err.constraint === "course_tags_slug_key") {
return errorResponse("این slug قبلاً استفاده شده است", 409);
return errorResponse("این slug قبلا استفاده شده است", 409);
}
console.error("admin create course-tag error:", err);
return errorResponse("خطای سرور", 500);
+2 -2
View File
@@ -61,7 +61,7 @@ export async function PATCH(
try {
body = await request.json();
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = coursePatchSchema.safeParse(body);
@@ -121,7 +121,7 @@ export async function PATCH(
return NextResponse.json({ ok: true, data: course });
} catch (err) {
if (isUniqueViolation(err) && err.constraint === "courses_slug_key") {
return errorResponse("این slug قبلاً استفاده شده است", 409);
return errorResponse("این slug قبلا استفاده شده است", 409);
}
console.error("admin update course error:", err);
return errorResponse("خطای سرور", 500);
+2 -2
View File
@@ -50,7 +50,7 @@ export async function POST(request: NextRequest) {
try {
body = await request.json();
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = courseCreateSchema.safeParse(body);
@@ -90,7 +90,7 @@ export async function POST(request: NextRequest) {
return NextResponse.json({ ok: true, data: course }, { status: 201 });
} catch (err) {
if (isUniqueViolation(err) && err.constraint === "courses_slug_key") {
return errorResponse("این slug قبلاً استفاده شده است", 409);
return errorResponse("این slug قبلا استفاده شده است", 409);
}
console.error("admin create course error:", err);
return errorResponse("خطای سرور", 500);
+1 -1
View File
@@ -37,7 +37,7 @@ export async function PATCH(
try {
body = await parseJsonBody(request);
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = eventPatchSchema.safeParse(body);
+1 -1
View File
@@ -21,7 +21,7 @@ export async function POST(request: NextRequest) {
try {
body = await parseJsonBody(request);
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = eventCreateSchema.safeParse(body);
+1 -1
View File
@@ -39,7 +39,7 @@ export async function PATCH(
try {
body = await parseJsonBody(request);
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = facultyPatchSchema.safeParse(body);
+1 -1
View File
@@ -17,7 +17,7 @@ export async function POST(request: NextRequest) {
try {
body = await parseJsonBody(request);
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = facultyCreateSchema.safeParse(body);
+1 -1
View File
@@ -26,7 +26,7 @@ export async function POST() {
});
} catch (err) {
const message =
err instanceof Error ? err.message : "همگام‌سازی اساتید ناموفق بود";
err instanceof Error ? err.message : "همگام سازی اساتید ناموفق بود";
console.error("faculty sync error:", err);
return errorResponse(message, 502);
}
+3 -3
View File
@@ -29,7 +29,7 @@ export async function PATCH(
try {
body = await parseJsonBody(request);
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = legalPatchSchema.safeParse(body);
@@ -47,7 +47,7 @@ export async function PATCH(
try {
const res = await query<LegalPageRow>(spec.sql, [...spec.params, slug]);
if (res.rows.length === 0) return errorResponse("صفحهٔ حقوقی یافت نشد", 404);
if (res.rows.length === 0) return errorResponse("صفحه حقوقی یافت نشد", 404);
const row = res.rows[0];
return NextResponse.json({
ok: true,
@@ -70,7 +70,7 @@ export async function DELETE(
const { slug } = await params;
try {
const res = await query(`DELETE FROM legal_pages WHERE slug = $1 RETURNING slug`, [slug]);
if (res.rows.length === 0) return errorResponse("صفحهٔ حقوقی یافت نشد", 404);
if (res.rows.length === 0) return errorResponse("صفحه حقوقی یافت نشد", 404);
revalidateSite();
return NextResponse.json({ ok: true });
} catch (err) {
+2 -2
View File
@@ -18,7 +18,7 @@ export async function POST(request: NextRequest) {
try {
body = await parseJsonBody(request);
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = legalCreateSchema.safeParse(body);
@@ -42,7 +42,7 @@ export async function POST(request: NextRequest) {
);
} catch (err) {
if (isUniqueViolation(err)) {
return errorResponse("این slug قبلاً استفاده شده است", 409);
return errorResponse("این slug قبلا استفاده شده است", 409);
}
console.error("admin create legal error:", err);
return errorResponse("خطای سرور", 500);
+1 -1
View File
@@ -32,7 +32,7 @@ export async function POST(request: NextRequest) {
const message = error instanceof Error ? error.message : String(error);
if (/timeout|ECONNREFUSED|ECONNRESET|Connection terminated/i.test(message)) {
return NextResponse.json(
{ error: "اتصال به پایگاه‌داده برقرار نشد. چند ثانیه بعد دوباره تلاش کنید." },
{ error: "اتصال به پایگاه داده برقرار نشد. چند ثانیه بعد دوباره تلاش کنید." },
{ status: 503 },
);
}
+2 -2
View File
@@ -39,7 +39,7 @@ export async function PATCH(
try {
body = await parseJsonBody(request);
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = programPatchSchema.safeParse(body);
@@ -62,7 +62,7 @@ export async function PATCH(
return NextResponse.json({ ok: true, data: { ...rowToProgram(row), published: row.published } });
} catch (err) {
if (isUniqueViolation(err) && err.constraint === "programs_slug_key") {
return errorResponse("این slug قبلاً استفاده شده است", 409);
return errorResponse("این slug قبلا استفاده شده است", 409);
}
console.error("admin update program error:", err);
return errorResponse("خطای سرور", 500);
+2 -2
View File
@@ -18,7 +18,7 @@ export async function POST(request: NextRequest) {
try {
body = await parseJsonBody(request);
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = programCreateSchema.safeParse(body);
@@ -43,7 +43,7 @@ export async function POST(request: NextRequest) {
);
} catch (err) {
if (isUniqueViolation(err) && err.constraint === "programs_slug_key") {
return errorResponse("این slug قبلاً استفاده شده است", 409);
return errorResponse("این slug قبلا استفاده شده است", 409);
}
console.error("admin create program error:", err);
return errorResponse("خطای سرور", 500);
@@ -22,7 +22,7 @@ export async function PATCH(
try {
body = await parseJsonBody(request);
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = registrationStatusSchema.safeParse(body);
@@ -35,7 +35,7 @@ export async function PATCH(
`UPDATE registration_leads SET status = $1 WHERE id = $2 RETURNING *`,
[parsed.data.status, id],
);
if (res.rows.length === 0) return errorResponse("لید ثبت‌نام یافت نشد", 404);
if (res.rows.length === 0) return errorResponse("لید ثبت نام یافت نشد", 404);
return NextResponse.json({ ok: true, data: res.rows[0] });
} catch (err) {
console.error("admin update registration error:", err);
@@ -57,7 +57,7 @@ export async function DELETE(
`DELETE FROM registration_leads WHERE id = $1 RETURNING id`,
[id],
);
if (res.rows.length === 0) return errorResponse("لید ثبت‌نام یافت نشد", 404);
if (res.rows.length === 0) return errorResponse("لید ثبت نام یافت نشد", 404);
return NextResponse.json({ ok: true });
} catch (err) {
console.error("admin delete registration error:", err);
+1 -1
View File
@@ -29,7 +29,7 @@ export async function PATCH(
try {
body = await parseJsonBody(request);
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = statPatchSchema.safeParse(body);
+1 -1
View File
@@ -17,7 +17,7 @@ export async function POST(request: NextRequest) {
try {
body = await parseJsonBody(request);
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = statCreateSchema.safeParse(body);
+1 -1
View File
@@ -31,7 +31,7 @@ export async function PATCH(
try {
body = await parseJsonBody(request);
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = testimonialPatchSchema.safeParse(body);
+1 -1
View File
@@ -17,7 +17,7 @@ export async function POST(request: NextRequest) {
try {
body = await parseJsonBody(request);
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = testimonialCreateSchema.safeParse(body);
+2 -2
View File
@@ -35,7 +35,7 @@ export async function PATCH(
try {
body = await parseJsonBody(request);
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = topicPatchSchema.safeParse(body);
@@ -61,7 +61,7 @@ export async function PATCH(
});
} catch (err) {
if (isUniqueViolation(err) && err.constraint === "intersection_topics_slug_key") {
return errorResponse("این slug قبلاً استفاده شده است", 409);
return errorResponse("این slug قبلا استفاده شده است", 409);
}
console.error("admin update topic error:", err);
return errorResponse("خطای سرور", 500);
+2 -2
View File
@@ -18,7 +18,7 @@ export async function POST(request: NextRequest) {
try {
body = await parseJsonBody(request);
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = topicCreateSchema.safeParse(body);
@@ -43,7 +43,7 @@ export async function POST(request: NextRequest) {
);
} catch (err) {
if (isUniqueViolation(err) && err.constraint === "intersection_topics_slug_key") {
return errorResponse("این slug قبلاً استفاده شده است", 409);
return errorResponse("این slug قبلا استفاده شده است", 409);
}
console.error("admin create topic error:", err);
return errorResponse("خطای سرور", 500);
+2 -2
View File
@@ -16,7 +16,7 @@ export async function POST(request: NextRequest) {
try {
formData = await request.formData();
} catch {
return errorResponse("بدنهٔ درخواست معتبر نیست", 400);
return errorResponse("بدنه درخواست معتبر نیست", 400);
}
const file = formData.get("file");
@@ -26,7 +26,7 @@ export async function POST(request: NextRequest) {
const folderRaw = String(formData.get("folder") ?? "general");
if (!isUploadFolder(folderRaw)) {
return errorResponse("پوشهٔ مقصد نامعتبر است", 400);
return errorResponse("پوشه مقصد نامعتبر است", 400);
}
const folder: UploadFolder = folderRaw;
+1 -1
View File
@@ -12,7 +12,7 @@ export async function POST(request: NextRequest) {
try {
body = await request.json();
} catch {
return errorResponse("بدنهٔ درخواست JSON معتبر نیست", 400);
return errorResponse("بدنه درخواست JSON معتبر نیست", 400);
}
const parsed = publicRegistrationSchema.safeParse(body);
Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 27 KiB

+78 -67
View File
@@ -53,68 +53,77 @@
}
:root {
/* AUT red + gold mapped into standard shadcn tokens */
--background: #ffffff;
--foreground: #1a1a1a;
/*
AUT Open Education — pixel palette (navy + white + cool gray)
primary #1E3358 · accent #0C2461 · bg #F5F6F8 · surface #FFF · border #E3E7EE · soft #EEF2F8
Map surface → card; surface-soft → secondary/muted. No --surface* parallel tokens.
*/
--background: #f5f6f8;
--foreground: #1e3358;
--card: #ffffff;
--card-foreground: #1a1a1a;
--card-foreground: #1e3358;
--popover: #ffffff;
--popover-foreground: #1a1a1a;
--primary: #a31f34;
--popover-foreground: #1e3358;
--primary: #1e3358;
--primary-foreground: #ffffff;
--secondary: #f0efeb;
--secondary-foreground: #1a1a1a;
--muted: #f7f6f3;
--muted-foreground: #5c5c5c;
--accent: #d9dee5;
--accent-foreground: #16202c;
--secondary: #eef2f8;
--secondary-foreground: #1e3358;
--muted: #eef2f8;
--muted-foreground: #5c677a;
--accent: #0c2461;
--accent-foreground: #ffffff;
--destructive: oklch(0.577 0.245 27.325);
--border: #ebe9e4;
--input: #ebe9e4;
--ring: #a31f34;
--border: #e3e7ee;
--input: #e3e7ee;
--ring: #0c2461;
--radius: 0.625rem;
--chart-1: #a31f34;
--chart-2: #0c2d5a;
--chart-3: #061525;
--chart-4: #9aa5b1;
--chart-5: #5c5c5c;
--chart-1: #0c2461;
--chart-2: #1e3358;
--chart-3: #1e3358;
--chart-4: #5c677a;
--chart-5: #9aa3b2;
--sidebar: #ffffff;
--sidebar-foreground: #1a1a1a;
--sidebar-primary: #a31f34;
--sidebar-foreground: #1e3358;
--sidebar-primary: #1e3358;
--sidebar-primary-foreground: #ffffff;
--sidebar-accent: #f0efeb;
--sidebar-accent-foreground: #1a1a1a;
--sidebar-border: #e2e0db;
--sidebar-ring: #a31f34;
--sidebar-accent: #eef2f8;
--sidebar-accent-foreground: #1e3358;
--sidebar-border: #e3e7ee;
--sidebar-ring: #0c2461;
}
.dark {
--background: #0a0a0a;
--foreground: #f7f6f3;
--card: #141414;
--card-foreground: #f7f6f3;
--popover: #141414;
--popover-foreground: #f7f6f3;
--primary: #c43a4e;
--primary-foreground: #ffffff;
--secondary: #1f1f1f;
--secondary-foreground: #f7f6f3;
--muted: #1a1a1a;
--muted-foreground: #a3a3a3;
--accent: #c7ced8;
--accent-foreground: #111827;
--border: #2a2a2a;
--input: #2a2a2a;
--ring: #c43a4e;
--sidebar: #141414;
--sidebar-foreground: #f7f6f3;
--sidebar-primary: #c43a4e;
--sidebar-primary-foreground: #ffffff;
--sidebar-accent: #1f1f1f;
--sidebar-accent-foreground: #f7f6f3;
--sidebar-border: #2a2a2a;
--sidebar-ring: #c43a4e;
--background: #0c2461;
--foreground: #f5f6f8;
--card: #1e3358;
--card-foreground: #f5f6f8;
--popover: #1e3358;
--popover-foreground: #f5f6f8;
--primary: #eef2f8;
--primary-foreground: #1e3358;
--secondary: #243a5c;
--secondary-foreground: #f5f6f8;
--muted: #243a5c;
--muted-foreground: #9aa3b2;
--accent: #e3e7ee;
--accent-foreground: #0c2461;
--border: #2a4060;
--input: #2a4060;
--ring: #eef2f8;
--chart-1: #eef2f8;
--chart-2: #1e3358;
--chart-3: #0c2461;
--chart-4: #9aa3b2;
--chart-5: #5c677a;
--sidebar: #1e3358;
--sidebar-foreground: #f5f6f8;
--sidebar-primary: #eef2f8;
--sidebar-primary-foreground: #1e3358;
--sidebar-accent: #243a5c;
--sidebar-accent-foreground: #f5f6f8;
--sidebar-border: #2a4060;
--sidebar-ring: #eef2f8;
}
@layer base {
@@ -129,10 +138,20 @@
}
body {
@apply bg-background text-foreground antialiased;
font-size: 16px;
line-height: 1.65;
/* Vazirmatn reads best ~16px with a slightly open Persian line-height */
font-size: 1rem;
line-height: 1.75;
text-align: start;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: var(--font-heading), var(--font-sans), ui-sans-serif, system-ui,
sans-serif;
}
html,
body {
width: 100%;
@@ -197,7 +216,7 @@
height: 0.3rem;
border-radius: 999px;
content: "";
background: var(--primary);
background: var(--accent);
opacity: 0;
transform: translateX(50%) scale(0);
transition: opacity 200ms ease, transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
@@ -216,21 +235,13 @@
.motion-section[data-tone="dark"] {
background-image:
radial-gradient(circle at 10% 20%, color-mix(in oklab, var(--primary) 30%, transparent), transparent 28%),
radial-gradient(circle at 90% 80%, color-mix(in oklab, var(--accent) 10%, transparent), transparent 25%);
radial-gradient(circle at 10% 20%, color-mix(in oklab, var(--primary-foreground) 12%, transparent), transparent 28%),
radial-gradient(circle at 90% 80%, color-mix(in oklab, var(--secondary) 18%, transparent), transparent 25%);
}
/* Neural-field signal pulse along active synapses (MetamorphField) */
@media (min-width: 768px) and (prefers-reduced-motion: no-preference) {
@keyframes metamorph-pulse {
to {
stroke-dashoffset: -126;
}
}
.metamorph-pulse {
animation: metamorph-pulse 2.8s linear infinite;
}
.motion-section[data-tone="accent"] {
background-image:
radial-gradient(circle at 85% 15%, color-mix(in oklab, var(--accent-foreground) 10%, transparent), transparent 30%);
}
/* Scroll-driven reveals: desktop only — expensive while scrolling on phones */
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

+22 -10
View File
@@ -2,6 +2,7 @@ import type { Metadata, Viewport } from "next";
import { Vazirmatn } from "next/font/google";
import { NextIntlClientProvider } from "next-intl";
import { getLocale, getMessages, getTranslations } from "next-intl/server";
import { getSiteOrigin } from "@/lib/seo/metadata";
import { JsonLd, organizationJsonLd } from "@/lib/seo/json-ld";
import "./globals.css";
@@ -15,15 +16,14 @@ const vazirmatn = Vazirmatn({
subsets: ["arabic", "latin"],
variable: "--font-vazirmatn",
display: "swap",
weight: ["200", "300", "400", "500", "600", "700", "800", "900"],
// Common UI weights only — avoids muddy black/extrabold on Persian UI
weight: ["400", "500", "600", "700"],
});
export async function generateMetadata(): Promise<Metadata> {
const t = await getTranslations("meta");
const siteUrl =
process.env.NEXT_PUBLIC_SITE_URL ?? "https://edu.mstaut.ir";
return {
metadataBase: new URL(siteUrl),
metadataBase: new URL(getSiteOrigin()),
title: {
default: t("homeTitle"),
template: `%s | ${t("homeTitle")}`,
@@ -32,9 +32,20 @@ export async function generateMetadata(): Promise<Metadata> {
icons: {
icon: [
{ url: "/favicon.ico", sizes: "any" },
{ url: "/brand/mst-faculty-icon.png", type: "image/png", sizes: "256x256" },
{ url: "/brand/icons/favicon-16x16.png", type: "image/png", sizes: "16x16" },
{ url: "/brand/icons/favicon-32x32.png", type: "image/png", sizes: "32x32" },
{ url: "/brand/icons/favicon-48x48.png", type: "image/png", sizes: "48x48" },
{ url: "/brand/icons/favicon-64x64.png", type: "image/png", sizes: "64x64" },
{ url: "/brand/icons/favicon-128x128.png", type: "image/png", sizes: "128x128" },
{ url: "/brand/icons/favicon-192x192.png", type: "image/png", sizes: "192x192" },
{ url: "/brand/icons/favicon-256x256.png", type: "image/png", sizes: "256x256" },
{ url: "/brand/icons/favicon-512x512.png", type: "image/png", sizes: "512x512" },
],
apple: [{ url: "/brand/mst-faculty-icon.png", type: "image/png" }],
apple: [
{ url: "/apple-touch-icon.png", type: "image/png", sizes: "180x180" },
{ url: "/brand/icons/favicon-180x180.png", type: "image/png", sizes: "180x180" },
],
shortcut: [{ url: "/favicon.ico" }],
},
openGraph: {
type: "website",
@@ -46,9 +57,8 @@ export async function generateMetadata(): Promise<Metadata> {
{ url: "/brand/mst-faculty.png", alt: "دانشکده مدیریت، علم و فناوری دانشگاه صنعتی امیرکبیر" },
],
},
alternates: {
canonical: "/",
languages: { fa: "/" },
twitter: {
card: "summary_large_image",
},
};
}
@@ -64,7 +74,9 @@ export default async function RootLayout({
return (
<html lang={locale} dir="rtl" className={`${vazirmatn.variable} h-full`}>
<body className="flex min-h-full min-w-0 flex-col font-sans">
<body
className={`${vazirmatn.className} flex min-h-full min-w-0 flex-col font-sans`}
>
<NextIntlClientProvider messages={messages}>
<a
href="#main-content"
@@ -26,7 +26,7 @@ export default async function AdminEntityEditPage({
<AdminPageHeader
title={`ویرایش ${spec.noun}`}
description={String(row[spec.columns[0].name] ?? "")}
backHref={`/admin/${entity}`}
backHref={`/mstcontroller/${entity}`}
backLabel={`بازگشت به ${spec.navLabel}`}
/>
<GenericForm
@@ -24,10 +24,10 @@ export default async function AdminEntityCreatePage({
title={`${spec.noun} جدید`}
description={
spec.hasPublished
? "پس از ثبت، در صورت «منتشرشده» بودن در سایت عمومی نمایش داده می‌شود."
? "پس از ثبت، در صورت «منتشر شده» بودن در سایت عمومی نمایش داده می شود."
: undefined
}
backHref={`/admin/${entity}`}
backHref={`/mstcontroller/${entity}`}
backLabel={`بازگشت به ${spec.navLabel}`}
/>
<GenericForm
@@ -61,7 +61,7 @@ export default async function AdminEntityListPage({
actions={
<>
{entity === "faculty" ? <FacultySyncButton /> : null}
<Link href={`/admin/${entity}/new`} className={cn(buttonVariants())}>
<Link href={`/mstcontroller/${entity}/new`} className={cn(buttonVariants())}>
+ {spec.noun} جدید
</Link>
</>
@@ -32,8 +32,8 @@ export default async function EditCoursePage({
<AdminPageHeader
title="ویرایش دوره"
description={course.title}
backHref="/admin/courses"
backLabel="بازگشت به دوره‌ها"
backHref="/mstcontroller/courses"
backLabel="بازگشت به دوره ها"
/>
<CourseForm
initial={course}
@@ -22,9 +22,9 @@ export default async function NewCoursePage() {
<AdminPage>
<AdminPageHeader
title="دوره جدید"
description="دوره پس از ثبت، در صورت «منتشرشده» بودن در سایت عمومی نمایش داده می‌شود."
backHref="/admin/courses"
backLabel="بازگشت به دوره‌ها"
description="دوره پس از ثبت، در صورت «منتشر شده» بودن در سایت عمومی نمایش داده می شود."
backHref="/mstcontroller/courses"
backLabel="بازگشت به دوره ها"
/>
<CourseForm
categories={categories}
@@ -42,10 +42,10 @@ export default async function AdminCoursesPage({
return (
<AdminPage>
<AdminPageHeader
title="دوره‌ها"
title="دوره ها"
description={`${courses.length} دوره${search ? ` مطابق فیلتر «${search}»` : ""}`}
actions={
<Link href="/admin/courses/new" className={cn(buttonVariants())}>
<Link href="/mstcontroller/courses/new" className={cn(buttonVariants())}>
+ دوره جدید
</Link>
}
@@ -67,8 +67,8 @@ export default async function AdminCoursesPage({
</AdminToolbarCard>
<AdminTableCard
title="فهرست دوره‌ها"
description="مدیریت، انتشار و پیش‌نمایش دوره‌های کوتاه"
title="فهرست دوره ها"
description="مدیریت، انتشار و پیش نمایش دوره های کوتاه"
>
<CourseTable courses={courses} />
</AdminTableCard>
@@ -3,8 +3,8 @@ import { verifySession } from "@/lib/auth/admin";
import { AdminShell } from "@/components/organisms/admin/AdminShell";
// Authoritative admin guard + shell.
// - Verifies the session against the database for every /admin page
// (login lives outside this route group, see src/app/admin/login).
// - Verifies the session against the database for every /mstcontroller page
// (login lives outside this route group, see src/app/mstcontroller/login).
// - Proxy only does a fast cookie-presence redirect; this is the real check.
export default async function AdminGuardLayout({
@@ -22,7 +22,7 @@ export default async function AdminGuardLayout({
);
}
if (!session) {
redirect("/admin/login");
redirect("/mstcontroller/login");
}
return <AdminShell userName={session.name}>{children}</AdminShell>;
@@ -46,12 +46,12 @@ const getCounts = async (): Promise<Record<string, number>> => {
};
const countCards = [
{ key: "courses", label: "دوره‌ها", href: "/admin/courses", icon: BookOpen },
{ key: "programs", label: "برنامه‌ها", href: "/admin/programs", icon: GraduationCap },
{ key: "events", label: "رویدادها", href: "/admin/events", icon: Calendar },
{ key: "articles", label: "مقالات", href: "/admin/articles", icon: Newspaper },
{ key: "faculty", label: "اساتید", href: "/admin/faculty", icon: Users },
{ key: "alumni", label: "دانش‌آموختگان", href: "/admin/alumni", icon: MessageSquareQuote },
{ key: "courses", label: "دوره ها", href: "/mstcontroller/courses", icon: BookOpen },
{ key: "programs", label: "برنامه ها", href: "/mstcontroller/programs", icon: GraduationCap },
{ key: "events", label: "رویدادها", href: "/mstcontroller/events", icon: Calendar },
{ key: "articles", label: "مقالات", href: "/mstcontroller/articles", icon: Newspaper },
{ key: "faculty", label: "اساتید", href: "/mstcontroller/faculty", icon: Users },
{ key: "alumni", label: "دانش آموختگان", href: "/mstcontroller/alumni", icon: MessageSquareQuote },
].filter((card) => isAdminEntityEnabled(card.key));
export default async function AdminDashboardPage() {
@@ -67,9 +67,9 @@ export default async function AdminDashboardPage() {
<AdminPage className="space-y-8">
<AdminPageHeader
title="داشبورد"
description="نمای کلی محتوای مدیریت‌شدنی و درخواست‌های تازه"
description="نمای کلی محتوای مدیریت شدنی و درخواست های تازه"
actions={
<Link href="/admin/courses/new" className={cn(buttonVariants())}>
<Link href="/mstcontroller/courses/new" className={cn(buttonVariants())}>
<Plus className="size-4" />
دوره جدید
</Link>
@@ -101,11 +101,11 @@ export default async function AdminDashboardPage() {
<Card className="shadow-none">
<CardHeader className="border-b [.border-b]:pb-4">
<CardTitle>درخواست‌های اخیر ثبت‌نام</CardTitle>
<CardDescription>۵ درخواست آخر از برگ ثبت‌نام</CardDescription>
<CardTitle>درخواست های اخیر ثبت نام</CardTitle>
<CardDescription>۵ درخواست آخر از برگ ثبت نام</CardDescription>
<CardAction>
<Link
href="/admin/registrations"
href="/mstcontroller/registrations"
className={cn(buttonVariants({ variant: "outline", size: "sm" }))}
>
مشاهده همه
@@ -29,7 +29,7 @@ export default async function AdminRegistrationsPage({
return (
<AdminPage>
<AdminPageHeader title="برگ ثبت‌نام" description={parts.join(" · ")} />
<AdminPageHeader title="برگ ثبت نام" description={parts.join(" · ")} />
<AdminToolbarCard description="جستجو بر اساس نام، ایمیل یا اسلاگ دوره">
<RegistrationFilters
@@ -38,7 +38,7 @@ export default async function AdminRegistrationsPage({
/>
</AdminToolbarCard>
<AdminTableCard title="درخواست‌ها" description="پیگیری و تغییر وضعیت لیدها">
<AdminTableCard title="درخواست ها" description="پیگیری و تغییر وضعیت لیدها">
<RegistrationsTable rows={rows} />
</AdminTableCard>
</AdminPage>
+17
View File
@@ -0,0 +1,17 @@
import type { Metadata } from "next";
export const metadata: Metadata = {
robots: {
index: false,
follow: false,
googleBot: { index: false, follow: false },
},
};
export default function AdminRootLayout({
children,
}: {
children: React.ReactNode;
}) {
return children;
}
@@ -19,7 +19,7 @@ export const dynamic = "force-dynamic";
function LoginForm() {
const router = useRouter();
const searchParams = useSearchParams();
const redirect = searchParams.get("redirect") || "/admin";
const redirect = searchParams.get("redirect") || "/mstcontroller";
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
-2
View File
@@ -7,7 +7,6 @@ import { listPublishedCourseTags } from "@/lib/data/taxonomy";
import { getPrograms } from "@/lib/data/programs";
import {
courseNavParentTag,
facultyNetworkUrl,
facultySiteUrl,
professionalNav,
siteShortName,
@@ -63,7 +62,6 @@ export default async function ProfessionalLayout({
linksTitle={t("footer.links")}
links={[
{ label: t("footer.facultySite"), href: facultySiteUrl },
{ label: t("footer.facultyNetwork"), href: facultyNetworkUrl },
{ label: t("footer.press"), href: "/press" },
{ label: t("footer.careers"), href: "/careers" },
]}
+5 -9
View File
@@ -8,20 +8,16 @@ import {
} from "@/lib/data/taxonomy";
import { getSiteStats } from "@/lib/data/site";
import { courseJsonLd, JsonLd } from "@/lib/seo/json-ld";
import { pageMetadata } from "@/lib/seo/metadata";
export async function generateMetadata(): Promise<Metadata> {
const t = await getTranslations("meta");
return {
return pageMetadata({
title: t("professionalTitle"),
description: t("professionalDescription"),
openGraph: {
title: t("professionalTitle"),
description: t("professionalDescription"),
},
alternates: {
canonical: "/professional",
},
};
path: "/professional",
absoluteTitle: true,
});
}
export default async function ProfessionalPage({
+13
View File
@@ -0,0 +1,13 @@
import type { MetadataRoute } from "next";
export default function robots(): MetadataRoute.Robots {
const base = process.env.NEXT_PUBLIC_SITE_URL ?? "https://edu.mstaut.ir";
return {
rules: {
userAgent: "*",
allow: "/",
disallow: ["/mstcontroller", "/mstcontroller/", "/api/"],
},
sitemap: `${base.replace(/\/$/, "")}/sitemap.xml`,
};
}
+129
View File
@@ -0,0 +1,129 @@
import type { MetadataRoute } from "next";
import { getArticles } from "@/lib/data/articles";
import { getCourses } from "@/lib/data/courses";
import { getEvents } from "@/lib/data/events";
import { getPrograms } from "@/lib/data/programs";
import { getTopics } from "@/lib/data/site";
const BASE_URL = (
process.env.NEXT_PUBLIC_SITE_URL ?? "https://edu.mstaut.ir"
).replace(/\/$/, "");
/** Published legal slugs from `(main)/(legal)/[slug]` generateStaticParams. */
const LEGAL_SLUGS = ["press", "careers"] as const;
type SitemapEntry = MetadataRoute.Sitemap[number];
type ChangeFrequency = NonNullable<SitemapEntry["changeFrequency"]>;
function sitemapEntry(
path: string,
options: {
changeFrequency?: ChangeFrequency;
priority?: number;
lastModified?: Date | string;
} = {},
): SitemapEntry {
const normalized = path.startsWith("/") ? path : `/${path}`;
return {
url: `${BASE_URL}${normalized}`,
lastModified: options.lastModified ?? new Date(),
changeFrequency: options.changeFrequency ?? "monthly",
priority: options.priority ?? 0.5,
};
}
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const entries: MetadataRoute.Sitemap = [
sitemapEntry("/", { changeFrequency: "weekly", priority: 1.0 }),
sitemapEntry("/professional", { changeFrequency: "weekly", priority: 0.9 }),
sitemapEntry("/about", { priority: 0.7 }),
sitemapEntry("/contact", { priority: 0.7 }),
sitemapEntry("/values", { priority: 0.7 }),
sitemapEntry("/alumni", { priority: 0.6 }),
sitemapEntry("/programs", { changeFrequency: "weekly", priority: 0.8 }),
sitemapEntry("/insights", { changeFrequency: "weekly", priority: 0.7 }),
sitemapEntry("/events", { changeFrequency: "weekly", priority: 0.7 }),
...LEGAL_SLUGS.map((slug) =>
sitemapEntry(`/${slug}`, { changeFrequency: "yearly", priority: 0.4 }),
),
];
try {
const courses = await getCourses();
for (const course of courses) {
if (!course.slug) continue;
entries.push(
sitemapEntry(`/register/${course.slug}`, {
changeFrequency: "weekly",
priority: 0.8,
}),
);
}
} catch {
// DB unavailable at build time — omit dynamic course URLs
}
try {
const programs = await getPrograms();
for (const program of programs) {
if (!program.slug) continue;
entries.push(
sitemapEntry(`/programs/${program.slug}`, {
changeFrequency: "monthly",
priority: 0.75,
}),
);
}
} catch {
// omit
}
try {
const articles = await getArticles();
for (const article of articles) {
if (!article.id) continue;
entries.push(
sitemapEntry(`/insights/${article.id}`, {
changeFrequency: "monthly",
priority: 0.65,
lastModified: article.publishedAt,
}),
);
}
} catch {
// omit
}
try {
const events = await getEvents();
for (const event of events) {
if (!event.id) continue;
entries.push(
sitemapEntry(`/events/${event.id}`, {
changeFrequency: "weekly",
priority: 0.65,
lastModified: event.startDate,
}),
);
}
} catch {
// omit
}
try {
const topics = await getTopics();
for (const topic of topics) {
if (!topic.slug) continue;
entries.push(
sitemapEntry(`/topics/${topic.slug}`, {
changeFrequency: "monthly",
priority: 0.6,
}),
);
}
} catch {
// omit
}
return entries;
}
+1 -1
View File
@@ -18,7 +18,7 @@ export function BadgeLabel({
variant={map[variant]}
className={cn(
variant === "inverse" &&
"border-background/30 bg-background/15 text-background",
"border-primary-foreground/30 bg-primary-foreground/15 text-primary-foreground",
className,
)}
{...props}
+49 -7
View File
@@ -3,7 +3,9 @@ import Link from "next/link";
import { cn } from "@/lib/utils";
/** Faculty seal mark (transparent). Source: MST icon with side text removed. */
const LOGO_SRC = "/brand/mst-faculty.png";
const MARK_SRC = "/brand/mst-faculty.png";
/** Horizontal wordmark with faculty + university name baked in. */
const HORIZONTAL_SRC = "/MstAutIcon_horizontal.png";
type BrandLogoProps = {
href?: string;
@@ -12,9 +14,14 @@ type BrandLogoProps = {
onDark?: boolean;
className?: string;
compact?: boolean;
/**
* Header wordmark: uses the horizontal logo (text is in the image).
* Title/subtitle are not rendered — only used for aria-label.
*/
horizontal?: boolean;
};
/** AUT seal — raw mark only (transparent), no disc/ring/background. */
/** AUT brand mark / horizontal wordmark. */
export function BrandLogo({
href = "/",
title,
@@ -22,7 +29,40 @@ export function BrandLogo({
onDark = false,
className,
compact = false,
horizontal = false,
}: BrandLogoProps) {
const ariaLabel = [title, subtitle].filter(Boolean).join(" — ");
if (horizontal) {
return (
<Link
href={href}
className={cn(
// Clip 2× logo inside the header slot so it never bleeds into page content.
"group inline-flex min-w-0 items-center overflow-hidden",
compact ? "h-16" : "h-full",
className,
)}
aria-label={ariaLabel}
>
<Image
src={HORIZONTAL_SRC}
alt={ariaLabel}
width={1888}
height={607}
priority
sizes="(max-width:640px) 28rem, 36rem"
className={cn(
// ~2.35× slot height; overflow clipped by the link (and header).
"h-[235%] w-auto max-w-none object-contain object-right",
// Asset is white-on-black; blend so the plate disappears into the header.
onDark ? "mix-blend-screen" : "invert mix-blend-multiply",
)}
/>
</Link>
);
}
return (
<Link
href={href}
@@ -30,7 +70,7 @@ export function BrandLogo({
"group flex min-w-0 items-center gap-2.5 sm:gap-3",
className,
)}
aria-label={[title, subtitle].filter(Boolean).join(" — ")}
aria-label={ariaLabel}
>
<span
className={cn(
@@ -39,7 +79,7 @@ export function BrandLogo({
)}
>
<Image
src={LOGO_SRC}
src={MARK_SRC}
alt=""
fill
priority
@@ -54,9 +94,11 @@ export function BrandLogo({
<span className="min-w-0 text-start leading-tight">
<span
className={cn(
"block truncate font-black tracking-tight transition-colors",
"block truncate font-bold transition-colors",
compact ? "text-base" : "text-base sm:text-lg",
onDark ? "group-hover:text-background/70" : "group-hover:text-primary",
onDark
? "text-primary-foreground group-hover:text-secondary"
: "group-hover:text-accent",
)}
>
{title}
@@ -65,7 +107,7 @@ export function BrandLogo({
<span
className={cn(
"mt-0.5 hidden truncate text-[0.7rem] font-medium min-[380px]:block sm:text-xs",
onDark ? "text-background/70" : "text-muted-foreground",
onDark ? "text-primary-foreground/70" : "text-muted-foreground",
)}
>
{subtitle}
+1 -1
View File
@@ -23,7 +23,7 @@ export function DotCta({
buttonVariants({ variant: "outline" }),
"group h-auto gap-2.5 px-5 py-3 text-sm font-bold",
onDark &&
"border-background/40 bg-background text-foreground hover:bg-background/90",
"border-primary-foreground/40 bg-card text-card-foreground hover:bg-secondary",
className,
);
+9 -4
View File
@@ -1,10 +1,15 @@
import { cn } from "@/lib/utils";
/**
* Persian / Vazirmatn type scale.
* Avoid tracking-tight (hurts Arabic script). Keep clear step between levels.
* H1 hero → H2 sections → H3 cards/subheads → H4 small titles.
*/
const levels = {
1: "text-[1.65rem] font-bold leading-[1.45] tracking-tight text-pretty sm:text-4xl lg:text-[2.75rem] lg:leading-[1.4]",
2: "text-2xl font-bold leading-snug tracking-tight text-pretty sm:text-3xl lg:text-4xl",
3: "text-lg font-semibold leading-snug sm:text-xl",
4: "text-base font-semibold leading-snug sm:text-lg",
1: "text-3xl font-bold leading-[1.35] text-pretty sm:text-4xl sm:leading-[1.3] lg:text-5xl lg:leading-[1.25]",
2: "text-2xl font-bold leading-[1.4] text-pretty sm:text-3xl sm:leading-[1.35]",
3: "text-xl font-semibold leading-[1.45]",
4: "text-lg font-semibold leading-[1.5]",
} as const;
type HeadingProps = React.ComponentProps<"h1"> & {
+70 -108
View File
@@ -5,7 +5,7 @@ import { cn } from "@/lib/utils";
type MetamorphFieldProps = {
className?: string;
/** `dark` = light strokes on navy/hero; `light` = ink strokes on sand/muted */
/** `dark` = light strokes on navy/hero; `light` = ink strokes on soft surfaces */
tone?: "dark" | "light";
/** Visual density of the neural field */
density?: "sparse" | "normal";
@@ -19,22 +19,20 @@ type Node = {
y: number;
r: number;
layer: number;
active: boolean;
hub: boolean;
};
type Synapse = {
d: string;
from: number;
to: number;
active: boolean;
weight: number;
hub: boolean;
};
const VIEW_W = 1200;
const VIEW_H = 480;
const ENABLE_MQ =
"(min-width: 768px) and (prefers-reduced-motion: no-preference)";
/** Desktop only — SVG density is heavy on phones */
const ENABLE_MQ = "(min-width: 768px)";
/** Deterministic pseudo-random in [0, 1) from a seed */
function rand(seed: number) {
@@ -49,27 +47,27 @@ function synapsePath(a: Point, b: Point, seed: number): string {
const dist = Math.hypot(dx, dy) || 1;
const nx = -dy / dist;
const ny = dx / dist;
const bulge = (rand(seed) - 0.5) * Math.min(90, dist * 0.45);
const c1x = a.x + dx * 0.35 + nx * bulge;
const c1y = a.y + dy * 0.35 + ny * bulge;
const c2x = a.x + dx * 0.7 - nx * bulge * 0.55;
const c2y = a.y + dy * 0.7 - ny * bulge * 0.55;
const bulge = (rand(seed) - 0.5) * Math.min(72, dist * 0.38);
const c1x = a.x + dx * 0.32 + nx * bulge;
const c1y = a.y + dy * 0.32 + ny * bulge;
const c2x = a.x + dx * 0.68 - nx * bulge * 0.5;
const c2y = a.y + dy * 0.68 - ny * bulge * 0.5;
return `M ${a.x.toFixed(1)} ${a.y.toFixed(1)} C ${c1x.toFixed(1)} ${c1y.toFixed(1)}, ${c2x.toFixed(1)} ${c2y.toFixed(1)}, ${b.x.toFixed(1)} ${b.y.toFixed(1)}`;
}
/**
* Soft layered neural net: nodes in columns, curved synapses between
* adjacent layers — reads as an AI network while staying organic.
* Layered neural net: denser columns, more fan-out + skip links.
* Static geometry only — no motion along synapses.
*/
function buildNetwork(density: "sparse" | "normal"): {
nodes: Node[];
synapses: Synapse[];
} {
const layerCounts =
density === "sparse" ? [3, 4, 4, 3] : [4, 5, 6, 5, 3];
density === "sparse" ? [4, 5, 6, 5, 4] : [5, 7, 8, 8, 6, 4];
const layers = layerCounts.length;
const padX = density === "sparse" ? 110 : 80;
const padY = 48;
const padX = density === "sparse" ? 90 : 64;
const padY = 36;
const nodes: Node[] = [];
let id = 0;
@@ -80,16 +78,17 @@ function buildNetwork(density: "sparse" | "normal"): {
for (let i = 0; i < count; i++) {
const t = count === 1 ? 0.5 : i / (count - 1);
const y = padY + t * (VIEW_H - padY * 2);
const jitterX = (rand(id * 11 + 1) - 0.5) * 36;
const jitterY = (rand(id * 11 + 2) - 0.5) * 28;
const active = rand(id * 17) > 0.72;
const jitterX = (rand(id * 11 + 1) - 0.5) * 28;
const jitterY = (rand(id * 11 + 2) - 0.5) * 22;
const hub = rand(id * 17) > 0.72;
nodes.push({
id,
x: x + jitterX,
y: y + jitterY,
r: active ? 7.5 : 5.2 + rand(id * 3) * 2,
// Keep nodes hairline — field should read as texture, not dots
r: hub ? 2.4 : 1.35 + rand(id * 3) * 0.7,
layer: L,
active,
hub,
});
id += 1;
}
@@ -105,44 +104,39 @@ function buildNetwork(density: "sparse" | "normal"): {
const left = byLayer[L];
const right = byLayer[L + 1];
for (const a of left) {
// Each neuron fans out to 2–3 targets in the next layer
const fan = 2 + Math.floor(rand(a.id * 31) * 2);
const fan = 3 + Math.floor(rand(a.id * 31) * 3);
const ranked = [...right].sort(
(p, q) =>
Math.abs(p.y - a.y) + rand(a.id + p.id) * 20 -
(Math.abs(q.y - a.y) + rand(a.id + q.id) * 20),
Math.abs(p.y - a.y) + rand(a.id + p.id) * 18 -
(Math.abs(q.y - a.y) + rand(a.id + q.id) * 18),
);
for (let k = 0; k < Math.min(fan, ranked.length); k++) {
const b = ranked[k];
const weight = 0.55 + rand(synSeed + 3) * 0.45;
const active =
(a.active || b.active) && rand(synSeed + 7) > 0.45;
const weight = 0.5 + rand(synSeed + 3) * 0.55;
synapses.push({
d: synapsePath(a, b, synSeed),
from: a.id,
to: b.id,
active,
weight,
hub: a.hub || b.hub,
});
synSeed += 1;
}
}
}
// A few skip connections (deeper net feel)
if (layers >= 4) {
const from = byLayer[0];
const to = byLayer[layers - 1];
for (let i = 0; i < Math.min(2, from.length, to.length); i++) {
const a = from[i];
const b = to[Math.min(to.length - 1, i + 1)];
synapses.push({
d: synapsePath(a, b, 900 + i),
from: a.id,
to: b.id,
active: true,
weight: 0.4,
});
for (let L = 0; L < layers - 2; L++) {
const from = byLayer[L];
const to = byLayer[L + 2];
const skips = Math.min(3, from.length, to.length);
for (let i = 0; i < skips; i++) {
const a = from[Math.floor(rand(700 + L * 10 + i) * from.length)];
const b = to[Math.floor(rand(800 + L * 10 + i) * to.length)];
synapses.push({
d: synapsePath(a, b, 900 + L * 20 + i),
weight: 0.35 + rand(910 + i) * 0.25,
hub: true,
});
}
}
}
@@ -150,9 +144,8 @@ function buildNetwork(density: "sparse" | "normal"): {
}
/**
* Decorative neural-network field — layered nodes + curved synapses.
* Evokes AI / learning systems without looking like a flowchart.
* Desktop + motion only (SVG density is heavy on phones).
* Decorative neural-network field — palette-aware hubs + synapses.
* Dark tone: light nodes on navy. Light tone: primary/accent ink on soft gray.
*/
export function MetamorphField({
className,
@@ -175,27 +168,24 @@ export function MetamorphField({
if (!enabled) return null;
const edge =
tone === "dark"
? "color-mix(in oklab, white 42%, transparent)"
: "color-mix(in oklab, var(--foreground) 36%, transparent)";
const edgeActive =
tone === "dark"
? "color-mix(in oklab, var(--accent) 70%, white)"
: "var(--primary)";
const soma =
tone === "dark"
? "color-mix(in oklab, white 82%, transparent)"
: "var(--foreground)";
const accent = tone === "dark" ? "var(--accent)" : "var(--primary)";
const core =
tone === "dark" ? "var(--chart-3)" : "var(--background)";
const isDark = tone === "dark";
// Dark navy: faint light ink. Soft surfaces: faint primary ink.
const edgeQuiet = isDark
? "color-mix(in oklab, var(--primary-foreground) 18%, transparent)"
: "color-mix(in oklab, var(--primary) 14%, transparent)";
const edgeHub = isDark
? "color-mix(in oklab, var(--primary-foreground) 32%, transparent)"
: "color-mix(in oklab, var(--accent) 28%, transparent)";
const node = isDark
? "color-mix(in oklab, var(--primary-foreground) 70%, transparent)"
: "color-mix(in oklab, var(--primary) 65%, transparent)";
return (
<div
className={cn(
"pointer-events-none absolute inset-0 z-[1] overflow-hidden metamorph-field",
tone === "light" ? "opacity-[0.18]" : "opacity-[0.52]",
isDark ? "opacity-[0.32]" : "opacity-[0.18]",
className,
)}
aria-hidden
@@ -208,53 +198,25 @@ export function MetamorphField({
focusable="false"
>
{synapses.map((s, i) => (
<g key={`syn-${i}`}>
<path
d={s.d}
stroke={s.active ? edgeActive : edge}
strokeWidth={s.active ? 1.35 * s.weight : 1.05 * s.weight}
strokeLinecap="round"
opacity={s.active ? 0.55 : 0.28}
/>
{s.active ? (
<path
className="metamorph-pulse"
d={s.d}
stroke={accent}
strokeWidth={2}
strokeLinecap="round"
strokeDasharray="6 120"
opacity="0.85"
style={{ animationDelay: `${(i % 7) * 0.35}s` }}
/>
) : null}
</g>
<path
key={`syn-${i}`}
d={s.d}
stroke={s.hub ? edgeHub : edgeQuiet}
strokeWidth={s.hub ? 0.85 * s.weight : 0.55 * s.weight}
strokeLinecap="round"
opacity={s.hub ? 0.35 : 0.2}
/>
))}
{nodes.map((n) => (
<g key={`n-${n.id}`}>
<circle
cx={n.x}
cy={n.y}
r={n.r + 10}
fill={n.active ? accent : soma}
opacity={n.active ? 0.16 : 0.08}
/>
<circle
cx={n.x}
cy={n.y}
r={n.r}
fill={n.active ? accent : soma}
opacity={n.active ? 0.95 : 0.75}
/>
<circle
cx={n.x}
cy={n.y}
r={n.r * 0.38}
fill={core}
opacity="0.5"
/>
</g>
<circle
key={`n-${n.id}`}
cx={n.x}
cy={n.y}
r={n.r}
fill={node}
opacity={n.hub ? 0.55 : 0.35}
/>
))}
</svg>
</div>
+2 -2
View File
@@ -9,8 +9,8 @@ const tones = {
default: "bg-background text-foreground",
subtle: "bg-gradient-to-b from-background to-muted/40 text-foreground",
muted: "bg-muted text-foreground",
dark: "bg-chart-3 text-background",
accent: "bg-primary text-primary-foreground",
dark: "bg-primary text-primary-foreground",
accent: "bg-accent text-accent-foreground",
};
export function Section({
+3 -3
View File
@@ -14,9 +14,9 @@ export function TextLink({
<Link
className={cn(
"font-medium underline-offset-4 transition-colors hover:underline",
tone === "default" && "text-chart-2 hover:text-primary",
tone === "inverse" && "text-background/90 hover:text-background",
tone === "accent" && "text-primary hover:text-foreground",
tone === "default" && "text-primary hover:text-accent",
tone === "inverse" && "text-primary-foreground/90 hover:text-primary-foreground",
tone === "accent" && "text-accent hover:text-primary",
className,
)}
{...props}
+19 -18
View File
@@ -23,10 +23,10 @@ export function ProgramCard({
<Card className={cn("group h-full gap-2 py-6 hover:shadow-md hover:ring-primary/25", className)}>
<CardHeader className="gap-1">
{program.tagline ? (
<p className="text-xs font-bold text-primary">{program.tagline}</p>
<p className="text-xs font-bold text-accent">{program.tagline}</p>
) : null}
<CardTitle className="text-lg">
<Link href={program.href} className="hover:text-primary">
<Link href={program.href} className="hover:text-accent">
{program.title}
</Link>
</CardTitle>
@@ -35,7 +35,7 @@ export function ProgramCard({
<CardDescription className="leading-relaxed">
{program.blurb}
</CardDescription>
<span className="mt-5 inline-flex items-center gap-1 text-xs font-bold text-primary">
<span className="mt-5 inline-flex items-center gap-1 text-xs font-bold text-accent">
جزئیات برنامه
<ArrowUpLeft className="size-3.5 transition-transform group-hover:-translate-x-0.5 group-hover:-translate-y-0.5" />
</span>
@@ -68,12 +68,12 @@ export function ArticleCard({
<Image src={imageUrl} alt={title} fill placeholder="blur" blurDataURL={blurDataURL} className="object-cover transition-transform duration-500 group-hover:scale-[1.025]" sizes="(max-width:640px) 100vw, 304px" />
</Link>
<div className="flex min-w-0 flex-col justify-center pt-5 sm:pt-0">
<p className="text-xs font-bold text-primary">{category}</p>
<h2 className="mt-2 text-xl font-bold leading-relaxed tracking-tight sm:text-2xl">
<Link href={href} className="transition-colors hover:text-primary">{title}</Link>
<p className="text-xs font-bold text-accent">{category}</p>
<h2 className="mt-2 text-xl font-bold leading-[1.45] sm:text-2xl">
<Link href={href} className="transition-colors hover:text-accent">{title}</Link>
</h2>
<p className="mt-3 max-w-2xl text-sm leading-7 text-muted-foreground sm:text-base">{excerpt}</p>
<Link href={href} className="mt-4 inline-flex w-fit items-center gap-2 text-sm font-semibold text-foreground/70 transition-colors hover:text-primary">
<p className="mt-3 max-w-2xl text-sm leading-7 text-muted-foreground sm:text-base sm:leading-7">{excerpt}</p>
<Link href={href} className="mt-4 inline-flex w-fit items-center gap-2 text-sm font-semibold text-foreground/70 transition-colors hover:text-accent">
مطالعه مقاله <ArrowUpLeft className="size-4 transition-transform group-hover:-translate-x-0.5 group-hover:-translate-y-0.5" />
</Link>
</div>
@@ -126,11 +126,11 @@ export function ArticleCard({
<h3
className={cn(
featured
? "mt-2 text-2xl font-bold tracking-tight sm:text-3xl"
: "mt-1.5 text-lg font-semibold",
? "mt-2 text-2xl font-bold leading-[1.4] sm:text-3xl"
: "mt-1.5 text-lg font-semibold leading-[1.5]",
)}
>
<Link href={href} className="hover:text-primary">
<Link href={href} className="hover:text-accent">
{title}
</Link>
</h3>
@@ -176,7 +176,7 @@ export function EventCard({
</div>
{end ? (
<>
<span className="mt-7 text-xs font-medium text-primary">تا</span>
<span className="mt-7 text-xs font-medium text-accent">تا</span>
<div>
<p className="text-xs font-semibold text-muted-foreground">
{endMonth}
@@ -188,7 +188,7 @@ export function EventCard({
</div>
<div>
<h3 className="text-lg font-semibold">
<Link href={href} className="hover:text-primary">
<Link href={href} className="hover:text-accent">
{title}
</Link>
</h3>
@@ -233,7 +233,7 @@ export function IntersectionCard({
return (
<Link
href={href}
className="group relative block min-h-[16rem] overflow-hidden rounded-2xl bg-chart-3 shadow-sm sm:min-h-[18rem]"
className="group relative block min-h-[16rem] overflow-hidden rounded-2xl bg-primary shadow-sm sm:min-h-[18rem]"
>
<div className="absolute inset-0 overflow-hidden">
<Image
@@ -246,10 +246,11 @@ export function IntersectionCard({
sizes="(max-width:768px) 100vw, 25vw"
/>
</div>
<div className="absolute inset-0 bg-gradient-to-t from-chart-3 via-chart-3/50 to-transparent" />
<div className="absolute inset-x-0 bottom-0 p-6 text-background">
<div className="flex items-center justify-between gap-3"><p className="text-sm font-bold text-accent">{title}</p><ArrowUpLeft className="size-4 transition-transform group-hover:-translate-x-1 group-hover:-translate-y-1" /></div>
<p className="mt-2 text-sm font-semibold leading-relaxed text-background/80">{description}</p>
<div className="absolute inset-0 bg-gradient-to-t from-primary via-primary/50 to-transparent" />
<div className="absolute inset-0 border-s-4 border-accent" aria-hidden />
<div className="absolute inset-x-0 bottom-0 p-6 text-primary-foreground">
<div className="flex items-center justify-between gap-3"><p className="text-sm font-bold text-secondary">{title}</p><ArrowUpLeft className="size-4 transition-transform group-hover:-translate-x-1 group-hover:-translate-y-1" /></div>
<p className="mt-2 text-sm font-semibold leading-relaxed text-primary-foreground/80">{description}</p>
</div>
</Link>
);
+16 -4
View File
@@ -19,13 +19,19 @@ export function ContactDetails() {
<MapPin className="size-4" aria-hidden />
</span>
<div className="min-w-0">
<p className="font-semibold text-foreground">آدرس</p>
<p className="font-semibold text-foreground">نشانی</p>
<p className="text-muted-foreground">{siteAddress.line}</p>
<p className="mt-1 text-muted-foreground">
کد پستی{" "}
<span dir="ltr" className="font-medium text-foreground">
{siteAddress.postalCode}
</span>
</p>
<a
href={siteAddress.mapUrl}
target="_blank"
rel="noreferrer"
className="mt-1 inline-block font-medium text-primary underline-offset-4 hover:underline"
className="mt-1 inline-block font-medium text-accent underline-offset-4 hover:underline"
>
مشاهده روی نقشه
</a>
@@ -38,7 +44,13 @@ export function ContactDetails() {
<div className="min-w-0">
<p className="font-semibold text-foreground">تلفن</p>
<p className="text-muted-foreground">
<span dir="ltr">{siteAddress.phone}</span>
<a
href={`tel:${siteAddress.phoneTel}`}
dir="ltr"
className="transition-colors hover:text-foreground"
>
{siteAddress.phone}
</a>
</p>
</div>
</li>
@@ -47,7 +59,7 @@ export function ContactDetails() {
<Mail className="size-4" aria-hidden />
</span>
<div className="min-w-0">
<p className="font-semibold text-foreground">ایمیل</p>
<p className="font-semibold text-foreground">پست الکترونیک</p>
<TextLink href={`mailto:${siteAddress.email}`} tone="accent">
{siteAddress.email}
</TextLink>
@@ -11,13 +11,13 @@ export function CourseCardBanner({
const hasBanner = Boolean(bannerUrl?.trim());
return (
<div className="pointer-events-none relative aspect-[16/10] overflow-hidden bg-primary-foreground/10">
<div className="pointer-events-none relative aspect-video overflow-hidden bg-primary-foreground/10">
{hasBanner ? (
<Image
src={bannerUrl!}
alt=""
fill
className="object-cover transition-transform duration-300 group-hover:scale-[1.03]"
className="object-contain transition-transform duration-300 group-hover:scale-[1.03]"
sizes="(max-width:768px) 100vw, 33vw"
/>
) : (
@@ -0,0 +1,42 @@
import Image from "next/image";
import { cn } from "@/lib/utils";
/**
* Full course media (banner/poster or brochure) without text overlay.
* Uses intrinsic layout so the whole image stays visible (object-contain / natural height).
*/
export function CourseMediaFigure({
src,
alt,
/** Approximate intrinsic ratio hint for CLS; display stays fluid via h-auto. */
width,
height,
priority = false,
className,
}: {
src: string;
alt: string;
width: number;
height: number;
priority?: boolean;
className?: string;
}) {
return (
<figure
className={cn(
"overflow-hidden rounded-2xl bg-muted ring-1 ring-foreground/10",
className,
)}
>
<Image
src={src}
alt={alt}
width={width}
height={height}
className="h-auto w-full"
sizes="(max-width:1024px) 100vw, 60vw"
priority={priority}
/>
</figure>
);
}
+1 -1
View File
@@ -32,7 +32,7 @@ export function DetailList({
<dd
className={cn(
"text-end font-semibold",
item.emphasis ? "text-primary" : "text-foreground",
item.emphasis ? "text-accent" : "text-foreground",
)}
>
{item.value}
@@ -34,7 +34,7 @@ export function FacultyMemberCard({ member }: { member: FacultyMember }) {
/>
) : (
<div
className="flex h-full w-full items-center justify-center bg-gradient-to-br from-chart-3 to-primary/80 text-4xl font-semibold text-primary-foreground"
className="flex h-full w-full items-center justify-center bg-gradient-to-br from-primary to-accent text-4xl font-semibold text-primary-foreground"
aria-hidden
>
{facultyInitials(member.name)}
+25 -20
View File
@@ -1,11 +1,12 @@
import Link from "next/link";
import Image from "next/image";
import { ArrowLeft, GraduationCap } from "lucide-react";
import { ArrowLeft } from "lucide-react";
import { Container } from "@/components/atoms/Container";
import { Heading } from "@/components/atoms/Heading";
import { MetamorphField } from "@/components/atoms/MetamorphField";
import { buttonVariants } from "@/components/ui/button";
import { cn } from "@/lib/utils";
import { homeContent } from "@/lib/site-config";
export function HeroFeatured({
title,
@@ -17,8 +18,10 @@ export function HeroFeatured({
imageUrl?: string;
eyebrow?: string;
}) {
const { hero } = homeContent;
return (
<header className="home-hero relative isolate overflow-hidden bg-chart-3 text-background">
<header className="home-hero relative isolate overflow-hidden bg-primary text-primary-foreground">
<div className="pointer-events-none absolute inset-0 z-[1]" aria-hidden>
<Image
src="/brand/amirkabir-arches.png"
@@ -29,9 +32,9 @@ export function HeroFeatured({
sizes="100vw"
/>
{/* Unified navy wash — keeps text clear and softens the art */}
<div className="absolute inset-0 bg-chart-3/45" />
<div className="absolute inset-0 bg-gradient-to-l from-chart-3/90 via-chart-3/40 to-chart-3/25" />
<div className="absolute inset-x-0 bottom-0 h-24 bg-gradient-to-t from-chart-3 to-transparent" />
<div className="absolute inset-0 bg-primary/45" />
<div className="absolute inset-0 bg-gradient-to-l from-primary/90 via-primary/40 to-accent/25" />
<div className="absolute inset-x-0 bottom-0 h-24 bg-gradient-to-t from-primary to-transparent" />
<MetamorphField
tone="dark"
density="sparse"
@@ -41,25 +44,27 @@ export function HeroFeatured({
<Container className="relative z-[2] flex min-h-[34rem] min-w-0 items-center py-16 sm:min-h-[36rem] sm:py-20">
<div className="home-hero__copy w-full min-w-0 max-w-2xl text-start lg:max-w-3xl">
<div className="inline-flex max-w-full items-start gap-2 text-sm font-medium text-background/60">
<GraduationCap className="mt-0.5 size-4 shrink-0" />
<span className="min-w-0 leading-7 text-pretty">
مرکز آموزش‌های آزاد دانشکده مدیریت، علم و فناوری دانشگاه{"\u00A0"}صنعتی{"\u00A0"}امیرکبیر
</span>
<div className="max-w-full space-y-1 text-sm font-medium text-primary-foreground/60">
<p className="leading-7 text-pretty">{hero.university}</p>
<p className="leading-7 text-pretty text-primary-foreground/75">
{hero.center}
</p>
</div>
<Heading as="h1" level={1} className="mt-6 max-w-4xl">
برای تصمیم‌هایی که{" "}
<span className="whitespace-nowrap">صنعت را پیش می‌برند</span>
{hero.title}
</Heading>
<p className="mt-6 max-w-2xl border-t border-accent/60 pt-5 text-base leading-8 text-pretty text-background/65 sm:text-lg sm:leading-8">
دانش دانشگاه صنعتی امیرکبیر، پشتوانه رهبری نوآور در عصر داده و هوش{"\u00A0"}مصنوعی.
<p className="mt-6 max-w-2xl border-t border-secondary/50 pt-5 text-base leading-7 text-pretty text-primary-foreground/65 sm:text-lg sm:leading-8">
{hero.description}
</p>
<div className="mt-9 flex flex-wrap gap-3">
<Link
href="/professional"
className={cn(buttonVariants({ size: "lg" }), "font-bold")}
className={cn(
buttonVariants({ size: "lg" }),
"border-transparent bg-secondary font-bold text-secondary-foreground hover:bg-secondary/90",
)}
>
مشاهده دوره‌ها <ArrowLeft className="size-4" />
{hero.primaryCta} <ArrowLeft className="size-4" />
</Link>
<Link
href="/about"
@@ -68,16 +73,16 @@ export function HeroFeatured({
"font-bold",
)}
>
درباره مرکز
{hero.secondaryCta}
</Link>
</div>
{title && href && eyebrow ? (
<div className="mt-12 border-t border-background/10 pt-6">
<div className="mt-12 border-t border-primary-foreground/10 pt-6">
<Link
href={href}
className="group inline-flex max-w-full items-center gap-3 text-sm text-background/55 transition-colors hover:text-background"
className="group inline-flex max-w-full items-center gap-3 text-sm text-primary-foreground/55 transition-colors hover:text-primary-foreground"
>
<span className="shrink-0 font-semibold text-background/80">
<span className="shrink-0 font-semibold text-primary-foreground/80">
{eyebrow}
</span>
<span className="min-w-0 truncate">{title}</span>
+8 -8
View File
@@ -27,14 +27,14 @@ export function PageHero({
return (
<header
className={cn(
"page-hero relative isolate flex items-center overflow-hidden bg-chart-3 text-background",
"page-hero relative isolate flex items-center overflow-hidden bg-primary text-primary-foreground",
size === "lg"
? "min-h-[34rem] py-16 sm:min-h-[38rem] sm:py-20"
: "py-16 sm:py-24",
)}
>
<Image
src={imageUrl ?? "/brand/campus-collaboration-v1.png"}
src={imageUrl ?? "/brand/neural-learning-wave.png"}
alt=""
fill
priority
@@ -48,8 +48,8 @@ export function PageHero({
className={cn(
"absolute inset-0",
hasPhoto
? "bg-gradient-to-l from-chart-3 via-chart-3/85 to-chart-3/55"
: "bg-gradient-to-l from-chart-3 via-chart-3/90 to-chart-3/65",
? "bg-gradient-to-l from-primary via-primary/85 to-accent/55"
: "bg-gradient-to-l from-primary via-primary/90 to-primary/65",
)}
/>
{showField ? (
@@ -59,19 +59,19 @@ export function PageHero({
className="end-0 start-auto w-[min(75vw,42rem)] opacity-40"
/>
) : null}
<div className="absolute end-0 top-0 h-px w-1/3 bg-gradient-to-l from-accent to-transparent" />
<div className="absolute end-0 top-0 h-px w-1/3 bg-gradient-to-l from-secondary to-transparent" />
<Container className="relative z-[2] min-w-0">
<div className="page-hero__content w-full min-w-0 max-w-4xl text-start">
{eyebrow ? (
<p className="mb-4 inline-flex rounded-full border border-background/15 bg-background/5 px-3 py-1.5 text-xs font-semibold text-accent backdrop-blur-sm">
<p className="mb-4 inline-flex rounded-full border border-primary-foreground/15 bg-primary-foreground/5 px-3 py-1.5 text-xs font-semibold text-secondary backdrop-blur-sm">
{eyebrow}
</p>
) : null}
<Heading as="h1" level={1} className="max-w-4xl text-background">
<Heading as="h1" level={1} className="max-w-4xl text-primary-foreground">
{title}
</Heading>
{intro ? (
<p className="mt-5 max-w-2xl border-t border-accent/60 pt-5 text-base leading-8 text-pretty text-background/70 sm:text-lg sm:leading-8">
<p className="mt-5 max-w-2xl border-t border-secondary/50 pt-5 text-base leading-7 text-pretty text-primary-foreground/70 sm:text-lg sm:leading-8">
{intro}
</p>
) : null}
+4 -4
View File
@@ -33,8 +33,8 @@ export function SectionHeader({
{eyebrow ? (
<p
className={cn(
"text-sm font-bold sm:text-base",
inverse ? "text-accent" : "text-primary",
"text-xs font-semibold sm:text-sm",
inverse ? "text-secondary" : "text-accent",
)}
>
{eyebrow}
@@ -45,7 +45,7 @@ export function SectionHeader({
level={2}
className={cn(
"break-words",
eyebrow && "mt-3",
eyebrow && "mt-2.5 sm:mt-3",
inverse && "text-current",
)}
>
@@ -54,7 +54,7 @@ export function SectionHeader({
{description ? (
<p
className={cn(
"mt-4 text-base leading-8 sm:text-lg sm:leading-8",
"mt-3 max-w-2xl text-base leading-7 sm:mt-4 sm:text-lg sm:leading-8",
inverse ? "opacity-75" : "text-muted-foreground",
)}
>
+3 -3
View File
@@ -17,8 +17,8 @@ export function StatGrid({
<div key={stat.id} className="min-w-0 text-center">
<p
className={cn(
"text-4xl font-extrabold tabular-nums sm:text-5xl",
inverse ? "text-accent" : "text-primary",
"text-4xl font-bold tabular-nums sm:text-5xl",
inverse ? "text-secondary" : "text-accent",
)}
>
<AnimatedMetric value={stat.value} />
@@ -26,7 +26,7 @@ export function StatGrid({
<p
className={cn(
"mt-2 text-sm",
inverse ? "text-background/70" : "text-muted-foreground",
inverse ? "text-primary-foreground/70" : "text-muted-foreground",
)}
>
{stat.label}
@@ -28,18 +28,19 @@ export function AcademicsOverlay({
return (
<div
className="fixed inset-0 z-[70] overflow-y-auto bg-card text-foreground"
className="fixed inset-0 z-[70] overflow-y-auto bg-background text-foreground"
role="dialog"
aria-modal="true"
aria-label={title}
>
<div className="h-1 bg-gradient-to-l from-primary via-accent to-primary" aria-hidden />
<Container className="py-8">
<div className="mb-8 flex items-center justify-between gap-4">
<Button
type="button"
variant="ghost"
onClick={onClose}
className="px-0 font-semibold hover:bg-transparent hover:text-primary"
className="px-0 font-semibold hover:bg-transparent hover:text-accent"
>
بازگشت به منو
</Button>
@@ -54,7 +55,7 @@ export function AcademicsOverlay({
</Button>
</div>
<h2 className="mb-10 max-w-3xl text-start text-3xl font-bold tracking-tight break-words sm:text-4xl">
<h2 className="mb-10 max-w-3xl text-start text-3xl font-bold leading-[1.35] break-words sm:text-4xl">
{title}
</h2>
@@ -66,7 +67,7 @@ export function AcademicsOverlay({
onClick={onClose}
className="group block"
>
<span className="text-base font-extrabold leading-snug group-hover:text-primary">
<span className="text-base font-bold leading-snug group-hover:text-accent">
{program.title}
</span>
<p className="mt-2 text-sm leading-relaxed text-muted-foreground">
@@ -77,7 +78,7 @@ export function AcademicsOverlay({
))}
</ul>
<h3 className="mt-14 mb-6 text-lg font-extrabold text-primary">
<h3 className="mt-14 mb-6 text-lg font-bold text-accent">
{executiveLabel}
</h3>
<ul className="grid gap-x-10 gap-y-8 sm:grid-cols-2 lg:grid-cols-3">
@@ -88,7 +89,7 @@ export function AcademicsOverlay({
onClick={onClose}
className="group block"
>
<span className="text-base font-extrabold leading-snug group-hover:text-primary">
<span className="text-base font-bold leading-snug group-hover:text-accent">
{program.title}
</span>
<p className="mt-2 text-sm leading-relaxed text-muted-foreground">
+4 -4
View File
@@ -47,13 +47,13 @@ export function CampaignBanners({ banners }: { banners: CampaignBanner[] }) {
const banner = visible[0];
return (
<div className="bg-chart-3 text-background">
<div className="bg-primary text-primary-foreground">
<Container className="flex min-w-0 items-center justify-between gap-3 py-3 sm:gap-4">
<p className="min-w-0 flex-1 text-sm leading-relaxed break-words">
<span className="text-background/90">{banner.text}</span>{" "}
<span className="text-primary-foreground/90">{banner.text}</span>{" "}
<Link
href={banner.href}
className="font-bold text-background underline-offset-4 hover:underline"
className="font-bold text-secondary underline-offset-4 hover:underline"
>
{banner.cta}
</Link>
@@ -63,7 +63,7 @@ export function CampaignBanners({ banners }: { banners: CampaignBanner[] }) {
variant="ghost"
size="icon"
aria-label="بستن بنر"
className="shrink-0 text-background/70 hover:bg-background/10 hover:text-background"
className="shrink-0 text-primary-foreground/70 hover:bg-primary-foreground/10 hover:text-primary-foreground"
onClick={() => dismiss(banner)}
>
<X className="size-4" />
+2 -2
View File
@@ -22,12 +22,12 @@ export function ErrorState({
return (
<main id="main-content" className="bg-background">
<Container className="flex min-h-[60vh] flex-col items-start justify-center py-20">
<p className="text-sm font-bold text-primary sm:text-base">خطا</p>
<p className="text-sm font-bold text-accent sm:text-base">خطا</p>
<Heading as="h1" level={2} className="mt-3">
بارگذاری صفحه ناموفق بود
</Heading>
<p className="mt-4 max-w-md text-base leading-8 text-muted-foreground">
لطفاً دوباره تلاش کنید. اگر مشکل ادامه داشت، چند لحظه بعد بازگردید.
لطفا دوباره تلاش کنید. اگر مشکل ادامه داشت، چند لحظه بعد بازگردید.
</p>
<div className="mt-8 flex flex-wrap gap-3">
<Button type="button" size="lg" className="font-bold" onClick={reset}>
+1 -1
View File
@@ -33,7 +33,7 @@ export function ProgramCarousel({
<div className="min-w-0">
<div className="mb-5 flex min-w-0 items-end justify-between gap-4">
{!hideTitle && title ? (
<h2 className="min-w-0 text-2xl font-bold tracking-tight break-words sm:text-3xl">
<h2 className="min-w-0 text-2xl font-bold leading-[1.4] break-words sm:text-3xl">
{title}
</h2>
) : (
+4 -3
View File
@@ -79,8 +79,9 @@ export function SearchOverlay({
aria-label={label}
>
<div className="border-b border-border bg-card">
<div className="h-1 bg-gradient-to-l from-primary via-accent to-primary" aria-hidden />
<div className="mx-auto flex max-w-4xl items-center justify-between px-4 py-5 sm:px-6">
<p className="text-sm font-semibold text-muted-foreground">{label}</p>
<p className="text-sm font-semibold text-primary">{label}</p>
<Button
variant="ghost"
size="icon"
@@ -107,7 +108,7 @@ export function SearchOverlay({
)}
>
<ResultGroup
title="برنامه‌ها"
title="برنامه ها"
items={results.programs.map((p) => ({
href: p.href,
title: p.title,
@@ -116,7 +117,7 @@ export function SearchOverlay({
onNavigate={() => setOpen(false)}
/>
<ResultGroup
title="دوره‌ها"
title="دوره ها"
items={results.courses.map((c) => ({
href: c.registrationUrl,
title: c.title,
+19 -15
View File
@@ -4,7 +4,7 @@ import { Container } from "@/components/atoms/Container";
import { Separator } from "@/components/ui/separator";
import {
siteAddress,
siteUniversity,
siteFaculty,
siteShortName,
} from "@/lib/site-config";
@@ -19,22 +19,26 @@ export function SiteFooter({
variant?: "home" | "professional";
}) {
return (
<footer className="border-t border-border bg-chart-3 pb-[env(safe-area-inset-bottom)] text-background">
<footer className="border-t border-border bg-primary pb-[env(safe-area-inset-bottom)] text-primary-foreground">
<Container className="py-12 sm:py-14">
<div className="grid gap-10 sm:grid-cols-2 lg:grid-cols-3 lg:gap-12">
<div className="max-w-sm space-y-4">
<BrandLogo
title={siteShortName}
subtitle={siteUniversity}
subtitle={siteFaculty}
onDark
/>
<p className="text-sm leading-7 text-background/65">
<p className="text-sm leading-7 text-primary-foreground/65">
{siteAddress.line}
</p>
<p className="text-sm text-primary-foreground/55">
کد پستی{" "}
<span dir="ltr">{siteAddress.postalCode}</span>
</p>
</div>
<nav aria-label="لینک‌های پاورقی" className="space-y-4">
<p className="text-xs font-semibold tracking-wide text-background/55">
<nav aria-label="لینک های پاورقی" className="space-y-4">
<p className="text-xs font-semibold tracking-wide text-primary-foreground/55">
{linksTitle}
</p>
<ul className="flex flex-col gap-2.5 text-sm font-medium">
@@ -42,7 +46,7 @@ export function SiteFooter({
<li key={link.href}>
<Link
href={link.href}
className="text-background/80 transition-colors hover:text-background"
className="text-primary-foreground/80 transition-colors hover:text-primary-foreground"
>
{link.label}
</Link>
@@ -52,15 +56,15 @@ export function SiteFooter({
</nav>
<div className="space-y-4 sm:max-w-xs lg:justify-self-end lg:text-end">
<p className="text-xs font-semibold tracking-wide text-background/55">
<p className="text-xs font-semibold tracking-wide text-primary-foreground/55">
تماس
</p>
<div className="space-y-1.5 text-sm text-background/75">
<div className="space-y-1.5 text-sm text-primary-foreground/75">
<p>
<a
href={`tel:${siteAddress.phone}`}
href={`tel:${siteAddress.phoneTel}`}
dir="ltr"
className="transition-colors hover:text-background"
className="transition-colors hover:text-primary-foreground"
>
{siteAddress.phone}
</a>
@@ -69,7 +73,7 @@ export function SiteFooter({
<a
href={`mailto:${siteAddress.email}`}
dir="ltr"
className="transition-colors hover:text-background"
className="transition-colors hover:text-primary-foreground"
>
{siteAddress.email}
</a>
@@ -79,7 +83,7 @@ export function SiteFooter({
href={siteAddress.mapUrl}
target="_blank"
rel="noopener noreferrer"
className="font-medium text-background/90 transition-colors hover:text-background"
className="font-medium text-primary-foreground/90 transition-colors hover:text-primary-foreground"
>
موقعیت روی نقشه
</a>
@@ -88,9 +92,9 @@ export function SiteFooter({
</div>
</div>
<Separator className="my-8 bg-background/10" />
<Separator className="my-8 bg-primary-foreground/10" />
<p className="text-xs text-background/45">{copyright}</p>
<p className="text-xs text-primary-foreground/45">{copyright}</p>
</Container>
</footer>
);
+22 -19
View File
@@ -55,8 +55,8 @@ function NavDropdown({
className={cn(
"inline-flex cursor-pointer items-center gap-1 rounded-lg px-3 py-2 text-sm font-semibold transition-colors outline-none",
isDark
? "text-background/80 hover:text-background"
: "text-foreground/75 hover:bg-muted hover:text-primary",
? "text-primary-foreground/80 hover:text-primary-foreground"
: "text-foreground/75 hover:bg-muted hover:text-accent",
)}
>
{item.label}
@@ -114,19 +114,20 @@ export function SiteHeader({
<>
<header
className={cn(
"site-header sticky top-0 z-50 pt-[env(safe-area-inset-top)] shadow-sm backdrop-blur-sm md:backdrop-blur-xl",
"site-header sticky top-0 z-50 overflow-hidden pt-[env(safe-area-inset-top)] shadow-sm backdrop-blur-sm md:backdrop-blur-xl",
isDark
? "border-b border-background/10 bg-chart-3/95 text-background"
? "border-b border-primary-foreground/10 bg-primary/95 text-primary-foreground"
: "border-b border-border bg-card/95 text-foreground",
)}
>
<Container className="flex h-[4.5rem] min-w-0 items-center justify-start gap-3 sm:h-20 sm:gap-6" dir="rtl">
<Container className="flex h-[4.5rem] min-w-0 items-center justify-start gap-3 overflow-hidden sm:h-20 sm:gap-6" dir="rtl">
<BrandLogo
href={brandHref}
title={brandTitle}
subtitle={brandSubtitle}
onDark={isDark}
className="max-w-[min(100%,14rem)] sm:max-w-[min(100%,20rem)]"
horizontal
className="h-full shrink-0"
/>
<nav
@@ -152,8 +153,8 @@ export function SiteHeader({
className={cn(
"rounded-lg px-3 py-2 text-sm font-semibold transition-colors",
isDark
? "text-background/80 hover:text-background"
: "text-foreground/75 hover:bg-muted hover:text-primary",
? "text-primary-foreground/80 hover:text-primary-foreground"
: "text-foreground/75 hover:bg-muted hover:text-accent",
)}
/>
);
@@ -163,7 +164,7 @@ export function SiteHeader({
<div
className={cn(
"ms-auto flex shrink-0 items-center gap-2 xl:ms-0",
isDark && "text-background",
isDark && "text-primary-foreground",
)}
>
<Link
@@ -171,8 +172,8 @@ export function SiteHeader({
className={cn(
"hidden rounded-lg px-3 py-2 text-sm font-semibold transition-colors sm:inline-flex",
isDark
? "text-background/80 hover:text-background"
: "text-foreground/75 hover:bg-muted hover:text-primary",
? "text-primary-foreground/80 hover:text-primary-foreground"
: "bg-secondary text-foreground hover:bg-secondary/80 hover:text-accent",
)}
>
{contactLabel}
@@ -202,7 +203,7 @@ export function SiteHeader({
{mobileOpen ? (
<div
className="fixed inset-0 z-[60] flex flex-col bg-chart-3 text-background pt-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)] xl:hidden"
className="fixed inset-0 z-[60] flex flex-col bg-primary text-primary-foreground pt-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)] xl:hidden"
role="dialog"
aria-modal="true"
aria-label="منوی اصلی"
@@ -213,35 +214,37 @@ export function SiteHeader({
title={brandTitle}
subtitle={brandSubtitle}
onDark
horizontal
compact
className="shrink-0"
/>
<Button
variant="ghost"
size="icon"
className="text-background hover:bg-background/10"
className="text-primary-foreground hover:bg-primary-foreground/10"
aria-label="بستن منو"
onClick={() => setMobileOpen(false)}
>
<X className="size-5" />
</Button>
</Container>
<Separator className="bg-background/10" />
<Separator className="bg-primary-foreground/10" />
<Container className="flex-1 overflow-y-auto py-6">
<ul className="space-y-1 text-start">
{items.map((item) => (
<li key={`nav:${item.href}:${item.label}`}>
{item.children && item.children.length > 0 ? (
<div className="py-2">
<p className="text-sm font-semibold text-background/55">
<p className="text-sm font-semibold text-primary-foreground/55">
{item.label}
</p>
<ul className="mt-1 space-y-0.5 border-s border-background/20 ps-3">
<ul className="mt-1 space-y-0.5 border-s border-primary-foreground/20 ps-3">
{item.children.map((child) => (
<li key={`nav:${child.href}:${child.label}`}>
<NavLink
item={child}
isDark
className="block py-2.5 text-base font-bold transition-colors hover:text-background/70"
className="block py-2.5 text-base font-bold transition-colors hover:text-primary-foreground/70"
onClick={() => setMobileOpen(false)}
/>
</li>
@@ -252,7 +255,7 @@ export function SiteHeader({
<NavLink
item={item}
isDark
className="block py-3.5 text-lg font-bold transition-colors hover:text-background/70"
className="block py-3.5 text-lg font-bold transition-colors hover:text-primary-foreground/70"
onClick={() => setMobileOpen(false)}
/>
)}
@@ -261,7 +264,7 @@ export function SiteHeader({
<li>
<Link
href="/contact"
className="block py-3.5 text-lg font-bold transition-colors hover:text-background/70"
className="block py-3.5 text-lg font-bold transition-colors hover:text-primary-foreground/70"
onClick={() => setMobileOpen(false)}
>
{contactLabel}
+19 -19
View File
@@ -38,49 +38,49 @@ import { isAdminEntityEnabled } from "@/lib/admin/disabled-entities";
const NAV_GROUPS = [
{
label: "نمای کلی",
items: [{ href: "/admin", label: "داشبورد", icon: LayoutDashboard, exact: true }],
items: [{ href: "/mstcontroller", label: "داشبورد", icon: LayoutDashboard, exact: true }],
},
{
label: "محتوا",
items: [
{ href: "/admin/courses", label: "دوره‌ها", icon: BookOpen, entity: "courses" },
{ href: "/mstcontroller/courses", label: "دوره ها", icon: BookOpen, entity: "courses" },
{
href: "/admin/course-categories",
label: "دسته‌بندی دوره‌ها",
href: "/mstcontroller/course-categories",
label: "دسته بندی دوره ها",
icon: Tags,
entity: "course-categories",
},
{
href: "/admin/course-tags",
label: "تگ‌های دوره",
href: "/mstcontroller/course-tags",
label: "تگ های دوره",
icon: Tags,
entity: "course-tags",
},
{ href: "/admin/programs", label: "برنامه‌ها", icon: GraduationCap, entity: "programs" },
{ href: "/admin/events", label: "رویدادها", icon: Calendar, entity: "events" },
{ href: "/admin/articles", label: "مقالات", icon: Newspaper, entity: "articles" },
{ href: "/admin/topics", label: "موضوعات", icon: Tags, entity: "topics" },
{ href: "/mstcontroller/programs", label: "برنامه ها", icon: GraduationCap, entity: "programs" },
{ href: "/mstcontroller/events", label: "رویدادها", icon: Calendar, entity: "events" },
{ href: "/mstcontroller/articles", label: "مقالات", icon: Newspaper, entity: "articles" },
{ href: "/mstcontroller/topics", label: "موضوعات", icon: Tags, entity: "topics" },
],
},
{
label: "جامعه",
items: [
{ href: "/admin/faculty", label: "اساتید", icon: Users, entity: "faculty" },
{ href: "/admin/alumni", label: "دانش‌آموختگان", icon: MessageSquareQuote, entity: "alumni" },
{ href: "/mstcontroller/faculty", label: "اساتید", icon: Users, entity: "faculty" },
{ href: "/mstcontroller/alumni", label: "دانش آموختگان", icon: MessageSquareQuote, entity: "alumni" },
],
},
{
label: "سایت",
items: [
{ href: "/admin/banners", label: "بنرهای کمپین", icon: Megaphone, entity: "banners" },
{ href: "/admin/stats", label: "آمار", icon: BarChart3, entity: "stats" },
{ href: "/admin/testimonials", label: "نظرات", icon: FileText, entity: "testimonials" },
{ href: "/admin/legal", label: "صفحات قانونی", icon: Scale, entity: "legal" },
{ href: "/mstcontroller/banners", label: "بنرهای کمپین", icon: Megaphone, entity: "banners" },
{ href: "/mstcontroller/stats", label: "آمار", icon: BarChart3, entity: "stats" },
{ href: "/mstcontroller/testimonials", label: "نظرات", icon: FileText, entity: "testimonials" },
{ href: "/mstcontroller/legal", label: "صفحات قانونی", icon: Scale, entity: "legal" },
],
},
{
label: "درخواست‌ها",
items: [{ href: "/admin/registrations", label: "برگ ثبت‌نام", icon: ClipboardList }],
label: "درخواست ها",
items: [{ href: "/mstcontroller/registrations", label: "برگ ثبت نام", icon: ClipboardList }],
},
] as const;
@@ -105,7 +105,7 @@ export function AdminSidebar({ userName }: { userName: string }) {
<SidebarMenuItem>
<SidebarMenuButton
size="lg"
render={<Link href="/admin" />}
render={<Link href="/mstcontroller" />}
className="data-active:bg-sidebar-accent"
>
<span className="relative size-8 shrink-0">
@@ -31,12 +31,12 @@ export function FacultySyncButton() {
const res = await fetch("/api/admin/faculty/sync", { method: "POST" });
const body = (await res.json()) as SyncPayload;
if (!res.ok || !body.ok || !body.data) {
setError(body.error ?? "همگام‌سازی ناموفق بود");
setError(body.error ?? "همگام سازی ناموفق بود");
return;
}
const { total, inserted, updated, imagesSaved } = body.data;
setMessage(
`${total} استاد خوانده شد — ${inserted} جدید، ${updated} به‌روز` +
`${total} استاد خوانده شد — ${inserted} جدید، ${updated} به روز` +
(imagesSaved > 0 ? `، ${imagesSaved} تصویر` : ""),
);
startTransition(() => {
@@ -77,7 +77,7 @@ export function ImageUploadField({
<div className="relative aspect-[16/9] w-full max-w-md bg-muted">
<Image
src={value}
alt="پیش‌نمایش تصویر"
alt="پیش نمایش تصویر"
fill
unoptimized
className="object-cover"
+2 -2
View File
@@ -8,7 +8,7 @@ import { Badge } from "@/components/ui/badge";
export const LEAD_STATUS_LABELS: Record<string, string> = {
new: "جدید",
contacted: "تماس گرفته شد",
enrolled: "ثبت‌نام شد",
enrolled: "ثبت نام شد",
rejected: "رد شد",
};
@@ -93,7 +93,7 @@ export function LeadsList({ leads }: { leads: LeadForDashboard[] }) {
<SelectContent>
<SelectItem value="new">جدید</SelectItem>
<SelectItem value="contacted">تماس گرفته شد</SelectItem>
<SelectItem value="enrolled">ثبت‌نام شد</SelectItem>
<SelectItem value="enrolled">ثبت نام شد</SelectItem>
<SelectItem value="rejected">رد شد</SelectItem>
</SelectContent>
</Select>
@@ -15,7 +15,7 @@ export function LogoutButton() {
} catch {
// ignore network errors — still navigate to login
} finally {
router.push("/admin/login");
router.push("/mstcontroller/login");
router.refresh();
}
}
@@ -24,7 +24,7 @@ function buildUrl(
if (tag && tag.trim()) params.set("tag", tag.trim());
if (category && category.trim()) params.set("category", category.trim());
const qs = params.toString();
return qs ? `/admin/courses?${qs}` : "/admin/courses";
return qs ? `/mstcontroller/courses?${qs}` : "/mstcontroller/courses";
}
export function CourseFilters({
@@ -63,7 +63,7 @@ export function CourseFilters({
setPublished("all");
setTag("");
setCategory("");
router.push("/admin/courses");
router.push("/mstcontroller/courses");
}
return (
@@ -93,8 +93,8 @@ export function CourseFilters({
</SelectTrigger>
<SelectContent>
<SelectItem value="all">همه</SelectItem>
<SelectItem value="true">منتشرشده</SelectItem>
<SelectItem value="false">پیش‌نویس</SelectItem>
<SelectItem value="true">منتشر شده</SelectItem>
<SelectItem value="false">پیش نویس</SelectItem>
</SelectContent>
</Select>
</div>
@@ -140,7 +140,7 @@ export function CourseFilters({
<Button type="submit">اعمال فیلتر</Button>
{hasFilters ? (
<Button type="button" variant="ghost" onClick={clear}>
پاک‌کردن فیلترها
پاک کردن فیلترها
</Button>
) : null}
</form>
@@ -17,7 +17,7 @@ export function CourseTable({ courses }: { courses: AdminCourse[] }) {
if (courses.length === 0) {
return (
<div className="flex flex-col items-center justify-center px-6 py-14 text-center">
<p className="text-sm font-medium text-foreground">دوره‌ای یافت نشد</p>
<p className="text-sm font-medium text-foreground">دوره ای یافت نشد</p>
<p className="mt-1 text-sm text-muted-foreground">
فیلتر را تغییر دهید یا دوره جدیدی بسازید.
</p>
@@ -86,8 +86,8 @@ export function CourseTable({ courses }: { courses: AdminCourse[] }) {
<TableCell>
<div className="flex items-center gap-2">
<Link
href={`/admin/courses/${course.id}/edit`}
className="text-sm text-primary hover:underline"
href={`/mstcontroller/courses/${course.id}/edit`}
className="text-sm text-accent hover:underline"
>
ویرایش
</Link>
@@ -96,7 +96,7 @@ export function CourseTable({ courses }: { courses: AdminCourse[] }) {
href={`/register/${course.slug}`}
className="text-sm text-muted-foreground hover:underline"
>
پیش‌نمایش
پیش نمایش
</Link>
)}
<DeleteCourseDialog id={course.id} title={course.title} />
@@ -45,7 +45,7 @@ export function DeleteCourseDialog({ id, title }: { id: string; title: string })
<DialogHeader>
<DialogTitle>حذف دوره</DialogTitle>
<DialogDescription>
دوره «{title}» برای همیشه حذف می‌شود. این عمل قابل بازگشت نیست.
دوره «{title}» برای همیشه حذف می شود. این عمل قابل بازگشت نیست.
</DialogDescription>
</DialogHeader>
{error && <p className="text-sm text-destructive">{error}</p>}
@@ -38,7 +38,7 @@ export function PublishToggle({ id, published }: { id: string; published: boolea
onClick={toggle}
disabled={loading}
>
{loading ? "..." : published ? "منتشرشده" : "پیش‌نویس"}
{loading ? "..." : published ? "منتشر شده" : "پیش نویس"}
</Button>
{error && <p className="mt-1 max-w-40 text-xs text-destructive">{error}</p>}
</div>
Loaded 100 of 171 files, more files were not shown because too many files have changed in this diff. Show more