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:
smhk1376andCursor committed 2026-10-16 14:05:33 +03:30
1 parent 8886aa8640
commit de800d27b1
139 files changed
+3311 -1547

No files matched your search

+11 -21
View File
@@ -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>
+7 -54
View File
@@ -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>
);
}
+6 -6
View File
@@ -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}
+11 -51
View File
@@ -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>
+3 -28
View File
@@ -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} />;
}
+34 -24
View File
@@ -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>
+1 -1
View File
@@ -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) => (
+2 -1
View File
@@ -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);
}
+12 -19
View File
@@ -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>
+1 -1
View File
@@ -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) => (
+8 -5
View File
@@ -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" },
]}
+32
View File
@@ -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
View File
@@ -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>
);
+57 -52
View File
@@ -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>
);
}
+22 -25
View File
@@ -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>
+22 -19
View File
@@ -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>
+53 -14
View File
@@ -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>