Update course banners, brochures, and archive offerings.
Deploy edu.mstaut.ir / deploy (push) Has been cancelled
Deploy edu.mstaut.ir / deploy (push) Has been cancelled
Ship delivery webp assets for AI Fluency and organizational AI transformation, keep brochure-only courses without fake card banners, and seed nine past open-education courses for production. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
6e2c9f1ad7
commit
3eea1c35a6
14 files changed
+545
-365
No files matched your search
@@ -0,0 +1,32 @@
|
||||
import Image from "next/image";
|
||||
|
||||
/** Card media: banner image when set; otherwise course title on themed surface. */
|
||||
export function CourseCardBanner({
|
||||
title,
|
||||
bannerUrl,
|
||||
}: {
|
||||
title: string;
|
||||
bannerUrl?: string | null;
|
||||
}) {
|
||||
const hasBanner = Boolean(bannerUrl?.trim());
|
||||
|
||||
return (
|
||||
<div className="pointer-events-none relative aspect-[16/10] overflow-hidden bg-primary-foreground/10">
|
||||
{hasBanner ? (
|
||||
<Image
|
||||
src={bannerUrl!}
|
||||
alt=""
|
||||
fill
|
||||
className="object-cover transition-transform duration-300 group-hover:scale-[1.03]"
|
||||
sizes="(max-width:768px) 100vw, 33vw"
|
||||
/>
|
||||
) : (
|
||||
<div className="flex h-full items-center justify-center bg-gradient-to-br from-primary-foreground/15 to-primary-foreground/5 px-4">
|
||||
<p className="line-clamp-3 text-center text-sm font-bold leading-6 text-primary-foreground/90 sm:text-base">
|
||||
{title}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useDeferredValue, useEffect, useMemo, useRef, useState } from "react";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { usePathname, useSearchParams } from "next/navigation";
|
||||
import { Search, X } from "lucide-react";
|
||||
@@ -16,6 +15,7 @@ import {
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import { CourseCardBanner } from "@/components/molecules/CourseCardBanner";
|
||||
import type { Course, TaxonomyRef } from "@/lib/types";
|
||||
import {
|
||||
courseCatalogHref,
|
||||
@@ -28,19 +28,19 @@ import { cn } from "@/lib/utils";
|
||||
const categoryChipClass =
|
||||
"h-9 shrink-0 rounded-full px-4 text-sm font-semibold whitespace-nowrap";
|
||||
const categoryChipIdle =
|
||||
"text-background/70 hover:bg-background/10 hover:text-background";
|
||||
"text-primary-foreground/70 hover:bg-primary-foreground/10 hover:text-primary-foreground";
|
||||
const tagChipClass =
|
||||
"h-7 shrink-0 rounded-full border px-3 text-xs whitespace-nowrap";
|
||||
const tagChipIdle =
|
||||
"border-background/15 bg-transparent text-background/65 hover:border-background/35 hover:bg-transparent hover:text-background";
|
||||
"border-primary-foreground/15 bg-transparent text-primary-foreground/65 hover:border-primary-foreground/35 hover:bg-transparent hover:text-primary-foreground";
|
||||
const tagChipActive =
|
||||
"border-primary bg-primary/20 text-background hover:bg-primary/30";
|
||||
"border-secondary bg-secondary/20 text-secondary hover:bg-secondary/30";
|
||||
|
||||
export function CategoryCourseExplorer({
|
||||
courses,
|
||||
findLabel,
|
||||
categoriesLabel = "دستهبندیها",
|
||||
tagsLabel = "تگها",
|
||||
categoriesLabel = "دسته بندی ها",
|
||||
tagsLabel = "تگ ها",
|
||||
filterCategories,
|
||||
filterTags,
|
||||
initialTag = "",
|
||||
@@ -137,7 +137,7 @@ export function CategoryCourseExplorer({
|
||||
|
||||
return (
|
||||
<div className="space-y-8">
|
||||
<div className="rounded-2xl bg-background/5 p-2 ring-1 ring-background/10">
|
||||
<div className="rounded-2xl bg-primary-foreground/5 p-2 ring-1 ring-primary-foreground/10">
|
||||
<div className="flex h-11 items-center gap-2">
|
||||
{searchOpen ? (
|
||||
<form
|
||||
@@ -150,7 +150,7 @@ export function CategoryCourseExplorer({
|
||||
</Label>
|
||||
<div className="relative h-full min-w-0 flex-1">
|
||||
<Search
|
||||
className="pointer-events-none absolute start-3 top-1/2 size-4 -translate-y-1/2 text-background/50"
|
||||
className="pointer-events-none absolute start-3 top-1/2 size-4 -translate-y-1/2 text-primary-foreground/50"
|
||||
aria-hidden
|
||||
/>
|
||||
<Input
|
||||
@@ -162,14 +162,14 @@ export function CategoryCourseExplorer({
|
||||
if (e.key === "Escape") closeSearch();
|
||||
}}
|
||||
placeholder={findLabel}
|
||||
className="h-full rounded-full border-0 bg-background/10 ps-10 pe-3 text-background placeholder:text-background/45 focus-visible:ring-1 focus-visible:ring-background/30"
|
||||
className="h-full rounded-full border-0 bg-primary-foreground/10 ps-10 pe-3 text-primary-foreground placeholder:text-primary-foreground/45 focus-visible:ring-1 focus-visible:ring-primary-foreground/30"
|
||||
/>
|
||||
</div>
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="size-10 shrink-0 rounded-full text-background/70 hover:bg-background/10 hover:text-background"
|
||||
className="size-10 shrink-0 rounded-full text-primary-foreground/70 hover:bg-primary-foreground/10 hover:text-primary-foreground"
|
||||
aria-label="بستن جستجو"
|
||||
onClick={closeSearch}
|
||||
>
|
||||
@@ -182,7 +182,7 @@ export function CategoryCourseExplorer({
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="size-10 shrink-0 rounded-full bg-background/10 text-background hover:bg-background/20 hover:text-background"
|
||||
className="size-10 shrink-0 rounded-full bg-primary-foreground/10 text-primary-foreground hover:bg-primary-foreground/20 hover:text-primary-foreground"
|
||||
aria-label={findLabel}
|
||||
onClick={() => setSearchOpen(true)}
|
||||
>
|
||||
@@ -191,7 +191,7 @@ export function CategoryCourseExplorer({
|
||||
{filterCategories.length > 0 ? (
|
||||
<>
|
||||
<span
|
||||
className="h-6 w-px shrink-0 bg-background/15"
|
||||
className="h-6 w-px shrink-0 bg-primary-foreground/15"
|
||||
aria-hidden
|
||||
/>
|
||||
<div
|
||||
@@ -208,17 +208,17 @@ export function CategoryCourseExplorer({
|
||||
categoryChipClass,
|
||||
"inline-flex items-center justify-center",
|
||||
categorySlug === ""
|
||||
? "bg-primary text-primary-foreground"
|
||||
? "bg-secondary text-secondary-foreground"
|
||||
: categoryChipIdle,
|
||||
)}
|
||||
>
|
||||
همه دورهها
|
||||
همه دوره ها
|
||||
</Link>
|
||||
) : (
|
||||
<Button
|
||||
type="button"
|
||||
role="tab"
|
||||
variant={categorySlug === "" ? "default" : "ghost"}
|
||||
variant={categorySlug === "" ? "secondary" : "ghost"}
|
||||
aria-selected={categorySlug === ""}
|
||||
onClick={() => selectCategory("")}
|
||||
className={cn(
|
||||
@@ -226,7 +226,7 @@ export function CategoryCourseExplorer({
|
||||
categorySlug !== "" && categoryChipIdle,
|
||||
)}
|
||||
>
|
||||
همه دورهها
|
||||
همه دوره ها
|
||||
</Button>
|
||||
)}
|
||||
{filterCategories.map((item) => {
|
||||
@@ -235,7 +235,7 @@ export function CategoryCourseExplorer({
|
||||
categoryChipClass,
|
||||
"inline-flex items-center justify-center",
|
||||
!active && categoryChipIdle,
|
||||
active && "bg-primary text-primary-foreground",
|
||||
active && "bg-secondary text-secondary-foreground",
|
||||
);
|
||||
return onCatalogPage ? (
|
||||
<Link
|
||||
@@ -252,7 +252,7 @@ export function CategoryCourseExplorer({
|
||||
key={item.id}
|
||||
type="button"
|
||||
role="tab"
|
||||
variant={active ? "default" : "ghost"}
|
||||
variant={active ? "secondary" : "ghost"}
|
||||
aria-selected={active}
|
||||
onClick={() => selectCategory(item.slug)}
|
||||
className={className}
|
||||
@@ -269,10 +269,10 @@ export function CategoryCourseExplorer({
|
||||
</div>
|
||||
|
||||
{filterTags.length > 0 || hasFilters ? (
|
||||
<div className="mt-2 flex flex-wrap items-center gap-1.5 border-t border-background/10 px-2 pt-2.5 pb-0.5">
|
||||
<div className="mt-2 flex flex-wrap items-center gap-1.5 border-t border-primary-foreground/10 px-2 pt-2.5 pb-0.5">
|
||||
{filterTags.length > 0 ? (
|
||||
<>
|
||||
<span className="me-1 text-xs text-background/45">
|
||||
<span className="me-1 text-xs text-primary-foreground/45">
|
||||
{tagsLabel}
|
||||
</span>
|
||||
{filterTags.map((item) => {
|
||||
@@ -314,17 +314,17 @@ export function CategoryCourseExplorer({
|
||||
setQuery("");
|
||||
setSearchOpen(false);
|
||||
}}
|
||||
className="ms-auto text-xs text-background/55 underline-offset-4 transition-colors hover:text-background hover:underline"
|
||||
className="ms-auto text-xs text-primary-foreground/55 underline-offset-4 transition-colors hover:text-primary-foreground hover:underline"
|
||||
>
|
||||
پاککردن فیلترها
|
||||
پاک کردن فیلتر ها
|
||||
</Link>
|
||||
) : (
|
||||
<button
|
||||
type="button"
|
||||
onClick={resetFilters}
|
||||
className="ms-auto text-xs text-background/55 underline-offset-4 transition-colors hover:text-background hover:underline"
|
||||
className="ms-auto text-xs text-primary-foreground/55 underline-offset-4 transition-colors hover:text-primary-foreground hover:underline"
|
||||
>
|
||||
پاککردن فیلترها
|
||||
پاک کردن فیلتر ها
|
||||
</button>
|
||||
)
|
||||
) : null}
|
||||
@@ -333,8 +333,8 @@ export function CategoryCourseExplorer({
|
||||
</div>
|
||||
|
||||
{filtered.length === 0 ? (
|
||||
<p className="py-10 text-center text-sm text-background/60">
|
||||
دورهای با این فیلترها یافت نشد.
|
||||
<p className="py-10 text-center text-sm text-primary-foreground/60">
|
||||
دوره ای با این فیلتر ها یافت نشد.
|
||||
</p>
|
||||
) : (
|
||||
<div
|
||||
@@ -348,7 +348,7 @@ export function CategoryCourseExplorer({
|
||||
return (
|
||||
<Card
|
||||
key={course.id}
|
||||
className="group relative gap-0 overflow-hidden bg-background/5 py-0 text-background ring-background/10 transition-colors hover:ring-background/30"
|
||||
className="group relative gap-0 overflow-hidden bg-primary-foreground/5 py-0 text-primary-foreground ring-primary-foreground/10 transition-colors hover:ring-primary-foreground/30"
|
||||
>
|
||||
{/* Full-card hit target sits under content; badges use pointer-events-auto */}
|
||||
<Link
|
||||
@@ -357,22 +357,17 @@ export function CategoryCourseExplorer({
|
||||
aria-label={course.title}
|
||||
tabIndex={-1}
|
||||
/>
|
||||
<div className="pointer-events-none relative aspect-[16/10] overflow-hidden">
|
||||
<Image
|
||||
src={course.posterImageUrl}
|
||||
alt=""
|
||||
fill
|
||||
className="object-cover transition-transform duration-300 group-hover:scale-[1.03]"
|
||||
sizes="(max-width:768px) 100vw, 33vw"
|
||||
/>
|
||||
</div>
|
||||
<CourseCardBanner
|
||||
title={course.title}
|
||||
bannerUrl={course.posterImageUrl}
|
||||
/>
|
||||
<CardHeader className="pointer-events-none relative z-[1] gap-1 px-4 pt-4">
|
||||
<CardTitle className="text-base text-background">
|
||||
<CardTitle className="text-base text-primary-foreground">
|
||||
{course.title}
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="pointer-events-none relative z-[1] space-y-3 px-4 pb-4">
|
||||
<CardDescription className="line-clamp-3 text-background/70">
|
||||
<CardDescription className="line-clamp-3 text-primary-foreground/70">
|
||||
{course.summary}
|
||||
</CardDescription>
|
||||
{(course.categories.length > 0 || course.tags.length > 0) && (
|
||||
@@ -390,8 +385,8 @@ export function CategoryCourseExplorer({
|
||||
<Badge
|
||||
variant="outline"
|
||||
className={cn(
|
||||
"cursor-pointer border-background/25 text-[11px] font-semibold text-background/90 hover:bg-background/15",
|
||||
active && "border-accent bg-accent/20 text-background",
|
||||
"cursor-pointer border-primary-foreground/25 text-[11px] font-semibold text-primary-foreground/90 hover:bg-primary-foreground/15",
|
||||
active && "border-secondary bg-secondary/25 text-secondary",
|
||||
)}
|
||||
>
|
||||
{c.label}
|
||||
@@ -412,8 +407,8 @@ export function CategoryCourseExplorer({
|
||||
<Badge
|
||||
variant="outline"
|
||||
className={cn(
|
||||
"cursor-pointer border-background/25 text-[10px] text-background/75 hover:bg-background/15",
|
||||
active && "border-accent bg-accent/20 text-background",
|
||||
"cursor-pointer border-primary-foreground/25 text-[10px] text-primary-foreground/75 hover:bg-primary-foreground/15",
|
||||
active && "border-secondary bg-secondary/25 text-secondary",
|
||||
)}
|
||||
>
|
||||
{t.label}
|
||||
@@ -423,20 +418,20 @@ export function CategoryCourseExplorer({
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
<div className="flex flex-wrap items-center justify-between gap-2 text-xs text-background/55">
|
||||
<div className="flex flex-wrap items-center justify-between gap-2 text-xs text-primary-foreground/55">
|
||||
<span>
|
||||
{course.durationHours
|
||||
? `${course.durationHours} ساعت · ${formatLabel(course.format)}`
|
||||
: formatLabel(course.format)}
|
||||
</span>
|
||||
{priceLabel ? (
|
||||
<span className="font-semibold text-background/90">
|
||||
<span className="font-semibold text-primary-foreground/90">
|
||||
{priceLabel}
|
||||
</span>
|
||||
) : null}
|
||||
</div>
|
||||
<span className="inline-flex text-sm font-semibold text-background underline-offset-4 group-hover:underline">
|
||||
جزئیات و ثبتنام
|
||||
<span className="inline-flex text-sm font-semibold text-primary-foreground underline-offset-4 group-hover:underline">
|
||||
جزئیات و ثبت نام
|
||||
</span>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
@@ -115,7 +115,7 @@ export function CourseForm({
|
||||
setError(data.error || "خطا در ذخیره دوره");
|
||||
return;
|
||||
}
|
||||
router.push("/admin/courses");
|
||||
router.push("/mstcontroller/courses");
|
||||
router.refresh();
|
||||
} finally {
|
||||
setLoading(false);
|
||||
@@ -126,14 +126,14 @@ export function CourseForm({
|
||||
<form onSubmit={handleSubmit}>
|
||||
<AdminFormCard
|
||||
title={isEdit ? "ویرایش دوره" : "ثبت دوره جدید"}
|
||||
description="فیلدهای ستارهدار الزامیاند. دسته و تگ از فهرست ادمین انتخاب میشوند."
|
||||
description="فیلدهای ستاره دار الزامی اند. دسته و تگ از فهرست ادمین انتخاب می شوند."
|
||||
footer={
|
||||
<>
|
||||
<Button type="submit" disabled={loading}>
|
||||
{loading ? "در حال ذخیره..." : isEdit ? "ذخیره تغییرات" : "ایجاد دوره"}
|
||||
</Button>
|
||||
<Link
|
||||
href="/admin/courses"
|
||||
href="/mstcontroller/courses"
|
||||
className={cn(buttonVariants({ variant: "outline" }))}
|
||||
>
|
||||
انصراف
|
||||
@@ -152,7 +152,7 @@ export function CourseForm({
|
||||
<div>
|
||||
<h2 className="text-sm font-semibold text-foreground">شناسه و معرفی</h2>
|
||||
<p className="mt-0.5 text-xs text-muted-foreground">
|
||||
شناسه، عنوان و خلاصهٔ نمایشی دوره
|
||||
شناسه، عنوان و خلاصه نمایشی دوره
|
||||
</p>
|
||||
</div>
|
||||
<div className="grid gap-4 sm:grid-cols-2">
|
||||
@@ -194,7 +194,7 @@ export function CourseForm({
|
||||
<div>
|
||||
<h2 className="text-sm font-semibold text-foreground">برگزاری و قیمت</h2>
|
||||
<p className="mt-0.5 text-xs text-muted-foreground">
|
||||
قالب، مدت و هزینهٔ اختیاری
|
||||
قالب، مدت و هزینه اختیاری
|
||||
</p>
|
||||
</div>
|
||||
<div className="grid gap-4 sm:grid-cols-3">
|
||||
@@ -244,17 +244,17 @@ export function CourseForm({
|
||||
|
||||
<section className="space-y-4">
|
||||
<div>
|
||||
<h2 className="text-sm font-semibold text-foreground">دستهبندی و تگ</h2>
|
||||
<h2 className="text-sm font-semibold text-foreground">دسته بندی و تگ</h2>
|
||||
<p className="mt-0.5 text-xs text-muted-foreground">
|
||||
دستهها موضوع محتوا هستند؛ تگها نوع برنامه (منو و فیلتر). تعریف جدید از منوی ادمین.
|
||||
دسته ها موضوع محتوا هستند؛ تگ ها نوع برنامه (منو و فیلتر). تعریف جدید از منوی ادمین.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label>دستهبندیها</Label>
|
||||
<Label>دسته بندی ها</Label>
|
||||
{categories.length === 0 ? (
|
||||
<p className="text-xs text-muted-foreground">
|
||||
هنوز دستهای تعریف نشده. از «دستهبندی دورهها» اضافه کنید.
|
||||
هنوز دسته ای تعریف نشده. از «دسته بندی دوره ها» اضافه کنید.
|
||||
</p>
|
||||
) : (
|
||||
<div className="flex flex-wrap gap-2">
|
||||
@@ -304,10 +304,10 @@ export function CourseForm({
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label>تگها</Label>
|
||||
<Label>تگ ها</Label>
|
||||
{tags.length === 0 ? (
|
||||
<p className="text-xs text-muted-foreground">
|
||||
هنوز تگی تعریف نشده. از «تگهای دوره» اضافه کنید.
|
||||
هنوز تگی تعریف نشده. از «تگ های دوره» اضافه کنید.
|
||||
</p>
|
||||
) : (
|
||||
<div className="flex flex-wrap gap-2">
|
||||
@@ -419,12 +419,12 @@ export function CourseForm({
|
||||
<div>
|
||||
<h2 className="text-sm font-semibold text-foreground">رسانه و انتشار</h2>
|
||||
<p className="mt-0.5 text-xs text-muted-foreground">
|
||||
لینک ثبتنام، بارگذاری تصویر، SEO و وضعیت انتشار
|
||||
لینک ثبت نام، بارگذاری تصویر، SEO و وضعیت انتشار
|
||||
</p>
|
||||
</div>
|
||||
<div className="grid gap-4 sm:grid-cols-2">
|
||||
<div className="space-y-1.5 sm:col-span-2">
|
||||
<Label htmlFor="registrationUrl">لینک ثبتنام</Label>
|
||||
<Label htmlFor="registrationUrl">لینک ثبت نام</Label>
|
||||
<Input
|
||||
id="registrationUrl"
|
||||
value={form.registrationUrl}
|
||||
@@ -433,7 +433,7 @@ export function CourseForm({
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-1.5 sm:col-span-2">
|
||||
<Label>پوستر</Label>
|
||||
<Label>بنر (کارت)</Label>
|
||||
<ImageUploadField
|
||||
id="posterImageUrl"
|
||||
value={form.posterImageUrl}
|
||||
@@ -442,7 +442,7 @@ export function CourseForm({
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-1.5 sm:col-span-2">
|
||||
<Label>بروشور</Label>
|
||||
<Label>بروشور (جزئیات)</Label>
|
||||
<ImageUploadField
|
||||
id="brochureImageUrl"
|
||||
value={form.brochureImageUrl}
|
||||
@@ -469,8 +469,8 @@ export function CourseForm({
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="true">منتشرشده</SelectItem>
|
||||
<SelectItem value="false">پیشنویس</SelectItem>
|
||||
<SelectItem value="true">منتشر شده</SelectItem>
|
||||
<SelectItem value="false">پیش نویس</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { ArrowUpLeft, Clock, Layers, Wallet } from "lucide-react";
|
||||
import { Clock, Layers, Wallet } from "lucide-react";
|
||||
import { Container } from "@/components/atoms/Container";
|
||||
import { Heading } from "@/components/atoms/Heading";
|
||||
import { Section } from "@/components/atoms/Section";
|
||||
@@ -41,7 +41,6 @@ export function CourseDetailTemplate({
|
||||
labels: CourseDetailLabels;
|
||||
}) {
|
||||
const priceLabel = formatCoursePrice(course.price);
|
||||
const instructors = course.instructors ?? [];
|
||||
const details: DetailItem[] = [
|
||||
{ icon: Layers, label: labels.format, value: formatLabel(course.format) },
|
||||
...(course.durationHours
|
||||
@@ -61,6 +60,8 @@ export function CourseDetailTemplate({
|
||||
},
|
||||
];
|
||||
const hasTaxonomy = course.categories.length > 0 || course.tags.length > 0;
|
||||
const bannerUrl = course.posterImageUrl?.trim() || undefined;
|
||||
const brochureUrl = course.brochureImageUrl?.trim() || undefined;
|
||||
|
||||
return (
|
||||
<main id="main-content">
|
||||
@@ -69,75 +70,34 @@ export function CourseDetailTemplate({
|
||||
title={course.title}
|
||||
intro={course.summary}
|
||||
eyebrow={course.categories[0]?.label ?? course.tags[0]?.label}
|
||||
imageUrl={course.posterImageUrl}
|
||||
imageUrl={bannerUrl}
|
||||
/>
|
||||
|
||||
<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">
|
||||
<div className="relative aspect-[16/9] overflow-hidden rounded-2xl bg-muted ring-1 ring-foreground/10">
|
||||
<Image
|
||||
src={course.brochureImageUrl}
|
||||
alt={course.title}
|
||||
fill
|
||||
className="object-cover"
|
||||
sizes="(max-width:1024px) 100vw, 60vw"
|
||||
priority
|
||||
/>
|
||||
</div>
|
||||
{brochureUrl ? (
|
||||
<div className="relative aspect-[16/9] overflow-hidden rounded-2xl bg-muted ring-1 ring-foreground/10">
|
||||
<Image
|
||||
src={brochureUrl}
|
||||
alt={course.title}
|
||||
fill
|
||||
className="object-cover"
|
||||
sizes="(max-width:1024px) 100vw, 60vw"
|
||||
priority
|
||||
/>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
<section className="space-y-4">
|
||||
<Heading level={3} as="h2">
|
||||
{labels.aboutTitle}
|
||||
</Heading>
|
||||
<p className="text-base leading-8 text-foreground/90">
|
||||
<p className="text-base leading-7 text-foreground/90">
|
||||
{course.seoDescription || course.summary}
|
||||
</p>
|
||||
</section>
|
||||
|
||||
{instructors.length > 0 ? (
|
||||
<section className="space-y-4">
|
||||
<Heading level={3} as="h2">
|
||||
اساتید
|
||||
</Heading>
|
||||
<ul className="grid gap-3 sm:grid-cols-2">
|
||||
{instructors.map((person) => {
|
||||
const body = (
|
||||
<>
|
||||
<span className="block font-semibold text-foreground">
|
||||
{person.name}
|
||||
</span>
|
||||
{person.title ? (
|
||||
<span className="mt-1 block text-xs text-muted-foreground">
|
||||
{person.title}
|
||||
</span>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
return (
|
||||
<li key={person.id}>
|
||||
{person.profileUrl ? (
|
||||
<a
|
||||
href={person.profileUrl}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="group flex items-center justify-between gap-3 rounded-xl bg-card p-4 text-sm ring-1 ring-foreground/10 transition-shadow hover:shadow-md hover:ring-primary/25"
|
||||
>
|
||||
<span className="min-w-0">{body}</span>
|
||||
<ArrowUpLeft className="size-4 shrink-0 text-muted-foreground transition-colors group-hover:text-primary" />
|
||||
</a>
|
||||
) : (
|
||||
<div className="rounded-xl bg-card p-4 text-sm ring-1 ring-foreground/10">
|
||||
{body}
|
||||
</div>
|
||||
)}
|
||||
</li>
|
||||
);
|
||||
})}
|
||||
</ul>
|
||||
</section>
|
||||
) : null}
|
||||
|
||||
{hasTaxonomy ? (
|
||||
<section className="space-y-4">
|
||||
<Heading level={3} as="h2">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Link from "next/link";
|
||||
import Image from "next/image";
|
||||
import { Building2, Compass, Network } from "lucide-react";
|
||||
import { BookOpen, Building2, Compass } from "lucide-react";
|
||||
import { Container } from "@/components/atoms/Container";
|
||||
import { DotCta } from "@/components/atoms/DotCta";
|
||||
import { Heading } from "@/components/atoms/Heading";
|
||||
@@ -15,58 +15,20 @@ import {
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { CourseCardBanner } from "@/components/molecules/CourseCardBanner";
|
||||
import { HeroFeatured } from "@/components/molecules/HeroFeatured";
|
||||
import { IntersectionCard } from "@/components/molecules/Cards";
|
||||
import { SectionHeader } from "@/components/molecules/SectionHeader";
|
||||
import { StatGrid } from "@/components/molecules/StatGrid";
|
||||
import type {
|
||||
Article,
|
||||
Course,
|
||||
IntersectionTopic,
|
||||
SiteStat,
|
||||
} from "@/lib/types";
|
||||
import type { Article, Course } from "@/lib/types";
|
||||
import { formatCoursePrice, formatLabel } from "@/lib/labels";
|
||||
import { siteMission } from "@/lib/site-config";
|
||||
import { homeContent } from "@/lib/site-config";
|
||||
|
||||
const whyIcons = [Compass, BookOpen, Building2] as const;
|
||||
|
||||
export type HomeLabels = {
|
||||
executiveLabel: string;
|
||||
exploreOurPrograms: string;
|
||||
ideasTitle: string;
|
||||
eventsTitle: string;
|
||||
seeAllEvents: string;
|
||||
intersectionsTitle: string;
|
||||
intersectionsSubtitle: string;
|
||||
moreThanDegree: string;
|
||||
moreThanDegreeBody: string;
|
||||
keepExploring: string;
|
||||
hireTitle: string;
|
||||
hireBody: string;
|
||||
registerCta: string;
|
||||
missionTitle: string;
|
||||
findUsTitle: string;
|
||||
ideasEyebrow: string;
|
||||
linksTitle: string;
|
||||
exploreCourses?: string;
|
||||
ideasEyebrow: string;
|
||||
};
|
||||
|
||||
const ideas = [
|
||||
{
|
||||
icon: Compass,
|
||||
title: "پشتوانه علمی دانشگاه صنعتی امیرکبیر",
|
||||
text: "آموزش مدیریت در بستر دانشگاه صنعتی امیرکبیر، با تکیه بر دانش تخصصی، استدلال علمی و نگاه نقادانه.",
|
||||
},
|
||||
{
|
||||
icon: Building2,
|
||||
title: "پیوند مدیریت و فناوری",
|
||||
text: "نگاهی میانرشتهای به داده و هوش مصنوعی؛ با توجه به تأثیر آنها بر تصمیمهای مدیریتی، مدلهای کسبوکار و آینده صنعت.",
|
||||
},
|
||||
{
|
||||
icon: Network,
|
||||
title: "تمرکز بر مسائل صنعت",
|
||||
text: "توسعه توانمندی مدیران با توجه به چالشهای اجرای نوآوری، تغییر فرایندها و بهبود عملکرد سازمان.",
|
||||
},
|
||||
];
|
||||
|
||||
export function HomeHero({
|
||||
featured,
|
||||
eyebrow,
|
||||
@@ -85,6 +47,8 @@ export function HomeHero({
|
||||
}
|
||||
|
||||
export function HomeIdeas() {
|
||||
const { why } = homeContent;
|
||||
|
||||
return (
|
||||
<Section>
|
||||
<Container>
|
||||
@@ -92,30 +56,42 @@ export function HomeIdeas() {
|
||||
<div className="min-w-0 lg:sticky lg:top-28">
|
||||
<SectionHeader
|
||||
className="mb-0 sm:mb-0"
|
||||
eyebrow="چرا دانشگاه صنعتی امیرکبیر؟"
|
||||
title="مدیریت با پشتوانه دانش مهندسی"
|
||||
description="هویت مهندسی و فناورانه دانشگاه صنعتی امیرکبیر به آموزش مدیریت در این دانشگاه جهت میدهد. در مرکز آموزشهای آزاد دانشکده مدیریت، علم و فناوری، توسعه مدیران با شناخت فناوری و مسائل صنعت پیوند دارد."
|
||||
eyebrow={why.eyebrow}
|
||||
title={why.title}
|
||||
description={why.description}
|
||||
/>
|
||||
<Link
|
||||
href="/values"
|
||||
className={cn(
|
||||
buttonVariants({ variant: "outline", size: "lg" }),
|
||||
"mt-8 font-bold",
|
||||
)}
|
||||
>
|
||||
{why.valuesCta}
|
||||
</Link>
|
||||
</div>
|
||||
<div className="grid min-w-0 gap-8 md:grid-cols-3 lg:grid-cols-1 lg:gap-10">
|
||||
{ideas.map((item) => (
|
||||
<div
|
||||
key={item.title}
|
||||
className="flex min-w-0 flex-col gap-4 lg:flex-row lg:items-start lg:gap-5"
|
||||
>
|
||||
<div className="flex size-12 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary">
|
||||
<item.icon className="size-6" />
|
||||
{why.pillars.map((item, index) => {
|
||||
const Icon = whyIcons[index] ?? Compass;
|
||||
return (
|
||||
<div
|
||||
key={item.title}
|
||||
className="flex min-w-0 flex-col gap-4 lg:flex-row lg:items-start lg:gap-5"
|
||||
>
|
||||
<div className="flex size-12 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary">
|
||||
<Icon className="size-6" />
|
||||
</div>
|
||||
<div className="min-w-0">
|
||||
<Heading as="h3" level={3}>
|
||||
{item.title}
|
||||
</Heading>
|
||||
<p className="mt-2 text-base leading-7 text-muted-foreground">
|
||||
{item.text}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="min-w-0">
|
||||
<Heading as="h3" level={3}>
|
||||
{item.title}
|
||||
</Heading>
|
||||
<p className="mt-2 text-sm leading-7 text-muted-foreground">
|
||||
{item.text}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</Container>
|
||||
@@ -125,22 +101,25 @@ export function HomeIdeas() {
|
||||
|
||||
export function HomeCourseSearch({
|
||||
courses,
|
||||
exploreLabel = "مشاهده دورهها",
|
||||
exploreLabel = "مشاهده دوره ها",
|
||||
}: {
|
||||
courses: Course[];
|
||||
exploreLabel?: string;
|
||||
}) {
|
||||
const { courses: coursesCopy } = homeContent;
|
||||
|
||||
return (
|
||||
<Section tone="dark" className="overflow-hidden">
|
||||
<Container>
|
||||
<SectionHeader
|
||||
inverse
|
||||
eyebrow="دورههای کوتاه"
|
||||
title="جدیدترین دورهها"
|
||||
eyebrow={coursesCopy.eyebrow}
|
||||
title={coursesCopy.title}
|
||||
description={coursesCopy.description}
|
||||
/>
|
||||
{courses.length === 0 ? (
|
||||
<p className="py-10 text-center text-sm text-background/60">
|
||||
در حال حاضر دورهای برای نمایش نیست.
|
||||
<p className="py-10 text-center text-sm text-primary-foreground/60">
|
||||
در حال حاضر دوره ای برای نمایش نیست.
|
||||
</p>
|
||||
) : (
|
||||
<div className="grid gap-5 sm:grid-cols-2 lg:grid-cols-3">
|
||||
@@ -149,39 +128,36 @@ export function HomeCourseSearch({
|
||||
return (
|
||||
<Card
|
||||
key={course.id}
|
||||
className="group relative gap-0 overflow-hidden bg-background/5 py-0 text-background ring-background/10 transition-colors hover:ring-background/30"
|
||||
className="group relative gap-0 overflow-hidden bg-primary-foreground/5 py-0 text-primary-foreground ring-primary-foreground/10 transition-colors hover:ring-primary-foreground/30"
|
||||
>
|
||||
{/* Full-card hit target sits under content */}
|
||||
<Link
|
||||
href={course.registrationUrl}
|
||||
className="absolute inset-0 z-0"
|
||||
aria-label={course.title}
|
||||
tabIndex={-1}
|
||||
/>
|
||||
<div className="relative aspect-[16/10] overflow-hidden">
|
||||
<Image
|
||||
src={course.posterImageUrl}
|
||||
alt={course.title}
|
||||
fill
|
||||
className="object-cover transition-transform duration-300 group-hover:scale-[1.03]"
|
||||
sizes="(max-width:768px) 100vw, 33vw"
|
||||
/>
|
||||
</div>
|
||||
<CardHeader className="relative z-[1] gap-1 px-4 pt-4">
|
||||
<CardTitle className="text-base text-background">
|
||||
<CourseCardBanner
|
||||
title={course.title}
|
||||
bannerUrl={course.posterImageUrl}
|
||||
/>
|
||||
<CardHeader className="pointer-events-none relative z-[1] gap-1 px-4 pt-4">
|
||||
<CardTitle className="text-base text-primary-foreground">
|
||||
{course.title}
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="relative z-[1] space-y-3 px-4 pb-4">
|
||||
<CardDescription className="line-clamp-2 text-background/70">
|
||||
<CardContent className="pointer-events-none relative z-[1] space-y-3 px-4 pb-4">
|
||||
<CardDescription className="line-clamp-2 text-primary-foreground/70">
|
||||
{course.summary}
|
||||
</CardDescription>
|
||||
<div className="flex flex-wrap items-center justify-between gap-2 text-xs text-background/55">
|
||||
<div className="flex flex-wrap items-center justify-between gap-2 text-xs text-primary-foreground/55">
|
||||
<span>
|
||||
{course.durationHours
|
||||
? `${course.durationHours} ساعت · ${formatLabel(course.format)}`
|
||||
: formatLabel(course.format)}
|
||||
</span>
|
||||
{priceLabel ? (
|
||||
<span className="font-semibold text-background/90">
|
||||
<span className="font-semibold text-primary-foreground/90">
|
||||
{priceLabel}
|
||||
</span>
|
||||
) : null}
|
||||
@@ -209,19 +185,24 @@ export function HomeCourseSearch({
|
||||
}
|
||||
|
||||
export function HomeApproach() {
|
||||
const { approach } = homeContent;
|
||||
|
||||
return (
|
||||
<Section>
|
||||
<Container>
|
||||
<div className="overflow-hidden rounded-2xl bg-chart-3 text-background">
|
||||
<div className="overflow-hidden rounded-2xl bg-primary text-primary-foreground">
|
||||
<div className="grid min-w-0 lg:grid-cols-2">
|
||||
<div className="relative z-[1] order-2 flex min-w-0 flex-col justify-center px-6 py-10 sm:px-10 lg:order-1 lg:min-h-[22rem] lg:px-12 lg:py-14">
|
||||
<SectionHeader
|
||||
inverse
|
||||
className="mb-0 sm:mb-0"
|
||||
eyebrow="رویکرد آموزشی ما"
|
||||
title="دانش دانشگاه صنعتی امیرکبیر، در خدمت تحول صنعت"
|
||||
description="دانشگاه صنعتی امیرکبیر، دانش تخصصی و چارچوبهای مدیریتی را برای مواجهه با چالشهای صنعت در اختیار مدیران قرار میدهد؛ از شناخت ظرفیتهای داده و هوش مصنوعی تا ارزیابی تصمیمها و راهبری نوآوری در سازمان."
|
||||
eyebrow={approach.eyebrow}
|
||||
title={approach.title}
|
||||
description={approach.description}
|
||||
/>
|
||||
<p className="mt-6 text-sm font-medium text-primary-foreground/70">
|
||||
{approach.steps.join(" · ")}
|
||||
</p>
|
||||
<Link
|
||||
href="/about"
|
||||
className={cn(
|
||||
@@ -229,13 +210,13 @@ export function HomeApproach() {
|
||||
"mt-8 w-fit font-bold",
|
||||
)}
|
||||
>
|
||||
آشنایی با رویکرد ما
|
||||
{approach.ctaLabel}
|
||||
</Link>
|
||||
</div>
|
||||
<div className="relative order-1 aspect-[16/10] min-h-0 lg:order-2 lg:aspect-auto lg:min-h-full lg:self-stretch">
|
||||
<Image
|
||||
src="/brand/campus-collaboration-v1.png"
|
||||
alt="همکاری مدرسان و متخصصان در محیط دانشگاه"
|
||||
alt="رویکرد آموزشی مرکز آموزش های آزاد"
|
||||
fill
|
||||
className="object-cover"
|
||||
sizes="(max-width:1024px) 100vw, 50vw"
|
||||
@@ -248,63 +229,82 @@ export function HomeApproach() {
|
||||
);
|
||||
}
|
||||
|
||||
export function HomeRest({
|
||||
labels,
|
||||
intersections,
|
||||
stats,
|
||||
}: {
|
||||
labels: HomeLabels;
|
||||
intersections: IntersectionTopic[];
|
||||
stats: SiteStat[];
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Section tone="muted">
|
||||
<Container>
|
||||
<SectionHeader
|
||||
eyebrow="حوزههای آموزشی"
|
||||
title={labels.intersectionsTitle}
|
||||
description={labels.intersectionsSubtitle}
|
||||
/>
|
||||
<div className="grid min-w-0 gap-4 sm:grid-cols-2 lg:grid-cols-4">
|
||||
{intersections.map((topic) => (
|
||||
<IntersectionCard key={topic.id} {...topic} />
|
||||
))}
|
||||
</div>
|
||||
</Container>
|
||||
</Section>
|
||||
export function HomeEventsTeaser() {
|
||||
const { events } = homeContent;
|
||||
|
||||
<Section tone="dark" className="overflow-hidden">
|
||||
<MetamorphField tone="dark" density="sparse" className="opacity-40" />
|
||||
<Container className="relative z-[1] grid min-w-0 gap-8 lg:grid-cols-[minmax(0,1fr)_auto] lg:items-end lg:gap-12">
|
||||
return (
|
||||
<Section>
|
||||
<Container>
|
||||
<div className="grid min-w-0 gap-8 lg:grid-cols-[minmax(0,1fr)_auto] lg:items-end lg:gap-12">
|
||||
<SectionHeader
|
||||
inverse
|
||||
className="mb-0 sm:mb-0"
|
||||
eyebrow="همکاری با سازمانها"
|
||||
title={labels.hireTitle}
|
||||
description={labels.hireBody}
|
||||
eyebrow={events.eyebrow}
|
||||
title={events.title}
|
||||
description={events.description}
|
||||
/>
|
||||
<div className="shrink-0">
|
||||
<DotCta href="/professional" onDark>
|
||||
{labels.registerCta}
|
||||
</DotCta>
|
||||
<DotCta href="/events">{events.ctaLabel}</DotCta>
|
||||
</div>
|
||||
</Container>
|
||||
</Section>
|
||||
</div>
|
||||
</Container>
|
||||
</Section>
|
||||
);
|
||||
}
|
||||
|
||||
<Section>
|
||||
<Container className="max-w-4xl">
|
||||
<SectionHeader
|
||||
align="center"
|
||||
eyebrow={labels.missionTitle}
|
||||
title={siteMission}
|
||||
/>
|
||||
<StatGrid
|
||||
stats={stats}
|
||||
className="border-t border-border pt-10"
|
||||
/>
|
||||
</Container>
|
||||
</Section>
|
||||
</>
|
||||
export function HomeTeams() {
|
||||
const { teams } = homeContent;
|
||||
|
||||
return (
|
||||
<Section tone="dark" className="overflow-hidden">
|
||||
<MetamorphField tone="dark" density="sparse" className="opacity-40" />
|
||||
<Container className="relative z-[1] grid min-w-0 gap-8 lg:grid-cols-[minmax(0,1fr)_auto] lg:items-end lg:gap-12">
|
||||
<SectionHeader
|
||||
inverse
|
||||
className="mb-0 sm:mb-0"
|
||||
eyebrow={teams.eyebrow}
|
||||
title={teams.title}
|
||||
description={teams.description}
|
||||
/>
|
||||
<div className="shrink-0">
|
||||
<DotCta href="/professional" onDark>
|
||||
{teams.ctaLabel}
|
||||
</DotCta>
|
||||
</div>
|
||||
</Container>
|
||||
</Section>
|
||||
);
|
||||
}
|
||||
|
||||
export function HomeClosing() {
|
||||
const { closing } = homeContent;
|
||||
|
||||
return (
|
||||
<Section>
|
||||
<Container className="max-w-4xl">
|
||||
<SectionHeader
|
||||
align="center"
|
||||
eyebrow={closing.eyebrow}
|
||||
title={closing.title}
|
||||
description={closing.description}
|
||||
/>
|
||||
<div className="flex flex-wrap items-center justify-center gap-3">
|
||||
<Link
|
||||
href="/professional"
|
||||
className={cn(buttonVariants({ size: "lg" }), "font-bold")}
|
||||
>
|
||||
{closing.primaryCta}
|
||||
</Link>
|
||||
<Link
|
||||
href="/about"
|
||||
className={cn(
|
||||
buttonVariants({ variant: "outline", size: "lg" }),
|
||||
"font-bold",
|
||||
)}
|
||||
>
|
||||
{closing.secondaryCta}
|
||||
</Link>
|
||||
</div>
|
||||
</Container>
|
||||
</Section>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user