Apply the public site UI checklist.
Align header, footer, brand, homepage course preview, faculty links, and the course catalog with the documented changes. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
8886aa8640
commit
de800d27b1
139 files changed
+3311
-1547
No files matched your search
@@ -3,14 +3,9 @@ import { notFound } from "next/navigation";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { Container } from "@/components/atoms/Container";
|
||||
import { Section } from "@/components/atoms/Section";
|
||||
import { FormCard } from "@/components/molecules/FormCard";
|
||||
import { PageHero } from "@/components/molecules/PageHero";
|
||||
import { ContactInterestForm } from "@/components/organisms/ContactInterestForm";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import { getLegalPage } from "@/lib/data/site";
|
||||
|
||||
type Props = { params: Promise<{ slug: string }> };
|
||||
@@ -38,26 +33,21 @@ export default async function LegalSlugPage({ params }: Props) {
|
||||
return (
|
||||
<main id="main-content">
|
||||
<PageHero title={page.title} />
|
||||
<Section className="bg-gradient-to-b from-background to-muted/40">
|
||||
<Container className="grid gap-10 lg:grid-cols-2">
|
||||
<div className="space-y-5 rounded-2xl bg-card p-6 shadow-sm ring-1 ring-border sm:p-10">
|
||||
<Section tone="subtle">
|
||||
<Container className="grid gap-10 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.2fr)] lg:items-start">
|
||||
<div className="min-w-0 space-y-5">
|
||||
{page.body.map((paragraph) => (
|
||||
<p key={paragraph} className="leading-8 text-foreground/90">
|
||||
<p key={paragraph} className="text-base leading-8 text-foreground/90">
|
||||
{paragraph}
|
||||
</p>
|
||||
))}
|
||||
</div>
|
||||
<Card className="rounded-2xl border-border/70 shadow-lg">
|
||||
<CardHeader>
|
||||
<CardTitle>ارسال پیام</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<ContactInterestForm
|
||||
submitLabel={t("submit")}
|
||||
successLabel={t("registerSuccess")}
|
||||
/>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<FormCard title="ارسال پیام">
|
||||
<ContactInterestForm
|
||||
submitLabel={t("submit")}
|
||||
successLabel={t("registerSuccess")}
|
||||
/>
|
||||
</FormCard>
|
||||
</Container>
|
||||
</Section>
|
||||
</main>
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
import type { Metadata } from "next";
|
||||
import Link from "next/link";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { Container } from "@/components/atoms/Container";
|
||||
import { Heading } from "@/components/atoms/Heading";
|
||||
import { Section } from "@/components/atoms/Section";
|
||||
import { PageHero } from "@/components/molecules/PageHero";
|
||||
import { SurfaceCard } from "@/components/molecules/SurfaceCard";
|
||||
import { buttonVariants } from "@/components/ui/button";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { AboutTemplate } from "@/components/templates/AboutTemplate";
|
||||
import { getTopics } from "@/lib/data/site";
|
||||
import { aboutFocusAreas, siteMission } from "@/lib/site-config";
|
||||
import { aboutContent } from "@/lib/site-config";
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
const t = await getTranslations("pages");
|
||||
return { title: t("aboutTitle"), description: siteMission };
|
||||
return {
|
||||
title: t("aboutTitle"),
|
||||
description: aboutContent.intro,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function AboutPage() {
|
||||
@@ -21,50 +17,7 @@ export default async function AboutPage() {
|
||||
|
||||
return (
|
||||
<main id="main-content">
|
||||
<PageHero
|
||||
eyebrow="درباره مرکز آموزشهای آزاد"
|
||||
title="آموزش مدیریت با پشتوانه امیرکبیر"
|
||||
intro="مرکز آموزشهای آزاد دانشکده مدیریت، علم و فناوری دانشگاه صنعتی امیرکبیر، بر آموزش مدیران و تیمهای مدیریتی برای تحول در صنعت تمرکز دارد. دورههای ما به تصمیمگیری دادهمحور، بهکارگیری هوش مصنوعی در کسبوکار و مدیریت اجرای تغییر در سازمان میپردازند."
|
||||
/>
|
||||
<Section className="relative overflow-hidden">
|
||||
<Container>
|
||||
<p className="text-xs font-bold text-primary">آنچه میآموزید</p><Heading level={2} className="mt-2 text-3xl sm:text-4xl">توانمندیهای مدیریتی برای تحول در صنعت</Heading>
|
||||
<div className="mt-8 grid gap-4 sm:grid-cols-2">
|
||||
{aboutFocusAreas.map((area) => (
|
||||
<SurfaceCard key={area.title}>
|
||||
<Heading as="h3" level={4}>
|
||||
{area.title}
|
||||
</Heading>
|
||||
<p className="mt-2 text-sm text-muted-foreground">
|
||||
{area.description}
|
||||
</p>
|
||||
</SurfaceCard>
|
||||
))}
|
||||
</div>
|
||||
</Container>
|
||||
</Section>
|
||||
<Section tone="muted">
|
||||
<Container>
|
||||
<p className="text-xs font-bold text-primary">حوزههای آموزشی</p><Heading level={2} className="mt-2 text-3xl sm:text-4xl">موضوع مورد نیاز خود را پیدا کنید</Heading>
|
||||
<div className="mt-6 grid gap-3 sm:grid-cols-2 lg:grid-cols-4">
|
||||
{topics.map((topic) => (
|
||||
<SurfaceCard key={topic.id} padded="sm" className="h-full">
|
||||
<Link href={topic.href} className="block">
|
||||
<span className="font-semibold hover:text-primary">
|
||||
{topic.title}
|
||||
</span>
|
||||
<p className="mt-2 text-sm text-muted-foreground">
|
||||
{topic.description}
|
||||
</p>
|
||||
</Link>
|
||||
</SurfaceCard>
|
||||
))}
|
||||
</div>
|
||||
<Link href="/programs" className={cn(buttonVariants(), "mt-8")}>
|
||||
مشاهده برنامههای آموزشی
|
||||
</Link>
|
||||
</Container>
|
||||
</Section>
|
||||
<AboutTemplate topics={topics} />
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -21,26 +21,26 @@ export default async function AlumniPage() {
|
||||
return (
|
||||
<main id="main-content">
|
||||
<PageHero title={t("alumniTitle")} intro={t("alumniIntro")} />
|
||||
<Section className="bg-gradient-to-b from-background to-muted/40">
|
||||
<Section tone="subtle">
|
||||
<Container>
|
||||
<div className="grid gap-8 md:grid-cols-3">
|
||||
<div className="grid gap-5 md:grid-cols-3">
|
||||
{stories.map((story) => (
|
||||
<SurfaceCard
|
||||
key={story.id}
|
||||
id={story.id}
|
||||
padded={false}
|
||||
className="group scroll-mt-24 overflow-hidden rounded-2xl"
|
||||
className="scroll-mt-24"
|
||||
>
|
||||
<div className="relative aspect-[16/10]">
|
||||
<div className="relative aspect-[16/10] bg-muted">
|
||||
<Image
|
||||
src={story.imageUrl}
|
||||
alt={story.name}
|
||||
fill
|
||||
className="object-cover transition-transform duration-500 group-hover:scale-[1.03]"
|
||||
className="object-cover"
|
||||
sizes="(max-width:768px) 100vw, 33vw"
|
||||
/>
|
||||
</div>
|
||||
<div className="p-5">
|
||||
<div className="p-6">
|
||||
<BadgeLabel>{story.program}</BadgeLabel>
|
||||
<Heading as="h2" level={4} className="mt-3">
|
||||
{story.title}
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
import type { Metadata } from "next";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { Container } from "@/components/atoms/Container";
|
||||
import { Heading } from "@/components/atoms/Heading";
|
||||
import { Section } from "@/components/atoms/Section";
|
||||
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 {
|
||||
Card,
|
||||
CardContent,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import { siteAddress } from "@/lib/site-config";
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
const t = await getTranslations("pages");
|
||||
@@ -24,49 +18,15 @@ export default async function ContactPage() {
|
||||
return (
|
||||
<main id="main-content">
|
||||
<PageHero title={t("contactTitle")} intro={t("contactIntro")} />
|
||||
<Section className="bg-gradient-to-b from-background to-muted/40">
|
||||
<Container className="grid gap-10 lg:grid-cols-2">
|
||||
<div className="space-y-5 lg:pt-4">
|
||||
<Heading level={2}>اطلاعات تماس</Heading>
|
||||
<div className="space-y-3 text-sm leading-7 text-muted-foreground">
|
||||
<p>
|
||||
<span className="font-semibold text-foreground">آدرس: </span>
|
||||
{siteAddress.line}
|
||||
</p>
|
||||
<p dir="ltr">
|
||||
<span className="font-semibold text-foreground">تلفن: </span>
|
||||
{siteAddress.phone}
|
||||
</p>
|
||||
<p>
|
||||
<span className="font-semibold text-foreground">ایمیل: </span>
|
||||
<a
|
||||
href={`mailto:${siteAddress.email}`}
|
||||
className="text-primary hover:underline"
|
||||
>
|
||||
{siteAddress.email}
|
||||
</a>
|
||||
</p>
|
||||
<a
|
||||
href={siteAddress.mapUrl}
|
||||
className="inline-block text-primary hover:underline"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
مشاهده روی نقشه
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<Card className="rounded-2xl border-border/70 shadow-lg">
|
||||
<CardHeader>
|
||||
<CardTitle>ارسال پیام</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<ContactInterestForm
|
||||
submitLabel={t("submit")}
|
||||
successLabel={t("registerSuccess")}
|
||||
/>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<Section tone="subtle">
|
||||
<Container className="grid gap-10 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.2fr)] lg:items-start">
|
||||
<ContactDetails />
|
||||
<FormCard title="ارسال پیام">
|
||||
<ContactInterestForm
|
||||
submitLabel={t("submit")}
|
||||
successLabel={t("registerSuccess")}
|
||||
/>
|
||||
</FormCard>
|
||||
</Container>
|
||||
</Section>
|
||||
</main>
|
||||
|
||||
@@ -1,35 +1,10 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { DotCta } from "@/components/atoms/DotCta";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { ErrorState } from "@/components/organisms/ErrorState";
|
||||
|
||||
export default function MainError({
|
||||
error,
|
||||
reset,
|
||||
}: {
|
||||
export default function MainError(props: {
|
||||
error: Error & { digest?: string };
|
||||
reset: () => void;
|
||||
}) {
|
||||
useEffect(() => {
|
||||
console.error(error);
|
||||
}, [error]);
|
||||
|
||||
return (
|
||||
<div className="mx-auto flex min-h-[50vh] w-full max-w-7xl flex-col items-start justify-center px-5 py-20 sm:px-8 lg:px-12">
|
||||
<p className="text-sm font-semibold text-primary">خطا</p>
|
||||
<h1 className="mt-3 text-2xl font-bold tracking-tight sm:text-3xl">
|
||||
بارگذاری صفحه ناموفق بود
|
||||
</h1>
|
||||
<p className="mt-3 max-w-md text-base leading-relaxed text-muted-foreground">
|
||||
لطفاً دوباره تلاش کنید. اگر مشکل ادامه داشت، چند لحظه بعد بازگردید.
|
||||
</p>
|
||||
<div className="mt-8 flex flex-wrap gap-4">
|
||||
<Button type="button" onClick={reset}>
|
||||
تلاش مجدد
|
||||
</Button>
|
||||
<DotCta href="/">بازگشت به خانه</DotCta>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
return <ErrorState {...props} />;
|
||||
}
|
||||
@@ -1,14 +1,23 @@
|
||||
import type { Metadata } from "next";
|
||||
import { notFound } from "next/navigation";
|
||||
import { CalendarDays, MapPin } from "lucide-react";
|
||||
import { Container } from "@/components/atoms/Container";
|
||||
import { Heading } from "@/components/atoms/Heading";
|
||||
import { Section } from "@/components/atoms/Section";
|
||||
import { TextLink } from "@/components/atoms/TextLink";
|
||||
import { DetailList } from "@/components/molecules/DetailList";
|
||||
import { PageHero } from "@/components/molecules/PageHero";
|
||||
import { SurfaceCard } from "@/components/molecules/SurfaceCard";
|
||||
import { getEventById } from "@/lib/data/events";
|
||||
|
||||
type Props = { params: Promise<{ id: string }> };
|
||||
|
||||
const dateFormat: Intl.DateTimeFormatOptions = {
|
||||
year: "numeric",
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
};
|
||||
|
||||
export async function generateMetadata({ params }: Props): Promise<Metadata> {
|
||||
const { id } = await params;
|
||||
const event = await getEventById(id);
|
||||
@@ -21,36 +30,37 @@ export default async function EventDetailPage({ params }: Props) {
|
||||
const event = await getEventById(id);
|
||||
if (!event) notFound();
|
||||
|
||||
const start = new Date(event.startDate).toLocaleDateString("fa-IR", {
|
||||
year: "numeric",
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
});
|
||||
const start = new Date(event.startDate).toLocaleDateString("fa-IR", dateFormat);
|
||||
const end = event.endDate
|
||||
? new Date(event.endDate).toLocaleDateString("fa-IR", {
|
||||
year: "numeric",
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
})
|
||||
? new Date(event.endDate).toLocaleDateString("fa-IR", dateFormat)
|
||||
: null;
|
||||
|
||||
return (
|
||||
<main id="main-content">
|
||||
<PageHero title={event.title} intro={event.summary} />
|
||||
<Section className="bg-gradient-to-b from-background to-muted/40">
|
||||
<Container narrow className="space-y-5 rounded-2xl bg-card p-6 shadow-sm ring-1 ring-border sm:p-10">
|
||||
<p className="text-sm">
|
||||
<span className="font-semibold">زمان: </span>
|
||||
{start}
|
||||
{end ? ` تا ${end}` : ""}
|
||||
</p>
|
||||
<p className="text-sm">
|
||||
<span className="font-semibold">مکان: </span>
|
||||
{event.location}
|
||||
</p>
|
||||
<Heading level={3}>درباره رویداد</Heading>
|
||||
<p className="leading-8 text-foreground/90">{event.summary}</p>
|
||||
<TextLink href="/events">بازگشت به رویدادها</TextLink>
|
||||
<Section tone="subtle">
|
||||
<Container narrow className="space-y-6">
|
||||
<SurfaceCard padded as="div">
|
||||
<DetailList
|
||||
items={[
|
||||
{
|
||||
icon: CalendarDays,
|
||||
label: "زمان",
|
||||
value: end ? `${start} تا ${end}` : start,
|
||||
},
|
||||
{ icon: MapPin, label: "مکان", value: event.location },
|
||||
]}
|
||||
/>
|
||||
</SurfaceCard>
|
||||
<section className="space-y-4">
|
||||
<Heading level={3} as="h2">
|
||||
درباره رویداد
|
||||
</Heading>
|
||||
<p className="text-base leading-8 text-foreground/90">{event.summary}</p>
|
||||
</section>
|
||||
<TextLink href="/events" className="inline-block text-sm">
|
||||
بازگشت به رویدادها
|
||||
</TextLink>
|
||||
</Container>
|
||||
</Section>
|
||||
</main>
|
||||
|
||||
@@ -18,7 +18,7 @@ export default async function EventsPage() {
|
||||
return (
|
||||
<main id="main-content">
|
||||
<PageHero title={t("eventsTitle")} intro={t("eventsIntro")} />
|
||||
<Section className="bg-gradient-to-b from-background to-muted/40">
|
||||
<Section tone="subtle">
|
||||
<Container>
|
||||
<div className="grid gap-4 md:grid-cols-2">
|
||||
{events.map((event) => (
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { redirect } from "next/navigation";
|
||||
import { facultyNetworkUrl } from "@/lib/site-config";
|
||||
|
||||
export default function FacultyPage() {
|
||||
redirect("https://mst.aut.ac.ir/content/31094/شبکه-اساتید");
|
||||
redirect(facultyNetworkUrl);
|
||||
}
|
||||
@@ -2,11 +2,9 @@ import type { Metadata } from "next";
|
||||
import Image from "next/image";
|
||||
import { notFound } from "next/navigation";
|
||||
import { Container } from "@/components/atoms/Container";
|
||||
import { Heading } from "@/components/atoms/Heading";
|
||||
import { Section } from "@/components/atoms/Section";
|
||||
import { BadgeLabel } from "@/components/atoms/BadgeLabel";
|
||||
import { MetamorphField } from "@/components/atoms/MetamorphField";
|
||||
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";
|
||||
|
||||
@@ -39,21 +37,14 @@ export default async function InsightDetailPage({ params }: Props) {
|
||||
image: article.imageUrl,
|
||||
}}
|
||||
/>
|
||||
<Section tone="dark" className="relative overflow-hidden pb-16 pt-16 sm:pb-20 sm:pt-20">
|
||||
<MetamorphField tone="dark" density="sparse" className="opacity-35" />
|
||||
<Container narrow className="relative z-[1]">
|
||||
<BadgeLabel>{article.category}</BadgeLabel>
|
||||
<Heading as="h1" level={1} className="mt-4 text-background">
|
||||
{article.title}
|
||||
</Heading>
|
||||
<p className="mt-3 text-sm text-background/60">
|
||||
{article.author} · {date}
|
||||
</p>
|
||||
</Container>
|
||||
</Section>
|
||||
<Section className="bg-gradient-to-b from-background to-muted/40 pt-10">
|
||||
<PageHero
|
||||
eyebrow={article.category}
|
||||
title={article.title}
|
||||
intro={`${article.author} · ${date}`}
|
||||
/>
|
||||
<Section tone="subtle">
|
||||
<Container narrow>
|
||||
<div className="relative mb-10 aspect-[16/9] overflow-hidden rounded-2xl bg-muted shadow-xl">
|
||||
<div className="relative mb-10 aspect-[16/9] overflow-hidden rounded-2xl bg-muted ring-1 ring-foreground/10">
|
||||
<Image
|
||||
src={article.imageUrl}
|
||||
alt={article.title}
|
||||
@@ -63,8 +54,10 @@ export default async function InsightDetailPage({ params }: Props) {
|
||||
priority
|
||||
/>
|
||||
</div>
|
||||
<p className="text-lg leading-9 text-foreground/90">{article.body}</p>
|
||||
<TextLink href="/insights" className="mt-10 inline-block">
|
||||
<p className="text-base leading-8 text-foreground/90 sm:text-lg sm:leading-9">
|
||||
{article.body}
|
||||
</p>
|
||||
<TextLink href="/insights" className="mt-10 inline-block text-sm">
|
||||
بازگشت به مقالات
|
||||
</TextLink>
|
||||
</Container>
|
||||
|
||||
@@ -18,7 +18,7 @@ export default async function InsightsPage() {
|
||||
return (
|
||||
<main id="main-content">
|
||||
<PageHero title={t("insightsTitle")} intro={t("insightsIntro")} />
|
||||
<Section className="bg-gradient-to-b from-background to-muted/40">
|
||||
<Section tone="subtle">
|
||||
<Container>
|
||||
<div className="mx-auto max-w-5xl">
|
||||
{articles.map((article) => (
|
||||
|
||||
@@ -7,7 +7,11 @@ 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 { siteShortName } from "@/lib/site-config";
|
||||
import {
|
||||
facultyNetworkUrl,
|
||||
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.
|
||||
@@ -42,12 +46,9 @@ export default async function MainLayout({
|
||||
<SiteHeader
|
||||
items={navItems}
|
||||
searchLabel={t("nav.search")}
|
||||
contactLabel={t("nav.contact")}
|
||||
brandTitle={siteShortName}
|
||||
brandSubtitle={t("nav.brandSubtitle")}
|
||||
academicsLabel={t("nav.academics")}
|
||||
programSelectorTitle={t("home.programSelectorTitle")}
|
||||
executiveLabel={t("home.executiveLabel")}
|
||||
exploreLabel={t("home.exploreOurPrograms")}
|
||||
variant="home"
|
||||
courses={courses}
|
||||
programs={programs}
|
||||
@@ -58,6 +59,8 @@ export default async function MainLayout({
|
||||
copyright={t("footer.copyright", { year })}
|
||||
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" },
|
||||
]}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
import Link from "next/link";
|
||||
import { Container } from "@/components/atoms/Container";
|
||||
import { Heading } from "@/components/atoms/Heading";
|
||||
import { buttonVariants } from "@/components/ui/button";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
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>
|
||||
<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")}>
|
||||
بازگشت به خانه
|
||||
</Link>
|
||||
<Link
|
||||
href="/professional"
|
||||
className={buttonVariants({ variant: "outline", size: "lg" })}
|
||||
>
|
||||
مشاهده دورهها
|
||||
</Link>
|
||||
</div>
|
||||
</Container>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
+45
-71
@@ -1,14 +1,14 @@
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import {
|
||||
HomeEvents,
|
||||
HomeApproach,
|
||||
HomeCourseSearch,
|
||||
HomeHero,
|
||||
HomeIdeas,
|
||||
HomeRest,
|
||||
type HomeLabels,
|
||||
} from "@/components/templates/HomeTemplate";
|
||||
import { getFeaturedArticle } from "@/lib/data/articles";
|
||||
import { getEvents } from "@/lib/data/events";
|
||||
import { getPrograms } from "@/lib/data/programs";
|
||||
import { getLatestCourses } from "@/lib/data/courses";
|
||||
import { getSiteStats, getTopics } from "@/lib/data/site";
|
||||
|
||||
async function getLabels(): Promise<HomeLabels> {
|
||||
@@ -31,84 +31,57 @@ async function getLabels(): Promise<HomeLabels> {
|
||||
findUsTitle: t("home.findUsTitle"),
|
||||
ideasEyebrow: t("home.ideasEyebrow"),
|
||||
linksTitle: t("footer.links"),
|
||||
exploreCourses: t("nav.exploreCourses"),
|
||||
};
|
||||
}
|
||||
|
||||
async function HeroSection() {
|
||||
async function orFallback<T>(
|
||||
label: string,
|
||||
load: () => Promise<T>,
|
||||
fallback: T,
|
||||
): Promise<T> {
|
||||
try {
|
||||
const [featured, labels] = await Promise.all([
|
||||
getFeaturedArticle(),
|
||||
getLabels(),
|
||||
]);
|
||||
return <HomeHero featured={featured} eyebrow={labels.ideasEyebrow} />;
|
||||
return await load();
|
||||
} catch (err) {
|
||||
console.error("[home] HeroSection failed:", err);
|
||||
const labels = await getLabels();
|
||||
return <HomeHero featured={null} eyebrow={labels.ideasEyebrow} />;
|
||||
console.error(`[home] ${label} failed:`, err);
|
||||
return fallback;
|
||||
}
|
||||
}
|
||||
|
||||
async function EventsSection() {
|
||||
try {
|
||||
const [events, labels] = await Promise.all([getEvents(), getLabels()]);
|
||||
return (
|
||||
<HomeEvents
|
||||
events={events}
|
||||
title={labels.eventsTitle}
|
||||
seeAllLabel={labels.seeAllEvents}
|
||||
/>
|
||||
);
|
||||
} catch (err) {
|
||||
console.error("[home] EventsSection failed:", err);
|
||||
const labels = await getLabels();
|
||||
return (
|
||||
<HomeEvents
|
||||
events={[]}
|
||||
title={labels.eventsTitle}
|
||||
seeAllLabel={labels.seeAllEvents}
|
||||
/>
|
||||
);
|
||||
}
|
||||
async function HeroSection() {
|
||||
const [featured, labels] = await Promise.all([
|
||||
orFallback("featured article", getFeaturedArticle, null),
|
||||
getLabels(),
|
||||
]);
|
||||
return <HomeHero featured={featured} eyebrow={labels.ideasEyebrow} />;
|
||||
}
|
||||
|
||||
async function CourseSearchSection() {
|
||||
const data = await orFallback(
|
||||
"latest courses",
|
||||
() =>
|
||||
Promise.all([getLatestCourses(6), getLabels()]),
|
||||
null,
|
||||
);
|
||||
if (!data) return null;
|
||||
const [courses, labels] = data;
|
||||
return (
|
||||
<HomeCourseSearch
|
||||
courses={courses}
|
||||
exploreLabel={labels.exploreCourses}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
async function RestSection() {
|
||||
try {
|
||||
const [programs, intersections, stats, labels] = await Promise.all([
|
||||
getPrograms(),
|
||||
getTopics(),
|
||||
getSiteStats(),
|
||||
getLabels(),
|
||||
]);
|
||||
const carouselPrograms = programs.filter((p) =>
|
||||
[
|
||||
"management-core",
|
||||
"evening-management",
|
||||
"executive",
|
||||
"leadership-fellows",
|
||||
"business-analytics",
|
||||
"finance",
|
||||
].includes(p.slug),
|
||||
);
|
||||
return (
|
||||
<HomeRest
|
||||
labels={labels}
|
||||
carouselPrograms={carouselPrograms}
|
||||
intersections={intersections}
|
||||
stats={stats}
|
||||
/>
|
||||
);
|
||||
} catch (err) {
|
||||
console.error("[home] RestSection failed:", err);
|
||||
const labels = await getLabels();
|
||||
return (
|
||||
<HomeRest
|
||||
labels={labels}
|
||||
carouselPrograms={[]}
|
||||
intersections={[]}
|
||||
stats={[]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
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() {
|
||||
@@ -116,7 +89,8 @@ export default function HomePage() {
|
||||
<main id="main-content">
|
||||
<HeroSection />
|
||||
<HomeIdeas />
|
||||
<EventsSection />
|
||||
<CourseSearchSection />
|
||||
<HomeApproach />
|
||||
<RestSection />
|
||||
</main>
|
||||
);
|
||||
|
||||
@@ -6,7 +6,10 @@ import { Container } from "@/components/atoms/Container";
|
||||
import { Heading } from "@/components/atoms/Heading";
|
||||
import { Section } from "@/components/atoms/Section";
|
||||
import { TextLink } from "@/components/atoms/TextLink";
|
||||
import { CheckList } from "@/components/molecules/CheckList";
|
||||
import { DetailList } from "@/components/molecules/DetailList";
|
||||
import { PageHero } from "@/components/molecules/PageHero";
|
||||
import { SectionHeader } from "@/components/molecules/SectionHeader";
|
||||
import { SurfaceCard } from "@/components/molecules/SurfaceCard";
|
||||
import { buttonVariants } from "@/components/ui/button";
|
||||
import { cn } from "@/lib/utils";
|
||||
@@ -43,66 +46,68 @@ export default async function ProgramDetailPage({ params }: Props) {
|
||||
intro={program.blurb}
|
||||
eyebrow={program.tagline}
|
||||
/>
|
||||
<Section className="bg-gradient-to-b from-background to-muted/40">
|
||||
<Container className="grid gap-10 lg:grid-cols-[2fr_1fr]">
|
||||
<div>
|
||||
<Section tone="subtle">
|
||||
<Container className="grid min-w-0 gap-10 lg:grid-cols-[minmax(0,1fr)_minmax(0,22rem)] lg:items-start lg:gap-12">
|
||||
<div className="min-w-0 space-y-10">
|
||||
<p className="text-base leading-8 text-foreground/90">{program.body}</p>
|
||||
<Heading level={2} className="mt-10">
|
||||
{t("highlights")}
|
||||
</Heading>
|
||||
<ul className="mt-4 list-disc space-y-2 ps-5 text-sm leading-7">
|
||||
{program.highlights.map((item) => (
|
||||
<li key={item}>{item}</li>
|
||||
))}
|
||||
</ul>
|
||||
{program.highlights.length > 0 ? (
|
||||
<section className="space-y-4">
|
||||
<Heading level={3} as="h2">
|
||||
{t("highlights")}
|
||||
</Heading>
|
||||
<CheckList items={program.highlights} />
|
||||
</section>
|
||||
) : null}
|
||||
</div>
|
||||
<aside className="h-fit space-y-4 rounded-2xl bg-card p-6 shadow-sm ring-1 ring-border">
|
||||
<p className="text-sm">
|
||||
<span className="font-semibold">مخاطب: </span>
|
||||
{program.audience}
|
||||
</p>
|
||||
<p className="text-sm">
|
||||
<span className="font-semibold">مدت: </span>
|
||||
{program.durationLabel}
|
||||
</p>
|
||||
<p className="text-sm">
|
||||
<span className="font-semibold">فرمت: </span>
|
||||
{program.formatLabel}
|
||||
</p>
|
||||
<Link
|
||||
href="/professional"
|
||||
className={cn(buttonVariants(), "w-full")}
|
||||
>
|
||||
مشاهده دورهها
|
||||
</Link>
|
||||
<TextLink href="/programs" className="block text-sm">
|
||||
<aside className="min-w-0 space-y-4 lg:sticky lg:top-28">
|
||||
<SurfaceCard padded as="div">
|
||||
<DetailList
|
||||
items={[
|
||||
{ label: "مخاطب", value: program.audience },
|
||||
{ label: "مدت", value: program.durationLabel },
|
||||
{ label: "فرمت", value: program.formatLabel },
|
||||
]}
|
||||
/>
|
||||
<Link
|
||||
href="/professional"
|
||||
className={cn(buttonVariants({ size: "lg" }), "mt-6 w-full font-bold")}
|
||||
>
|
||||
مشاهده دورهها
|
||||
</Link>
|
||||
</SurfaceCard>
|
||||
<TextLink href="/programs" className="block px-1 text-sm">
|
||||
{t("backToPrograms")}
|
||||
</TextLink>
|
||||
</aside>
|
||||
</Container>
|
||||
</Section>
|
||||
<Section tone="muted">
|
||||
<Container>
|
||||
<Heading level={2}>{t("relatedCourses")}</Heading>
|
||||
<ul className="mt-6 grid gap-4 sm:grid-cols-3">
|
||||
{related.map((course) => (
|
||||
<li key={course.id}>
|
||||
<SurfaceCard padded="sm" as="div" className="h-full">
|
||||
<Link
|
||||
href={course.registrationUrl}
|
||||
className="font-semibold hover:text-primary"
|
||||
>
|
||||
{course.title}
|
||||
{related.length > 0 ? (
|
||||
<Section tone="muted">
|
||||
<Container>
|
||||
<SectionHeader title={t("relatedCourses")} />
|
||||
<ul className="grid gap-4 sm:grid-cols-3">
|
||||
{related.map((course) => (
|
||||
<li key={course.id}>
|
||||
<Link href={course.registrationUrl} className="group block h-full">
|
||||
<SurfaceCard padded as="div" interactive className="h-full">
|
||||
<Heading
|
||||
as="h3"
|
||||
level={4}
|
||||
className="transition-colors group-hover:text-primary"
|
||||
>
|
||||
{course.title}
|
||||
</Heading>
|
||||
<p className="mt-2 line-clamp-3 text-sm leading-7 text-muted-foreground">
|
||||
{course.summary}
|
||||
</p>
|
||||
</SurfaceCard>
|
||||
</Link>
|
||||
<p className="mt-2 line-clamp-3 text-sm text-muted-foreground">
|
||||
{course.summary}
|
||||
</p>
|
||||
</SurfaceCard>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</Container>
|
||||
</Section>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</Container>
|
||||
</Section>
|
||||
) : null}
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -5,7 +5,9 @@ import { Container } from "@/components/atoms/Container";
|
||||
import { Heading } from "@/components/atoms/Heading";
|
||||
import { Section } from "@/components/atoms/Section";
|
||||
import { BadgeLabel } from "@/components/atoms/BadgeLabel";
|
||||
import { DetailList } from "@/components/molecules/DetailList";
|
||||
import { PageHero } from "@/components/molecules/PageHero";
|
||||
import { SectionHeader } from "@/components/molecules/SectionHeader";
|
||||
import { SurfaceCard } from "@/components/molecules/SurfaceCard";
|
||||
import { buttonVariants } from "@/components/ui/button";
|
||||
import { cn } from "@/lib/utils";
|
||||
@@ -28,8 +30,8 @@ export default async function ProgramsPage() {
|
||||
return (
|
||||
<main id="main-content">
|
||||
<PageHero title={t("programsTitle")} intro={t("programsIntro")} />
|
||||
<Section className="bg-gradient-to-b from-background to-muted/40">
|
||||
<Container className="space-y-10">
|
||||
<Section tone="subtle">
|
||||
<Container className="space-y-16">
|
||||
<ProgramGroup title={t("standardGroup")} items={standard} />
|
||||
<ProgramGroup title={t("executiveGroup")} items={executive} />
|
||||
</Container>
|
||||
@@ -45,40 +47,35 @@ function ProgramGroup({
|
||||
title: string;
|
||||
items: Awaited<ReturnType<typeof getPrograms>>;
|
||||
}) {
|
||||
if (items.length === 0) return null;
|
||||
return (
|
||||
<div>
|
||||
<Heading level={2} className="mb-6">
|
||||
{title}
|
||||
</Heading>
|
||||
<div className="grid gap-5 md:grid-cols-2">
|
||||
<SectionHeader title={title} className="mb-6 sm:mb-8" />
|
||||
<div className="grid gap-5 md:grid-cols-2">
|
||||
{items.map((program) => (
|
||||
<SurfaceCard key={program.id} className="flex flex-col rounded-2xl p-6 sm:p-7">
|
||||
<BadgeLabel className="w-fit">{program.tagline}</BadgeLabel>
|
||||
<SurfaceCard key={program.id} padded className="flex flex-col">
|
||||
{program.tagline ? (
|
||||
<BadgeLabel className="w-fit">{program.tagline}</BadgeLabel>
|
||||
) : null}
|
||||
<Heading as="h3" level={3} className="mt-3">
|
||||
<Link href={program.href} className="hover:text-primary">
|
||||
<Link href={program.href} className="transition-colors hover:text-primary">
|
||||
{program.title}
|
||||
</Link>
|
||||
</Heading>
|
||||
<p className="mt-2 flex-1 text-sm leading-relaxed text-muted-foreground">
|
||||
<p className="mt-2 flex-1 text-sm leading-7 text-muted-foreground">
|
||||
{program.blurb}
|
||||
</p>
|
||||
<dl className="mt-4 grid grid-cols-2 gap-2 text-xs text-muted-foreground">
|
||||
<div>
|
||||
<dt className="font-semibold text-foreground">مخاطب</dt>
|
||||
<dd>{program.audience}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="font-semibold text-foreground">مدت</dt>
|
||||
<dd>{program.durationLabel}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="font-semibold text-foreground">فرمت</dt>
|
||||
<dd>{program.formatLabel}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
<DetailList
|
||||
className="mt-5 border-t border-border pt-4"
|
||||
items={[
|
||||
{ label: "مخاطب", value: program.audience },
|
||||
{ label: "مدت", value: program.durationLabel },
|
||||
{ label: "فرمت", value: program.formatLabel },
|
||||
]}
|
||||
/>
|
||||
<Link
|
||||
href={program.href}
|
||||
className={cn(buttonVariants({ variant: "outline" }), "mt-5 w-fit")}
|
||||
className={cn(buttonVariants({ variant: "outline" }), "mt-6 w-fit")}
|
||||
>
|
||||
جزئیات برنامه
|
||||
</Link>
|
||||
|
||||
@@ -4,9 +4,10 @@ import { notFound } from "next/navigation";
|
||||
import { Container } from "@/components/atoms/Container";
|
||||
import { Section } from "@/components/atoms/Section";
|
||||
import { TextLink } from "@/components/atoms/TextLink";
|
||||
import { CheckList } from "@/components/molecules/CheckList";
|
||||
import { PageHero } from "@/components/molecules/PageHero";
|
||||
import { SurfaceCard } from "@/components/molecules/SurfaceCard";
|
||||
import { buttonVariants } from "@/components/ui/button";
|
||||
import { Separator } from "@/components/ui/separator";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { getTopicBySlug } from "@/lib/data/site";
|
||||
|
||||
@@ -31,25 +32,27 @@ export default async function TopicPage({ params }: Props) {
|
||||
intro={topic.description}
|
||||
imageUrl={topic.imageUrl}
|
||||
/>
|
||||
<Section className="bg-gradient-to-b from-background to-muted/40">
|
||||
<Container className="grid gap-10 lg:grid-cols-[2fr_1fr]">
|
||||
<div>
|
||||
<p className="text-base leading-8">{topic.body}</p>
|
||||
<ul className="mt-8 list-disc space-y-2 ps-5 text-sm">
|
||||
{topic.highlights.map((h) => (
|
||||
<li key={h}>{h}</li>
|
||||
))}
|
||||
</ul>
|
||||
<Section tone="subtle">
|
||||
<Container className="grid min-w-0 gap-10 lg:grid-cols-[minmax(0,1fr)_minmax(0,22rem)] lg:items-start lg:gap-12">
|
||||
<div className="min-w-0 space-y-8">
|
||||
<p className="text-base leading-8 text-foreground/90">{topic.body}</p>
|
||||
{topic.highlights.length > 0 ? (
|
||||
<CheckList items={topic.highlights} />
|
||||
) : null}
|
||||
</div>
|
||||
<aside className="h-fit space-y-4 rounded-2xl bg-card p-6 shadow-sm ring-1 ring-border">
|
||||
<p className="text-sm text-muted-foreground">
|
||||
دورههای مرتبط با این موضوع را در فهرست دورههای کوتاه ببینید.
|
||||
</p>
|
||||
<Link href="/professional" className={cn(buttonVariants())}>
|
||||
مشاهده دورهها
|
||||
</Link>
|
||||
<Separator />
|
||||
<TextLink href="/" className="block text-sm">
|
||||
<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">
|
||||
بازگشت به خانه
|
||||
</TextLink>
|
||||
</aside>
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
import type { Metadata } from "next";
|
||||
import Link from "next/link";
|
||||
import { ArrowLeft } from "lucide-react";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { Container } from "@/components/atoms/Container";
|
||||
import { Heading } from "@/components/atoms/Heading";
|
||||
import { Section } from "@/components/atoms/Section";
|
||||
import { PageHero } from "@/components/molecules/PageHero";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { SectionHeader } from "@/components/molecules/SectionHeader";
|
||||
import { SurfaceCard } from "@/components/molecules/SurfaceCard";
|
||||
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 };
|
||||
@@ -15,24 +21,57 @@ export default async function ValuesPage() {
|
||||
return (
|
||||
<main id="main-content">
|
||||
<PageHero
|
||||
eyebrow="ارزشهای آموزشی ما"
|
||||
eyebrow={valuesContent.eyebrow}
|
||||
title={valuesContent.title}
|
||||
intro={valuesContent.intro}
|
||||
/>
|
||||
<Section className="bg-gradient-to-b from-background to-muted/40">
|
||||
|
||||
<Section tone="subtle">
|
||||
<Container>
|
||||
<div className="grid gap-5 sm:grid-cols-2">
|
||||
{valuesContent.items.map((item) => (
|
||||
<Card key={item.title} className="rounded-2xl border-border/70 shadow-sm transition-[box-shadow,border-color] hover:border-primary/20 hover:shadow-md">
|
||||
<CardHeader>
|
||||
<CardTitle>{item.title}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<p className="text-sm leading-7 text-muted-foreground">
|
||||
{item.text}
|
||||
<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">
|
||||
{FA_INDEX[index] ?? String(index + 1)}
|
||||
</p>
|
||||
<Heading as="h2" level={4} className="mt-2">
|
||||
{item.title}
|
||||
</Heading>
|
||||
<p className="mt-2 text-sm leading-7 text-muted-foreground">
|
||||
{item.text}
|
||||
</p>
|
||||
</SurfaceCard>
|
||||
))}
|
||||
</div>
|
||||
</Container>
|
||||
</Section>
|
||||
|
||||
<Section>
|
||||
<Container>
|
||||
<SectionHeader
|
||||
title={valuesContent.inPractice.title}
|
||||
description={valuesContent.inPractice.description}
|
||||
/>
|
||||
<div className="grid gap-4 md:grid-cols-3">
|
||||
{valuesContent.inPractice.examples.map((example) => (
|
||||
<Link
|
||||
key={example.href}
|
||||
href={example.href}
|
||||
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">
|
||||
{example.title}
|
||||
</Heading>
|
||||
<p className="mt-2 text-sm leading-7 text-muted-foreground">
|
||||
{example.text}
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<span className="mt-4 inline-flex items-center gap-1.5 text-sm font-semibold text-primary">
|
||||
مشاهده دوره
|
||||
<ArrowLeft className="size-3.5 transition-transform group-hover:-translate-x-0.5" />
|
||||
</span>
|
||||
</SurfaceCard>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</Container>
|
||||
|
||||
@@ -4,6 +4,7 @@ import { ENTITIES } from "@/lib/admin/entities";
|
||||
import { isAdminEntityEnabled } from "@/lib/admin/disabled-entities";
|
||||
import { GenericFilters } from "@/components/organisms/admin/generic/GenericFilters";
|
||||
import { GenericTable } from "@/components/organisms/admin/generic/GenericTable";
|
||||
import { FacultySyncButton } from "@/components/organisms/admin/FacultySyncButton";
|
||||
import {
|
||||
AdminPage,
|
||||
AdminPageHeader,
|
||||
@@ -12,6 +13,7 @@ import {
|
||||
} from "@/components/organisms/admin/AdminPage";
|
||||
import { buttonVariants } from "@/components/ui/button";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { facultyNetworkUrl } from "@/lib/site-config";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
@@ -32,15 +34,37 @@ export default async function AdminEntityListPage({
|
||||
|
||||
const rows = await spec.list({ search, published });
|
||||
|
||||
const description =
|
||||
entity === "faculty" ? (
|
||||
<>
|
||||
{rows.length} مورد
|
||||
{search ? ` مطابق فیلتر «${search}»` : ""}
|
||||
{" — "}
|
||||
<a
|
||||
href={facultyNetworkUrl}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="underline-offset-4 hover:underline"
|
||||
>
|
||||
منبع: شبکه اساتید دانشکده
|
||||
</a>
|
||||
</>
|
||||
) : (
|
||||
`${rows.length} مورد${search ? ` مطابق فیلتر «${search}»` : ""}`
|
||||
);
|
||||
|
||||
return (
|
||||
<AdminPage>
|
||||
<AdminPageHeader
|
||||
title={spec.navLabel}
|
||||
description={`${rows.length} مورد${search ? ` مطابق فیلتر «${search}»` : ""}`}
|
||||
description={description}
|
||||
actions={
|
||||
<Link href={`/admin/${entity}/new`} className={cn(buttonVariants())}>
|
||||
+ {spec.noun} جدید
|
||||
</Link>
|
||||
<>
|
||||
{entity === "faculty" ? <FacultySyncButton /> : null}
|
||||
<Link href={`/admin/${entity}/new`} className={cn(buttonVariants())}>
|
||||
+ {spec.noun} جدید
|
||||
</Link>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
AdminPage,
|
||||
AdminPageHeader,
|
||||
} from "@/components/organisms/admin/AdminPage";
|
||||
import { listAdminFaculty } from "@/lib/data/admin/cms";
|
||||
import {
|
||||
listAdminCourseCategories,
|
||||
listAdminCourseTags,
|
||||
@@ -18,10 +19,11 @@ export default async function EditCoursePage({
|
||||
params: Promise<{ id: string }>;
|
||||
}) {
|
||||
const { id } = await params;
|
||||
const [course, categories, tags] = await Promise.all([
|
||||
const [course, categories, tags, faculty] = await Promise.all([
|
||||
getAdminCourseById(id),
|
||||
listAdminCourseCategories(),
|
||||
listAdminCourseTags(),
|
||||
listAdminFaculty(),
|
||||
]);
|
||||
if (!course) notFound();
|
||||
|
||||
@@ -33,7 +35,16 @@ export default async function EditCoursePage({
|
||||
backHref="/admin/courses"
|
||||
backLabel="بازگشت به دورهها"
|
||||
/>
|
||||
<CourseForm initial={course} categories={categories} tags={tags} />
|
||||
<CourseForm
|
||||
initial={course}
|
||||
categories={categories}
|
||||
tags={tags}
|
||||
faculty={faculty.map((f) => ({
|
||||
id: f.id,
|
||||
name: f.name,
|
||||
title: f.title,
|
||||
}))}
|
||||
/>
|
||||
</AdminPage>
|
||||
);
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import {
|
||||
AdminPage,
|
||||
AdminPageHeader,
|
||||
} from "@/components/organisms/admin/AdminPage";
|
||||
import { listAdminFaculty } from "@/lib/data/admin/cms";
|
||||
import {
|
||||
listAdminCourseCategories,
|
||||
listAdminCourseTags,
|
||||
@@ -11,9 +12,10 @@ import {
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function NewCoursePage() {
|
||||
const [categories, tags] = await Promise.all([
|
||||
const [categories, tags, faculty] = await Promise.all([
|
||||
listAdminCourseCategories(),
|
||||
listAdminCourseTags(),
|
||||
listAdminFaculty(),
|
||||
]);
|
||||
|
||||
return (
|
||||
@@ -24,7 +26,15 @@ export default async function NewCoursePage() {
|
||||
backHref="/admin/courses"
|
||||
backLabel="بازگشت به دورهها"
|
||||
/>
|
||||
<CourseForm categories={categories} tags={tags} />
|
||||
<CourseForm
|
||||
categories={categories}
|
||||
tags={tags}
|
||||
faculty={faculty.map((f) => ({
|
||||
id: f.id,
|
||||
name: f.name,
|
||||
title: f.title,
|
||||
}))}
|
||||
/>
|
||||
</AdminPage>
|
||||
);
|
||||
}
|
||||
@@ -12,7 +12,15 @@ export default async function AdminGuardLayout({
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const session = await verifySession();
|
||||
let session: Awaited<ReturnType<typeof verifySession>> = null;
|
||||
try {
|
||||
session = await verifySession();
|
||||
} catch (err) {
|
||||
console.error(
|
||||
"[admin/guard] session check failed:",
|
||||
err instanceof Error ? err.message : err,
|
||||
);
|
||||
}
|
||||
if (!session) {
|
||||
redirect("/admin/login");
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ function LoginForm() {
|
||||
<CardHeader className="space-y-3 text-center">
|
||||
<div className="mx-auto relative size-14">
|
||||
<Image
|
||||
src="/brand/amirkabir.png"
|
||||
src="/brand/mst-faculty.png"
|
||||
alt="دانشگاه صنعتی امیرکبیر"
|
||||
fill
|
||||
sizes="56px"
|
||||
|
||||
@@ -8,6 +8,7 @@ import { revalidateSite } from "@/lib/api/revalidate";
|
||||
import { getAdminCourseById } from "@/lib/data/admin/courses";
|
||||
import {
|
||||
setCourseCategories,
|
||||
setCourseFaculty,
|
||||
setCourseTags,
|
||||
} from "@/lib/data/admin/taxonomy";
|
||||
|
||||
@@ -68,7 +69,7 @@ export async function PATCH(
|
||||
return errorResponse(parsed.error.issues[0]?.message ?? "داده نادرست", 400);
|
||||
}
|
||||
|
||||
const { categoryIds, tagIds, ...rest } = parsed.data;
|
||||
const { categoryIds, tagIds, facultyIds, ...rest } = parsed.data;
|
||||
const sets: string[] = [];
|
||||
const values: unknown[] = [];
|
||||
for (const [key, column] of Object.entries(COURSE_COLUMNS)) {
|
||||
@@ -83,7 +84,12 @@ export async function PATCH(
|
||||
}
|
||||
}
|
||||
|
||||
if (sets.length === 0 && categoryIds === undefined && tagIds === undefined) {
|
||||
if (
|
||||
sets.length === 0 &&
|
||||
categoryIds === undefined &&
|
||||
tagIds === undefined &&
|
||||
facultyIds === undefined
|
||||
) {
|
||||
return errorResponse("حداقل یک فیلد برای ویرایش لازم است", 400);
|
||||
}
|
||||
|
||||
@@ -106,6 +112,9 @@ export async function PATCH(
|
||||
if (tagIds !== undefined) {
|
||||
await setCourseTags(id, tagIds);
|
||||
}
|
||||
if (facultyIds !== undefined) {
|
||||
await setCourseFaculty(id, facultyIds);
|
||||
}
|
||||
|
||||
const course = await getAdminCourseById(id);
|
||||
revalidateSite();
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
} from "@/lib/data/admin/courses";
|
||||
import {
|
||||
setCourseCategories,
|
||||
setCourseFaculty,
|
||||
setCourseTags,
|
||||
} from "@/lib/data/admin/taxonomy";
|
||||
|
||||
@@ -83,6 +84,7 @@ export async function POST(request: NextRequest) {
|
||||
);
|
||||
await setCourseCategories(id, d.categoryIds ?? []);
|
||||
await setCourseTags(id, d.tagIds ?? []);
|
||||
await setCourseFaculty(id, d.facultyIds ?? []);
|
||||
const course = await getAdminCourseById(id);
|
||||
revalidateSite();
|
||||
return NextResponse.json({ ok: true, data: course }, { status: 201 });
|
||||
|
||||
@@ -21,6 +21,7 @@ const FACULTY_COLUMNS: Record<string, string> = {
|
||||
department: "department",
|
||||
linkedinUrl: "linkedin_url",
|
||||
scholarUrl: "scholar_url",
|
||||
profileUrl: "profile_url",
|
||||
published: "published",
|
||||
};
|
||||
|
||||
|
||||
@@ -33,12 +33,12 @@ export async function POST(request: NextRequest) {
|
||||
[
|
||||
"id", "name", "title", "focus", "bio", "image_url",
|
||||
"email", "office", "phone", "department", "linkedin_url", "scholar_url",
|
||||
"published",
|
||||
"profile_url", "published",
|
||||
],
|
||||
[
|
||||
id, d.name, d.title, d.focus, d.bio, d.imageUrl,
|
||||
d.email || null, d.office || null, d.phone || null, d.department || null,
|
||||
d.linkedinUrl || null, d.scholarUrl || null,
|
||||
d.linkedinUrl || null, d.scholarUrl || null, d.profileUrl || null,
|
||||
d.published,
|
||||
],
|
||||
);
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { requireAdmin } from "@/lib/auth/admin";
|
||||
import { errorResponse } from "@/lib/api/response";
|
||||
import { syncFacultyFromMstNetwork } from "@/lib/faculty/sync-mst-network";
|
||||
import { facultyNetworkUrl } from "@/lib/site-config";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
export const maxDuration = 60;
|
||||
|
||||
/**
|
||||
* POST /api/admin/faculty/sync
|
||||
* Pull the live «شبکه اساتید» page (same URL as header nav) and upsert rows.
|
||||
*/
|
||||
export async function POST() {
|
||||
const session = await requireAdmin();
|
||||
if (!session) return errorResponse("عدم دسترسی — ورود لازم است", 401);
|
||||
|
||||
try {
|
||||
const result = await syncFacultyFromMstNetwork();
|
||||
return NextResponse.json({
|
||||
ok: true,
|
||||
data: {
|
||||
...result,
|
||||
url: facultyNetworkUrl,
|
||||
},
|
||||
});
|
||||
} catch (err) {
|
||||
const message =
|
||||
err instanceof Error ? err.message : "همگامسازی اساتید ناموفق بود";
|
||||
console.error("faculty sync error:", err);
|
||||
return errorResponse(message, 502);
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,13 @@ export async function POST(request: NextRequest) {
|
||||
return NextResponse.json({ ok: true, user: { id: user.id, email: user.email, name: user.name, role: user.role } });
|
||||
} catch (error) {
|
||||
console.error("admin login error:", error);
|
||||
const message = error instanceof Error ? error.message : String(error);
|
||||
if (/timeout|ECONNREFUSED|ECONNRESET|Connection terminated/i.test(message)) {
|
||||
return NextResponse.json(
|
||||
{ error: "اتصال به پایگاهداده برقرار نشد. چند ثانیه بعد دوباره تلاش کنید." },
|
||||
{ status: 503 },
|
||||
);
|
||||
}
|
||||
return NextResponse.json({ error: "خطای سرور" }, { status: 500 });
|
||||
}
|
||||
}
|
||||
+15
-2
@@ -12,8 +12,8 @@
|
||||
@theme inline {
|
||||
--color-background: var(--background);
|
||||
--color-foreground: var(--foreground);
|
||||
--font-sans: var(--font-iransans);
|
||||
--font-heading: var(--font-iransans);
|
||||
--font-sans: var(--font-vazirmatn);
|
||||
--font-heading: var(--font-vazirmatn);
|
||||
--color-sidebar-ring: var(--sidebar-ring);
|
||||
--color-sidebar-border: var(--sidebar-border);
|
||||
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
||||
@@ -220,6 +220,19 @@
|
||||
radial-gradient(circle at 90% 80%, color-mix(in oklab, var(--accent) 10%, 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;
|
||||
}
|
||||
}
|
||||
|
||||
/* Scroll-driven reveals: desktop only — expensive while scrolling on phones */
|
||||
@media (min-width: 768px) and (prefers-reduced-motion: no-preference) {
|
||||
@supports (animation-timeline: view()) {
|
||||
|
||||
+15
-50
@@ -1,5 +1,5 @@
|
||||
import type { Metadata, Viewport } from "next";
|
||||
import localFont from "next/font/local";
|
||||
import { Vazirmatn } from "next/font/google";
|
||||
import { NextIntlClientProvider } from "next-intl";
|
||||
import { getLocale, getMessages, getTranslations } from "next-intl/server";
|
||||
import { JsonLd, organizationJsonLd } from "@/lib/seo/json-ld";
|
||||
@@ -11,51 +11,11 @@ export const viewport: Viewport = {
|
||||
viewportFit: "cover",
|
||||
};
|
||||
|
||||
const iranSans = localFont({
|
||||
src: [
|
||||
{
|
||||
path: "../fonts/iransans/IRANSansUltraLight.woff2",
|
||||
weight: "200",
|
||||
style: "normal",
|
||||
},
|
||||
{
|
||||
path: "../fonts/iransans/IRANSansLight.woff2",
|
||||
weight: "300",
|
||||
style: "normal",
|
||||
},
|
||||
{
|
||||
path: "../fonts/iransans/IRANSans.woff2",
|
||||
weight: "400",
|
||||
style: "normal",
|
||||
},
|
||||
{
|
||||
path: "../fonts/iransans/IRANSansMedium.woff2",
|
||||
weight: "500",
|
||||
style: "normal",
|
||||
},
|
||||
{
|
||||
path: "../fonts/iransans/IRANSansBold.woff2",
|
||||
weight: "600",
|
||||
style: "normal",
|
||||
},
|
||||
{
|
||||
path: "../fonts/iransans/IRANSansBold.woff2",
|
||||
weight: "700",
|
||||
style: "normal",
|
||||
},
|
||||
{
|
||||
path: "../fonts/iransans/IRANSansBold.woff2",
|
||||
weight: "800",
|
||||
style: "normal",
|
||||
},
|
||||
{
|
||||
path: "../fonts/iransans/IRANSansBold.woff2",
|
||||
weight: "900",
|
||||
style: "normal",
|
||||
},
|
||||
],
|
||||
variable: "--font-iransans",
|
||||
display: "optional",
|
||||
const vazirmatn = Vazirmatn({
|
||||
subsets: ["arabic", "latin"],
|
||||
variable: "--font-vazirmatn",
|
||||
display: "swap",
|
||||
weight: ["200", "300", "400", "500", "600", "700", "800", "900"],
|
||||
});
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
@@ -70,8 +30,11 @@ export async function generateMetadata(): Promise<Metadata> {
|
||||
},
|
||||
description: t("homeDescription"),
|
||||
icons: {
|
||||
icon: [{ url: "/brand/amirkabir.png", type: "image/png" }],
|
||||
apple: [{ url: "/brand/amirkabir.png", type: "image/png" }],
|
||||
icon: [
|
||||
{ url: "/favicon.ico", sizes: "any" },
|
||||
{ url: "/brand/mst-faculty-icon.png", type: "image/png", sizes: "256x256" },
|
||||
],
|
||||
apple: [{ url: "/brand/mst-faculty-icon.png", type: "image/png" }],
|
||||
},
|
||||
openGraph: {
|
||||
type: "website",
|
||||
@@ -79,7 +42,9 @@ export async function generateMetadata(): Promise<Metadata> {
|
||||
siteName: t("homeTitle"),
|
||||
title: t("homeTitle"),
|
||||
description: t("homeDescription"),
|
||||
images: [{ url: "/brand/amirkabir.png", alt: "دانشگاه صنعتی امیرکبیر" }],
|
||||
images: [
|
||||
{ url: "/brand/mst-faculty.png", alt: "دانشکده مدیریت، علم و فناوری دانشگاه صنعتی امیرکبیر" },
|
||||
],
|
||||
},
|
||||
alternates: {
|
||||
canonical: "/",
|
||||
@@ -98,7 +63,7 @@ export default async function RootLayout({
|
||||
const t = await getTranslations("nav");
|
||||
|
||||
return (
|
||||
<html lang={locale} dir="rtl" className={`${iranSans.variable} h-full`}>
|
||||
<html lang={locale} dir="rtl" className={`${vazirmatn.variable} h-full`}>
|
||||
<body className="flex min-h-full min-w-0 flex-col font-sans">
|
||||
<NextIntlClientProvider messages={messages}>
|
||||
<a
|
||||
|
||||
@@ -1,40 +1,10 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { DotCta } from "@/components/atoms/DotCta";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { ErrorState } from "@/components/organisms/ErrorState";
|
||||
|
||||
export default function ProfessionalError({
|
||||
error,
|
||||
reset,
|
||||
}: {
|
||||
export default function ProfessionalError(props: {
|
||||
error: Error & { digest?: string };
|
||||
reset: () => void;
|
||||
}) {
|
||||
useEffect(() => {
|
||||
console.error(error);
|
||||
}, [error]);
|
||||
|
||||
return (
|
||||
<div className="mx-auto flex min-h-[50vh] w-full max-w-7xl flex-col items-start justify-center bg-chart-3 px-5 py-20 text-background sm:px-8 lg:px-12">
|
||||
<p className="text-sm font-semibold text-accent">خطا</p>
|
||||
<h1 className="mt-3 text-2xl font-bold tracking-tight text-background sm:text-3xl">
|
||||
بارگذاری صفحه ناموفق بود
|
||||
</h1>
|
||||
<p className="mt-3 max-w-md text-background/70">لطفاً دوباره تلاش کنید.</p>
|
||||
<div className="mt-8 flex flex-wrap gap-4">
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
className="border-background/60 bg-transparent text-background hover:bg-background hover:text-foreground"
|
||||
onClick={reset}
|
||||
>
|
||||
تلاش مجدد
|
||||
</Button>
|
||||
<DotCta href="/professional" onDark>
|
||||
بازگشت
|
||||
</DotCta>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
return <ErrorState {...props} homeHref="/professional" />;
|
||||
}
|
||||
@@ -7,6 +7,8 @@ import { listPublishedCourseTags } from "@/lib/data/taxonomy";
|
||||
import { getPrograms } from "@/lib/data/programs";
|
||||
import {
|
||||
courseNavParentTag,
|
||||
facultyNetworkUrl,
|
||||
facultySiteUrl,
|
||||
professionalNav,
|
||||
siteShortName,
|
||||
} from "@/lib/site-config";
|
||||
@@ -47,12 +49,9 @@ export default async function ProfessionalLayout({
|
||||
<SiteHeader
|
||||
items={navItems}
|
||||
searchLabel={t("nav.search")}
|
||||
contactLabel={t("nav.contact")}
|
||||
brandTitle={siteShortName}
|
||||
brandSubtitle={t("nav.brandSubtitle")}
|
||||
academicsLabel={t("nav.academics")}
|
||||
programSelectorTitle={t("home.programSelectorTitle")}
|
||||
executiveLabel={t("home.executiveLabel")}
|
||||
exploreLabel={t("home.exploreOurPrograms")}
|
||||
variant="professional"
|
||||
courses={courses}
|
||||
programs={programs}
|
||||
@@ -63,6 +62,8 @@ export default async function ProfessionalLayout({
|
||||
copyright={t("footer.copyright", { year })}
|
||||
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" },
|
||||
]}
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
listPublishedCourseCategories,
|
||||
listPublishedCourseTags,
|
||||
} from "@/lib/data/taxonomy";
|
||||
import { getSiteStats, getTestimonials } from "@/lib/data/site";
|
||||
import { getSiteStats } from "@/lib/data/site";
|
||||
import { courseJsonLd, JsonLd } from "@/lib/seo/json-ld";
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
@@ -33,14 +33,12 @@ export default async function ProfessionalPage({
|
||||
const { tag: tagRaw, category: categoryRaw } = await searchParams;
|
||||
const initialTag = tagRaw?.trim() ?? "";
|
||||
const initialCategory = categoryRaw?.trim() ?? "";
|
||||
const [courses, stats, testimonials, filterCategories, filterTags] =
|
||||
await Promise.all([
|
||||
getCourses(),
|
||||
getSiteStats(),
|
||||
getTestimonials(),
|
||||
listPublishedCourseCategories({ filterOnly: true }),
|
||||
listPublishedCourseTags({ filterOnly: true }),
|
||||
]);
|
||||
const [courses, stats, filterCategories, filterTags] = await Promise.all([
|
||||
getCourses(),
|
||||
getSiteStats(),
|
||||
listPublishedCourseCategories({ filterOnly: true }),
|
||||
listPublishedCourseTags({ filterOnly: true }),
|
||||
]);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -59,11 +57,9 @@ export default async function ProfessionalPage({
|
||||
dppBody: t("professional.dppBody"),
|
||||
statsTitle: t("professional.statsTitle"),
|
||||
rankTitle: t("professional.rankTitle"),
|
||||
testimonialsTitle: t("professional.testimonialsTitle"),
|
||||
}}
|
||||
courses={courses}
|
||||
stats={stats}
|
||||
testimonials={testimonials}
|
||||
filterCategories={filterCategories}
|
||||
filterTags={filterTags}
|
||||
initialTag={initialTag}
|
||||
|
||||
Reference in new issue
Block a user