Implement faculty page redirect and enhance course management features. Added a redirect for the faculty page to an external URL. Updated course data structure to include new fields for poster and brochure images, and introduced tagging functionality for courses. Enhanced admin course filters to support tag-based filtering and improved course form for tag management. Updated navigation links to reflect changes in course and faculty structure.
This commit is contained in:
1 parent
0e2fcaacdd
commit
ab7fcd41d8
22 files changed
+544
-167
No files matched your search
@@ -1,41 +1,5 @@
|
||||
import type { Metadata } from "next";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { Container } from "@/components/atoms/Container";
|
||||
import { Section } from "@/components/atoms/Section";
|
||||
import { FacultyMemberCard } from "@/components/molecules/FacultyMemberCard";
|
||||
import { PageHero } from "@/components/molecules/PageHero";
|
||||
import { getFaculty } from "@/lib/data/site";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
const t = await getTranslations("pages");
|
||||
return { title: t("facultyTitle"), description: t("facultyIntro") };
|
||||
}
|
||||
|
||||
export default async function FacultyPage() {
|
||||
const t = await getTranslations("pages");
|
||||
let members: Awaited<ReturnType<typeof getFaculty>> = [];
|
||||
try {
|
||||
members = await getFaculty();
|
||||
} catch (err) {
|
||||
console.error("[faculty] getFaculty failed:", err);
|
||||
}
|
||||
|
||||
return (
|
||||
<main id="main-content">
|
||||
<PageHero title={t("facultyTitle")} intro={t("facultyIntro")} />
|
||||
<Section className="bg-gradient-to-b from-background to-muted/40">
|
||||
<Container>
|
||||
{members.length === 0 ? (
|
||||
<p className="text-muted-foreground">در حال حاضر مدرسی برای نمایش نیست.</p>
|
||||
) : (
|
||||
<div className="grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
|
||||
{members.map((member) => (
|
||||
<FacultyMemberCard key={member.id} member={member} />
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</Container>
|
||||
</Section>
|
||||
</main>
|
||||
);
|
||||
export default function FacultyPage() {
|
||||
redirect("https://mst.aut.ac.ir/content/31094/شبکه-اساتید");
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import Link from "next/link";
|
||||
import { listAdminCourses } from "@/lib/data/admin/courses";
|
||||
import { listAdminCourses, listCourseTags } from "@/lib/data/admin/courses";
|
||||
import { CourseTable } from "@/components/organisms/admin/courses/CourseTable";
|
||||
import { CourseFilters } from "@/components/organisms/admin/courses/CourseFilters";
|
||||
import {
|
||||
@@ -16,13 +16,14 @@ export const dynamic = "force-dynamic";
|
||||
export default async function AdminCoursesPage({
|
||||
searchParams,
|
||||
}: {
|
||||
searchParams: Promise<{ search?: string; published?: string }>;
|
||||
searchParams: Promise<{ search?: string; published?: string; tag?: string }>;
|
||||
}) {
|
||||
const { search = "", published: publishedRaw } = await searchParams;
|
||||
const { search = "", published: publishedRaw, tag } = await searchParams;
|
||||
const published =
|
||||
publishedRaw === "true" ? true : publishedRaw === "false" ? false : undefined;
|
||||
|
||||
const courses = await listAdminCourses({ search, published });
|
||||
const courses = await listAdminCourses({ search, published, tag });
|
||||
const availableTags = await listCourseTags();
|
||||
|
||||
return (
|
||||
<AdminPage>
|
||||
@@ -36,10 +37,12 @@ export default async function AdminCoursesPage({
|
||||
}
|
||||
/>
|
||||
|
||||
<AdminToolbarCard description="جستجو بر اساس عنوان یا اسلاگ و فیلتر وضعیت انتشار">
|
||||
<AdminToolbarCard description="جستجو بر اساس عنوان یا اسلاگ، فیلتر وضعیت انتشار و تگها">
|
||||
<CourseFilters
|
||||
initialSearch={search}
|
||||
initialPublished={publishedRaw ?? "all"}
|
||||
initialTag={tag ?? ""}
|
||||
availableTags={availableTags}
|
||||
/>
|
||||
</AdminToolbarCard>
|
||||
|
||||
|
||||
@@ -38,8 +38,10 @@ const COURSE_COLUMNS: Record<string, string> = {
|
||||
format: "format",
|
||||
price: "price",
|
||||
registrationUrl: "registration_url",
|
||||
imageUrl: "image_url",
|
||||
posterImageUrl: "poster_image_url",
|
||||
brochureImageUrl: "brochure_image_url",
|
||||
seoDescription: "seo_description",
|
||||
tags: "tags",
|
||||
published: "published",
|
||||
};
|
||||
|
||||
|
||||
@@ -56,11 +56,11 @@ export async function POST(request: NextRequest) {
|
||||
await query(
|
||||
`INSERT INTO courses
|
||||
(id, slug, title, summary, category, duration_hours, format, price,
|
||||
registration_url, image_url, seo_description, published)
|
||||
VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12)`,
|
||||
registration_url, poster_image_url, brochure_image_url, image_url, seo_description, tags, published)
|
||||
VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15)`,
|
||||
[
|
||||
id, d.slug, d.title, d.summary, d.category, d.durationHours ?? null, d.format,
|
||||
d.price ?? null, d.registrationUrl, d.imageUrl, d.seoDescription, d.published,
|
||||
d.price ?? null, d.registrationUrl, d.posterImageUrl, d.brochureImageUrl, d.posterImageUrl, d.seoDescription, d.tags ?? [], d.published,
|
||||
],
|
||||
);
|
||||
const res = await query<CourseRow>(`SELECT * FROM courses WHERE id = $1`, [id]);
|
||||
|
||||
@@ -6,6 +6,7 @@ import Link from "next/link";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
@@ -21,28 +22,49 @@ import { cn } from "@/lib/utils";
|
||||
export function CategoryCourseExplorer({
|
||||
courses,
|
||||
findLabel,
|
||||
tagsLabel = "دستهبندیها",
|
||||
}: {
|
||||
courses: Course[];
|
||||
findLabel: string;
|
||||
tagsLabel?: string;
|
||||
}) {
|
||||
const [query, setQuery] = useState("");
|
||||
const [category, setCategory] = useState("all");
|
||||
const [tag, setTag] = useState("");
|
||||
const deferredQuery = useDeferredValue(query);
|
||||
const isStale = query !== deferredQuery;
|
||||
|
||||
// Distinct tags across all courses (stable order: most used first).
|
||||
const tags = useMemo(() => {
|
||||
const counts = new Map<string, number>();
|
||||
for (const course of courses) {
|
||||
for (const t of course.tags ?? []) {
|
||||
counts.set(t, (counts.get(t) ?? 0) + 1);
|
||||
}
|
||||
}
|
||||
return [...counts.entries()].sort((a, b) => b[1] - a[1]).map(([t]) => t);
|
||||
}, [courses]);
|
||||
|
||||
const filtered = useMemo(() => {
|
||||
return courses.filter((course) => {
|
||||
const matchesCategory =
|
||||
category === "all" ||
|
||||
category === "best" ||
|
||||
course.category === category;
|
||||
const matchesTag = !tag || (course.tags ?? []).includes(tag);
|
||||
const matchesQuery =
|
||||
!deferredQuery ||
|
||||
course.title.includes(deferredQuery) ||
|
||||
course.summary.includes(deferredQuery);
|
||||
return matchesCategory && matchesQuery;
|
||||
return matchesCategory && matchesTag && matchesQuery;
|
||||
});
|
||||
}, [courses, category, deferredQuery]);
|
||||
}, [courses, category, tag, deferredQuery]);
|
||||
|
||||
const resetFilters = () => {
|
||||
setCategory("all");
|
||||
setTag("");
|
||||
setQuery("");
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="space-y-8">
|
||||
@@ -90,65 +112,162 @@ export function CategoryCourseExplorer({
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div
|
||||
className={cn(
|
||||
"grid gap-5 transition-opacity sm:grid-cols-2 lg:grid-cols-3",
|
||||
isStale && "opacity-70",
|
||||
)}
|
||||
>
|
||||
{filtered.map((course) => {
|
||||
const priceLabel = formatCoursePrice(course.price);
|
||||
return (
|
||||
<Card
|
||||
key={course.id}
|
||||
className="gap-0 overflow-hidden bg-background/5 py-0 text-background ring-background/10"
|
||||
>
|
||||
<div className="relative aspect-[16/10] overflow-hidden">
|
||||
<Image
|
||||
src={course.imageUrl}
|
||||
alt={course.title}
|
||||
fill
|
||||
className="object-cover"
|
||||
sizes="(max-width:768px) 100vw, 33vw"
|
||||
/>
|
||||
</div>
|
||||
<CardHeader className="gap-1 px-4 pt-4">
|
||||
<CardTitle className="text-base text-background">
|
||||
<Link
|
||||
href={course.registrationUrl}
|
||||
className="transition-opacity hover:opacity-90"
|
||||
>
|
||||
{course.title}
|
||||
</Link>
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-3 px-4 pb-4">
|
||||
<CardDescription className="line-clamp-3 text-background/70">
|
||||
{course.summary}
|
||||
</CardDescription>
|
||||
<div className="flex flex-wrap items-center justify-between gap-2 text-xs text-background/55">
|
||||
<span>
|
||||
{course.durationHours
|
||||
? `${course.durationHours} ساعت · ${formatLabel(course.format)}`
|
||||
: formatLabel(course.format)}
|
||||
</span>
|
||||
{priceLabel ? (
|
||||
<span className="font-semibold text-background/90">
|
||||
{priceLabel}
|
||||
</span>
|
||||
) : null}
|
||||
</div>
|
||||
<Link
|
||||
href={course.registrationUrl}
|
||||
className="inline-flex text-sm font-semibold text-background underline-offset-4 hover:underline"
|
||||
{tags.length > 0 ? (
|
||||
<div className="space-y-3">
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<span className="text-sm font-semibold text-background/80">
|
||||
{tagsLabel}
|
||||
</span>
|
||||
<Button
|
||||
type="button"
|
||||
size="sm"
|
||||
variant={tag === "" ? "default" : "ghost"}
|
||||
aria-selected={tag === ""}
|
||||
onClick={() => setTag("")}
|
||||
className={cn(
|
||||
tag !== "" &&
|
||||
"bg-background/10 text-background/85 hover:bg-background/20 hover:text-background",
|
||||
)}
|
||||
>
|
||||
همه
|
||||
</Button>
|
||||
{tags.map((item) => (
|
||||
<Button
|
||||
key={item}
|
||||
type="button"
|
||||
size="sm"
|
||||
variant={tag === item ? "default" : "ghost"}
|
||||
aria-selected={tag === item}
|
||||
onClick={() => setTag(tag === item ? "" : item)}
|
||||
className={cn(
|
||||
tag !== item &&
|
||||
"bg-background/10 text-background/85 hover:bg-background/20 hover:text-background",
|
||||
)}
|
||||
>
|
||||
جزئیات و ثبتنام
|
||||
</Link>
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
{item}
|
||||
</Button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{(tag !== "" || category !== "all") && (
|
||||
<div className="flex flex-wrap items-center gap-2 text-xs text-background/60">
|
||||
<span>فیلترهای فعال:</span>
|
||||
{category !== "all" && (
|
||||
<Badge variant="secondary" className="gap-1 py-0.5 pe-1">
|
||||
{courseCategories.find((c) => c.id === category)?.label ?? category}
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setCategory("all")}
|
||||
className="rounded-full p-0.5 hover:bg-foreground/10"
|
||||
aria-label="حذف فیلتر دستهبندی"
|
||||
>
|
||||
×
|
||||
</button>
|
||||
</Badge>
|
||||
)}
|
||||
{tag !== "" && (
|
||||
<Badge variant="secondary" className="gap-1 py-0.5 pe-1">
|
||||
{tag}
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setTag("")}
|
||||
className="rounded-full p-0.5 hover:bg-foreground/10"
|
||||
aria-label="حذف فیلتر تگ"
|
||||
>
|
||||
×
|
||||
</button>
|
||||
</Badge>
|
||||
)}
|
||||
<button
|
||||
type="button"
|
||||
onClick={resetFilters}
|
||||
className="underline underline-offset-4 hover:text-background"
|
||||
>
|
||||
پاککردن همه
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{filtered.length === 0 ? (
|
||||
<p className="py-10 text-center text-sm text-background/60">
|
||||
دورهای با این فیلترها یافت نشد.
|
||||
</p>
|
||||
) : (
|
||||
<div
|
||||
className={cn(
|
||||
"grid gap-5 transition-opacity sm:grid-cols-2 lg:grid-cols-3",
|
||||
isStale && "opacity-70",
|
||||
)}
|
||||
>
|
||||
{filtered.map((course) => {
|
||||
const priceLabel = formatCoursePrice(course.price);
|
||||
return (
|
||||
<Card
|
||||
key={course.id}
|
||||
className="gap-0 overflow-hidden bg-background/5 py-0 text-background ring-background/10"
|
||||
>
|
||||
<div className="relative aspect-[16/10] overflow-hidden">
|
||||
<Image
|
||||
src={course.posterImageUrl}
|
||||
alt={course.title}
|
||||
fill
|
||||
className="object-cover"
|
||||
sizes="(max-width:768px) 100vw, 33vw"
|
||||
/>
|
||||
</div>
|
||||
<CardHeader className="gap-1 px-4 pt-4">
|
||||
<CardTitle className="text-base text-background">
|
||||
<Link
|
||||
href={course.registrationUrl}
|
||||
className="transition-opacity hover:opacity-90"
|
||||
>
|
||||
{course.title}
|
||||
</Link>
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-3 px-4 pb-4">
|
||||
<CardDescription className="line-clamp-3 text-background/70">
|
||||
{course.summary}
|
||||
</CardDescription>
|
||||
{course.tags && course.tags.length > 0 ? (
|
||||
<div className="flex flex-wrap gap-1.5">
|
||||
{course.tags.map((t) => (
|
||||
<Badge
|
||||
key={t}
|
||||
variant="outline"
|
||||
className="border-background/25 text-[10px] text-background/80"
|
||||
>
|
||||
{t}
|
||||
</Badge>
|
||||
))}
|
||||
</div>
|
||||
) : null}
|
||||
<div className="flex flex-wrap items-center justify-between gap-2 text-xs text-background/55">
|
||||
<span>
|
||||
{course.durationHours
|
||||
? `${course.durationHours} ساعت · ${formatLabel(course.format)}`
|
||||
: formatLabel(course.format)}
|
||||
</span>
|
||||
{priceLabel ? (
|
||||
<span className="font-semibold text-background/90">
|
||||
{priceLabel}
|
||||
</span>
|
||||
) : null}
|
||||
</div>
|
||||
<Link
|
||||
href={course.registrationUrl}
|
||||
className="inline-flex text-sm font-semibold text-background underline-offset-4 hover:underline"
|
||||
>
|
||||
جزئیات و ثبتنام
|
||||
</Link>
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,12 @@ import { BrandLogo } from "@/components/atoms/BrandLogo";
|
||||
import { Container } from "@/components/atoms/Container";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Separator } from "@/components/ui/separator";
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuTrigger,
|
||||
} from "@/components/ui/dropdown-menu";
|
||||
import { SearchOverlay } from "@/components/organisms/SearchOverlay";
|
||||
import type { Course, NavItem, Program } from "@/lib/types";
|
||||
import { cn } from "@/lib/utils";
|
||||
@@ -85,20 +91,79 @@ export function SiteHeader({
|
||||
className="hidden min-w-0 flex-1 items-center justify-start gap-0.5 xl:flex"
|
||||
aria-label="منوی اصلی"
|
||||
>
|
||||
{items.map((item) => (
|
||||
<Link
|
||||
key={item.href + item.label}
|
||||
href={item.href}
|
||||
className={cn(
|
||||
"rounded-lg px-2.5 py-2 text-sm font-semibold transition-colors",
|
||||
isDark
|
||||
? "text-background/80 hover:text-background"
|
||||
: "text-foreground/75 hover:bg-muted hover:text-primary",
|
||||
)}
|
||||
>
|
||||
{item.label}
|
||||
</Link>
|
||||
))}
|
||||
{items.map((item) => {
|
||||
if (item.label.includes("دورهها") || item.label.includes("فهرست")) {
|
||||
return (
|
||||
<DropdownMenu key={item.href + item.label}>
|
||||
<DropdownMenuTrigger
|
||||
className={cn(
|
||||
"rounded-lg px-2.5 py-2 text-sm font-semibold transition-colors outline-none cursor-pointer inline-flex items-center gap-1",
|
||||
isDark
|
||||
? "text-background/80 hover:text-background"
|
||||
: "text-foreground/75 hover:bg-muted hover:text-primary",
|
||||
)}
|
||||
>
|
||||
{item.label}
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent className="z-[60] w-56 p-1">
|
||||
<DropdownMenuItem>
|
||||
<Link href="/professional" className="w-full cursor-pointer">
|
||||
همه دورهها
|
||||
</Link>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem>
|
||||
<Link href="/professional#programs" className="w-full cursor-pointer">
|
||||
کارگاهها
|
||||
</Link>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem>
|
||||
<Link href="/professional#programs" className="w-full cursor-pointer">
|
||||
دورههای سازمانی
|
||||
</Link>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem>
|
||||
<Link href="/professional#programs" className="w-full cursor-pointer">
|
||||
گزیده دورههای برگزار شده
|
||||
</Link>
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
);
|
||||
}
|
||||
return item.prominent ? (
|
||||
<Link
|
||||
key={item.href + item.label}
|
||||
href={item.href}
|
||||
target={item.href.startsWith("http") ? "_blank" : undefined}
|
||||
rel={
|
||||
item.href.startsWith("http")
|
||||
? "noopener noreferrer"
|
||||
: undefined
|
||||
}
|
||||
className={cn(
|
||||
"ms-1 inline-flex items-center rounded-md border px-2.5 py-1 text-xs font-bold transition-all shadow-sm",
|
||||
isDark
|
||||
? "border-primary-foreground/30 bg-primary-foreground/10 text-primary-foreground hover:bg-primary-foreground hover:text-primary"
|
||||
: "border-primary/30 bg-primary/10 text-primary hover:bg-primary hover:text-primary-foreground",
|
||||
)}
|
||||
>
|
||||
{item.label}
|
||||
</Link>
|
||||
) : (
|
||||
<Link
|
||||
key={item.href + item.label}
|
||||
href={item.href}
|
||||
className={cn(
|
||||
"rounded-lg px-2.5 py-2 text-sm font-semibold transition-colors",
|
||||
isDark
|
||||
? "text-background/80 hover:text-background"
|
||||
: "text-foreground/75 hover:bg-muted hover:text-primary",
|
||||
)}
|
||||
>
|
||||
{item.label}
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
@@ -174,7 +239,19 @@ export function SiteHeader({
|
||||
<li key={item.href + item.label}>
|
||||
<Link
|
||||
href={item.href}
|
||||
className="block py-3.5 text-lg font-bold transition-colors hover:text-background/70"
|
||||
target={
|
||||
item.href.startsWith("http") ? "_blank" : undefined
|
||||
}
|
||||
rel={
|
||||
item.href.startsWith("http")
|
||||
? "noopener noreferrer"
|
||||
: undefined
|
||||
}
|
||||
className={cn(
|
||||
"block py-3.5 text-lg font-bold transition-colors hover:text-background/70",
|
||||
item.prominent &&
|
||||
"inline-block text-primary underline underline-offset-4"
|
||||
)}
|
||||
onClick={() => setMobileOpen(false)}
|
||||
>
|
||||
{item.label}
|
||||
|
||||
@@ -12,10 +12,11 @@ import {
|
||||
SelectValue,
|
||||
} from "@/components/ui/select";
|
||||
|
||||
function buildUrl(search: string, published: string) {
|
||||
function buildUrl(search: string, published: string, tag: string) {
|
||||
const params = new URLSearchParams();
|
||||
if (search.trim()) params.set("search", search.trim());
|
||||
if (published && published !== "all") params.set("published", published);
|
||||
if (tag && tag.trim()) params.set("tag", tag.trim());
|
||||
const qs = params.toString();
|
||||
return qs ? `/admin/courses?${qs}` : "/admin/courses";
|
||||
}
|
||||
@@ -23,46 +24,48 @@ function buildUrl(search: string, published: string) {
|
||||
export function CourseFilters({
|
||||
initialSearch,
|
||||
initialPublished,
|
||||
initialTag,
|
||||
availableTags,
|
||||
}: {
|
||||
initialSearch: string;
|
||||
initialPublished: string;
|
||||
initialTag: string;
|
||||
availableTags: string[];
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [search, setSearch] = useState(initialSearch);
|
||||
const [published, setPublished] = useState(initialPublished);
|
||||
const hasFilters = Boolean(initialSearch.trim()) || initialPublished !== "all";
|
||||
const [tag, setTag] = useState(initialTag);
|
||||
const hasFilters = Boolean(search.trim()) || published !== "all" || Boolean(tag.trim());
|
||||
|
||||
function apply(e: React.FormEvent) {
|
||||
e.preventDefault();
|
||||
router.push(buildUrl(search, published));
|
||||
router.push(buildUrl(search, published, tag));
|
||||
}
|
||||
|
||||
function clear() {
|
||||
setSearch("");
|
||||
setPublished("all");
|
||||
setTag("");
|
||||
router.push("/admin/courses");
|
||||
}
|
||||
|
||||
return (
|
||||
<form
|
||||
onSubmit={apply}
|
||||
className="flex flex-wrap items-end gap-3"
|
||||
>
|
||||
<form onSubmit={apply} className="flex flex-wrap items-end gap-3">
|
||||
{/* ... search input ... */}
|
||||
<div className="w-full max-w-xs space-y-1.5">
|
||||
<label htmlFor="course-search" className="text-sm font-medium">
|
||||
جستجو
|
||||
</label>
|
||||
<label htmlFor="course-search" className="text-sm font-medium">جستجو</label>
|
||||
<Input
|
||||
id="course-search"
|
||||
placeholder="عنوان یا اسلاگ دوره..."
|
||||
placeholder="عنوان یا اسلاگ..."
|
||||
value={search}
|
||||
onChange={(e) => setSearch(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* ... published select ... */}
|
||||
<div className="w-full max-w-[12rem] space-y-1.5">
|
||||
<label htmlFor="course-published" className="text-sm font-medium">
|
||||
وضعیت انتشار
|
||||
</label>
|
||||
<label htmlFor="course-published" className="text-sm font-medium">وضعیت انتشار</label>
|
||||
<Select value={published} onValueChange={(v) => setPublished(v ?? "all")}>
|
||||
<SelectTrigger id="course-published" className="w-full">
|
||||
<SelectValue />
|
||||
@@ -74,11 +77,26 @@ export function CourseFilters({
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
{/* ... tag select ... */}
|
||||
<div className="w-full max-w-[12rem] space-y-1.5">
|
||||
<label htmlFor="course-tag" className="text-sm font-medium">تگ</label>
|
||||
<Select value={tag} onValueChange={(v) => setTag(v ?? "")}>
|
||||
<SelectTrigger id="course-tag" className="w-full">
|
||||
<SelectValue placeholder="همه" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="">همه</SelectItem>
|
||||
{availableTags.map((t) => (
|
||||
<SelectItem key={t} value={t}>{t}</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
<Button type="submit">اعمال فیلتر</Button>
|
||||
{hasFilters && (
|
||||
<Button type="button" variant="ghost" onClick={clear}>
|
||||
پاککردن فیلترها
|
||||
</Button>
|
||||
<Button type="button" variant="ghost" onClick={clear}>پاککردن فیلترها</Button>
|
||||
)}
|
||||
</form>
|
||||
);
|
||||
|
||||
@@ -16,9 +16,17 @@ import {
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@/components/ui/select";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Plus, X } from "lucide-react";
|
||||
import type { AdminCourse } from "@/lib/data/admin/courses";
|
||||
import { AdminFormCard } from "@/components/organisms/admin/AdminPage";
|
||||
|
||||
const SUGGESTED_TAGS = [
|
||||
"کارگاهها",
|
||||
"دورههای سازمانی",
|
||||
"گزیده دورههای برگزار شده",
|
||||
];
|
||||
|
||||
type Payload = {
|
||||
slug: string;
|
||||
title: string;
|
||||
@@ -28,8 +36,10 @@ type Payload = {
|
||||
format: string;
|
||||
price: number | null;
|
||||
registrationUrl: string;
|
||||
imageUrl: string;
|
||||
posterImageUrl: string;
|
||||
brochureImageUrl: string;
|
||||
seoDescription: string;
|
||||
tags: string[];
|
||||
published: boolean;
|
||||
};
|
||||
|
||||
@@ -49,13 +59,16 @@ export function CourseForm({ initial }: CourseFormProps) {
|
||||
format: initial?.format ?? "in-person",
|
||||
price: initial?.price ?? null,
|
||||
registrationUrl: initial?.registrationUrl ?? "/register/",
|
||||
imageUrl: initial?.imageUrl ?? "",
|
||||
posterImageUrl: initial?.posterImageUrl ?? "",
|
||||
brochureImageUrl: initial?.brochureImageUrl ?? "",
|
||||
seoDescription: initial?.seoDescription ?? "",
|
||||
tags: initial?.tags ?? [],
|
||||
published: initial?.published ?? true,
|
||||
});
|
||||
const [priceInput, setPriceInput] = useState(
|
||||
initial?.price != null ? String(initial.price) : "",
|
||||
);
|
||||
const [customTagInput, setCustomTagInput] = useState("");
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [error, setError] = useState("");
|
||||
|
||||
@@ -63,6 +76,29 @@ export function CourseForm({ initial }: CourseFormProps) {
|
||||
setForm((f) => ({ ...f, [key]: value }));
|
||||
}
|
||||
|
||||
function toggleTag(tag: string) {
|
||||
setForm((f) => {
|
||||
const exists = f.tags.includes(tag);
|
||||
return {
|
||||
...f,
|
||||
tags: exists ? f.tags.filter((t) => t !== tag) : [...f.tags, tag],
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
function addCustomTag() {
|
||||
const trimmed = customTagInput.trim();
|
||||
if (!trimmed) return;
|
||||
if (!form.tags.includes(trimmed)) {
|
||||
set("tags", [...form.tags, trimmed]);
|
||||
}
|
||||
setCustomTagInput("");
|
||||
}
|
||||
|
||||
function removeTag(tagToRemove: string) {
|
||||
set("tags", form.tags.filter((t) => t !== tagToRemove));
|
||||
}
|
||||
|
||||
function onPriceChange(raw: string) {
|
||||
setPriceInput(raw);
|
||||
const trimmed = raw.trim();
|
||||
@@ -243,6 +279,94 @@ export function CourseForm({ initial }: CourseFormProps) {
|
||||
|
||||
<Separator />
|
||||
|
||||
<section className="space-y-4">
|
||||
<div>
|
||||
<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-3">
|
||||
<div>
|
||||
<Label className="text-xs text-muted-foreground">تگهای پیشنهادی</Label>
|
||||
<div className="mt-2 flex flex-wrap gap-2">
|
||||
{SUGGESTED_TAGS.map((tag) => {
|
||||
const active = form.tags.includes(tag);
|
||||
return (
|
||||
<Button
|
||||
key={tag}
|
||||
type="button"
|
||||
size="sm"
|
||||
variant={active ? "default" : "outline"}
|
||||
aria-pressed={active}
|
||||
onClick={() => toggleTag(tag)}
|
||||
className="h-8 px-3 text-xs"
|
||||
>
|
||||
{tag}
|
||||
</Button>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex items-end gap-2">
|
||||
<div className="flex-1 space-y-1.5">
|
||||
<Label htmlFor="newTag">افزودن تگ دلخواه</Label>
|
||||
<Input
|
||||
id="newTag"
|
||||
value={customTagInput}
|
||||
onChange={(e) => setCustomTagInput(e.target.value)}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "Enter") {
|
||||
e.preventDefault();
|
||||
addCustomTag();
|
||||
}
|
||||
}}
|
||||
placeholder="مثلاً دورههای ویژه مدیران"
|
||||
/>
|
||||
</div>
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
onClick={addCustomTag}
|
||||
className="shrink-0"
|
||||
>
|
||||
<Plus className="size-4" />
|
||||
افزودن
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="space-y-1.5">
|
||||
<Label className="text-xs text-muted-foreground">
|
||||
تگهای این دوره ({form.tags.length})
|
||||
</Label>
|
||||
{form.tags.length > 0 ? (
|
||||
<div className="flex flex-wrap gap-1.5">
|
||||
{form.tags.map((tag) => (
|
||||
<Badge key={tag} variant="secondary" className="gap-1 py-1 pe-1">
|
||||
{tag}
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => removeTag(tag)}
|
||||
className="rounded-full p-0.5 transition-colors hover:bg-foreground/10"
|
||||
aria-label={`حذف تگ ${tag}`}
|
||||
>
|
||||
<X className="size-3" />
|
||||
</button>
|
||||
</Badge>
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<p className="text-xs text-muted-foreground">
|
||||
هنوز تگی برای این دوره انتخاب نشده است.
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<Separator />
|
||||
|
||||
<section className="space-y-4">
|
||||
<div>
|
||||
<h2 className="text-sm font-semibold text-foreground">رسانه و انتشار</h2>
|
||||
@@ -261,11 +385,20 @@ export function CourseForm({ initial }: CourseFormProps) {
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-1.5 sm:col-span-2">
|
||||
<Label htmlFor="imageUrl">آدرس تصویر</Label>
|
||||
<Label htmlFor="posterImageUrl">آدرس پوستر (نمایش در لیست دورهها)</Label>
|
||||
<Input
|
||||
id="imageUrl"
|
||||
value={form.imageUrl}
|
||||
onChange={(e) => set("imageUrl", e.target.value)}
|
||||
id="posterImageUrl"
|
||||
value={form.posterImageUrl}
|
||||
onChange={(e) => set("posterImageUrl", e.target.value)}
|
||||
placeholder="/images/courses/..."
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-1.5 sm:col-span-2">
|
||||
<Label htmlFor="brochureImageUrl">آدرس بروشور (نمایش در صفحه جزئیات)</Label>
|
||||
<Input
|
||||
id="brochureImageUrl"
|
||||
value={form.brochureImageUrl}
|
||||
onChange={(e) => set("brochureImageUrl", e.target.value)}
|
||||
placeholder="/images/courses/..."
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -42,7 +42,18 @@ export function CourseTable({ courses }: { courses: AdminCourse[] }) {
|
||||
<TableBody>
|
||||
{courses.map((course) => (
|
||||
<TableRow key={course.id}>
|
||||
<TableCell className="font-medium">{course.title}</TableCell>
|
||||
<TableCell className="font-medium">
|
||||
<div>{course.title}</div>
|
||||
{course.tags && course.tags.length > 0 ? (
|
||||
<div className="mt-1 flex flex-wrap gap-1">
|
||||
{course.tags.map((tag) => (
|
||||
<Badge key={tag} variant="outline" className="text-[10px] px-1.5 py-0">
|
||||
{tag}
|
||||
</Badge>
|
||||
))}
|
||||
</div>
|
||||
) : null}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Badge variant="secondary">{categoryLabel(course.category)}</Badge>
|
||||
</TableCell>
|
||||
|
||||
@@ -78,7 +78,7 @@ export function CourseDetailTemplate({
|
||||
title={course.title}
|
||||
intro={course.summary}
|
||||
eyebrow={categoryLabel(course.category)}
|
||||
imageUrl={course.imageUrl}
|
||||
imageUrl={course.posterImageUrl}
|
||||
/>
|
||||
|
||||
<Section className="bg-gradient-to-b from-background to-muted/40">
|
||||
@@ -87,7 +87,7 @@ export function CourseDetailTemplate({
|
||||
<div className="overflow-hidden rounded-2xl ring-1 ring-border">
|
||||
<div className="relative aspect-[16/9] bg-muted">
|
||||
<Image
|
||||
src={course.imageUrl}
|
||||
src={course.brochureImageUrl}
|
||||
alt={course.title}
|
||||
fill
|
||||
className="object-cover"
|
||||
|
||||
@@ -14,15 +14,18 @@ function toAdminCourse(row: CourseRow): AdminCourse {
|
||||
export async function listAdminCourses(opts?: {
|
||||
search?: string;
|
||||
published?: boolean;
|
||||
tag?: string;
|
||||
}): Promise<AdminCourse[]> {
|
||||
const search = opts?.search?.trim() ?? "";
|
||||
const published = opts?.published ?? null;
|
||||
const tag = opts?.tag?.trim() ?? "";
|
||||
const res = await query<CourseRow>(
|
||||
`SELECT * FROM courses
|
||||
WHERE ($1 = '' OR title ILIKE '%' || $1 || '%' OR slug ILIKE '%' || $1 || '%')
|
||||
AND ($2::boolean IS NULL OR published = $2)
|
||||
AND ($3 = '' OR $3 = ANY(tags))
|
||||
ORDER BY updated_at DESC`,
|
||||
[search, published],
|
||||
[search, published, tag],
|
||||
);
|
||||
return res.rows.map(toAdminCourse);
|
||||
}
|
||||
@@ -30,4 +33,15 @@ export async function listAdminCourses(opts?: {
|
||||
export async function getAdminCourseById(id: string): Promise<AdminCourse | null> {
|
||||
const res = await query<CourseRow>("SELECT * FROM courses WHERE id = $1 LIMIT 1", [id]);
|
||||
return res.rows[0] ? toAdminCourse(res.rows[0]) : null;
|
||||
}
|
||||
|
||||
/** Distinct tags across all courses (admin view — includes unpublished), sorted by usage. */
|
||||
export async function listCourseTags(): Promise<string[]> {
|
||||
const res = await query<{ tag: string; count: string }>(
|
||||
`SELECT tag, COUNT(*)::text AS count
|
||||
FROM courses, UNNEST(tags) AS tag
|
||||
GROUP BY tag
|
||||
ORDER BY COUNT(*) DESC, tag ASC`,
|
||||
);
|
||||
return res.rows.map((r) => r.tag);
|
||||
}
|
||||
@@ -46,8 +46,10 @@ export interface CourseRow {
|
||||
format: string;
|
||||
price: string | number | null;
|
||||
registration_url: string;
|
||||
image_url: string;
|
||||
poster_image_url: string;
|
||||
brochure_image_url: string;
|
||||
seo_description: string;
|
||||
tags: string[];
|
||||
published: boolean;
|
||||
}
|
||||
|
||||
@@ -62,8 +64,10 @@ export function courseToRow(course: Course): CourseRow {
|
||||
format: course.format,
|
||||
price: course.price ?? null,
|
||||
registration_url: course.registrationUrl,
|
||||
image_url: course.imageUrl,
|
||||
poster_image_url: course.posterImageUrl,
|
||||
brochure_image_url: course.brochureImageUrl,
|
||||
seo_description: course.seoDescription,
|
||||
tags: course.tags ?? [],
|
||||
published: true,
|
||||
};
|
||||
}
|
||||
@@ -330,8 +334,10 @@ export function rowToCourse(row: CourseRow): Course {
|
||||
format: row.format as Course["format"],
|
||||
price: Number.isFinite(price) ? price : null,
|
||||
registrationUrl: row.registration_url,
|
||||
imageUrl: row.image_url,
|
||||
posterImageUrl: row.poster_image_url ?? (row as unknown as { image_url?: string }).image_url ?? "",
|
||||
brochureImageUrl: row.brochure_image_url ?? (row as unknown as { image_url?: string }).image_url ?? "",
|
||||
seoDescription: row.seo_description,
|
||||
tags: asStringArray(row.tags),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+14
-7
@@ -12,7 +12,8 @@ export const courses: Course[] = [
|
||||
durationHours: null,
|
||||
format: "in-person",
|
||||
registrationUrl: "/register/ai-organizational-transformation",
|
||||
imageUrl: "/images/courses/ai-organizational-transformation.png",
|
||||
posterImageUrl: "/images/courses/ai-organizational-transformation-poster.png",
|
||||
brochureImageUrl: "/images/courses/ai-organizational-transformation-brochure.png",
|
||||
seoDescription:
|
||||
"دوره تخصصی دوروزه تحول سازمانی با هوش مصنوعی. مسیر یادگیری از مسئله سازمانی تا نقش انسان و AI، انتخاب مسیر، مدیریت محصول AI، داده و حاکمیت، ساخت و آزمون (Prompt، chatbot، AI Agent) و تشخیص کاربرد مناسب. محورها: ۱) آمادگی و مدیریت تغییر — دکتر آغاز؛ ۲) تحول با هوش مصنوعی — دکتر هراتینیک؛ ۳) چرخه عمر محصول AI — دکتر سلیمینمین؛ ۴) حاکمیت داده — دکتر روشنی؛ ۵) تجربه عملی AI Fluency و دستیاران صنعتی آموزشی — مهندس متین صفار و مهندس محمدحسین کشفی. شعار دوره: A SMARTER TOMORROW BY BETTER DECISIONS.",
|
||||
},
|
||||
@@ -26,7 +27,8 @@ export const courses: Course[] = [
|
||||
durationHours: null,
|
||||
format: "in-person",
|
||||
registrationUrl: "/register/ai-fluency",
|
||||
imageUrl: "/images/courses/ai-fluency.jpg",
|
||||
posterImageUrl: "/images/courses/ai-fluency-poster.jpg",
|
||||
brochureImageUrl: "/images/courses/ai-fluency-brochure.jpg",
|
||||
seoDescription:
|
||||
"کارگاه عملی کاربرد هوش مصنوعی با شعار «از پرامپت دقیق تا ایجنت قابل اعتماد». پنج گام مسیر یادگیری: ۱) مهندسی پرامپت — درخواست شفاف، پاسخ هدفمند؛ مشخصکردن هدف، زمینه و قالب خروجی؛ ۲) طراحی دستورالعمل (Prompt Card / Skill) — دستور شفاف، اجرای منسجم؛ تعریف گامها و قوانین انجام کار؛ ۳) چتبات اختصاصی — دانش شما، دستیار شما؛ تعیین نقش، منابع و مرزهای پاسخ؛ ۴) ایجنت — از پاسخدادن تا انجام کار؛ اتصال ابزارها با نظارت انسان؛ ۵) ارزیابی و کنترل — بسنجید، اصلاح کنید، اعتماد کنید؛ آزمون پاسخها و کنترل خطا. در پایان کارگاه، از ایده به یک دستیار کاربردی میرسید: پرامپت دقیق، مهارت قابل تکرار، چتبات اختصاصی و ایجنت قابل ارزیابی.",
|
||||
},
|
||||
@@ -40,7 +42,8 @@ export const courses: Course[] = [
|
||||
durationHours: null,
|
||||
format: "in-person",
|
||||
registrationUrl: "/register/hr-prompt-engineering",
|
||||
imageUrl: "/images/courses/hr-prompt-engineering.jpg",
|
||||
posterImageUrl: "/images/courses/hr-prompt-engineering-poster.jpg",
|
||||
brochureImageUrl: "/images/courses/hr-prompt-engineering-brochure.jpg",
|
||||
seoDescription:
|
||||
"استفاده حرفهای از هوش مصنوعی در منابع انسانی به شناخت مسئله و کیفیت تعامل با مدل وابسته است. این کارگاه به طراحی پرامپت برای تحلیل اطلاعات تخصصی HR میپردازد و کاربردهای آن را در جذب، توسعه و مدیریت عملکرد بررسی میکند. مدرس: دکتر عسل آغاز.",
|
||||
},
|
||||
@@ -54,7 +57,8 @@ export const courses: Course[] = [
|
||||
durationHours: null,
|
||||
format: "in-person",
|
||||
registrationUrl: "/register/branding",
|
||||
imageUrl: "/images/courses/branding.jpg",
|
||||
posterImageUrl: "/images/courses/branding-poster.jpg",
|
||||
brochureImageUrl: "/images/courses/branding-brochure.jpg",
|
||||
seoDescription:
|
||||
"برند در ارتباط میان هویت کسبوکار و تجربه مخاطب شکل میگیرد. این کارگاه به تصمیمهای مؤثر بر این ارتباط میپردازد؛ از شناخت مخاطب و ارزش پیشنهادی تا روایت، تجربه و ارزیابی برند. مدرس: دکتر علیرضا شیخ. شعار منبع: از معنا و هویت تا تجربه و وفاداری.",
|
||||
},
|
||||
@@ -68,7 +72,8 @@ export const courses: Course[] = [
|
||||
durationHours: null,
|
||||
format: "in-person",
|
||||
registrationUrl: "/register/marketing",
|
||||
imageUrl: "/images/courses/marketing.jpg",
|
||||
posterImageUrl: "/images/courses/marketing-poster.jpg",
|
||||
brochureImageUrl: "/images/courses/marketing-brochure.jpg",
|
||||
seoDescription:
|
||||
"تصمیمهای بازاریابی به شناخت بازار، رفتار مشتری و ارزیابی نتیجه وابستهاند. این کارگاه ارتباط میان تحقیقات بازار، انتخاب استراتژی، طراحی کمپین و شاخصهای عملکرد را بررسی میکند. مدرس: دکتر علیرضا شیخ. شعار منبع: از شناخت مشتری تا طراحی استراتژی و اجرای کمپین.",
|
||||
},
|
||||
@@ -82,7 +87,8 @@ export const courses: Course[] = [
|
||||
durationHours: null,
|
||||
format: "in-person",
|
||||
registrationUrl: "/register/branding-marketing-in-practice",
|
||||
imageUrl: "/images/courses/branding-marketing-practice.jpg",
|
||||
posterImageUrl: "/images/courses/branding-marketing-practice-poster.jpg",
|
||||
brochureImageUrl: "/images/courses/branding-marketing-practice-brochure.jpg",
|
||||
seoDescription:
|
||||
"هویت برند، ارزش پیشنهادی و فعالیتهای بازاریابی بر یکدیگر اثر میگذارند. این کارگاه ارتباط میان آنها را در تصمیمهای کسبوکار بررسی میکند: از شناخت بازار و طراحی استراتژی برند تا انتخاب کانال، طراحی کمپین و تحلیل شاخصهای عملکرد. مدرس: دکتر علیرضا شیخ. شعار منبع: از هویت برند تا رشد پایدار کسبوکار.",
|
||||
},
|
||||
@@ -96,7 +102,8 @@ export const courses: Course[] = [
|
||||
durationHours: null,
|
||||
format: "in-person",
|
||||
registrationUrl: "/register/managerial-dialogue",
|
||||
imageUrl: "/images/courses/managerial-dialogue.jpg",
|
||||
posterImageUrl: "/images/courses/managerial-dialogue-poster.jpg",
|
||||
brochureImageUrl: "/images/courses/managerial-dialogue-brochure.jpg",
|
||||
seoDescription:
|
||||
"هماندیشی مدیریتی از مسئلهای آغاز میشود که مدیر با خود به جلسه میآورد. موضوع و انتظار او پیش از جلسه مشخص میشود و متخصص مرتبط با آن پیشنهاد میشود. گفتوگو به بررسی ابعاد مسئله، فرضیات و گزینههای تصمیم اختصاص دارد. زیرعنوان منبع: گفتوگویی تخصصی برای مواجهه با مسائل واقعی مدیریت.",
|
||||
},
|
||||
|
||||
@@ -31,10 +31,11 @@ export const siteAddress = {
|
||||
/** Main nav labels for Persian users */
|
||||
export const homeNav: NavItem[] = [
|
||||
{ label: "ارزشها", href: "/values" },
|
||||
{ label: "اساتید", href: "/faculty" },
|
||||
{ label: "اساتید", href: "https://mst.aut.ac.ir/content/31094/شبکه-اساتید" },
|
||||
{ label: "درباره ما", href: "/about" },
|
||||
{ label: "دورههای کوتاه", href: "/professional" },
|
||||
{ label: "دورههای صنعتی", href: "/professional" },
|
||||
{ label: "دانشگاه امیرکبیر", href: "https://mst.aut.ac.ir/", prominent: true },
|
||||
];
|
||||
|
||||
export const professionalNav: NavItem[] = [
|
||||
|
||||
@@ -29,7 +29,7 @@ export function courseJsonLd(course: Course) {
|
||||
name: siteName,
|
||||
},
|
||||
url: course.registrationUrl,
|
||||
image: course.imageUrl,
|
||||
image: course.posterImageUrl,
|
||||
educationalCredentialAwarded: "گواهی دانشکده مدیریت علم و فناوری",
|
||||
};
|
||||
if (course.price != null && Number.isFinite(course.price) && course.price >= 0) {
|
||||
|
||||
@@ -23,10 +23,11 @@ export const siteAddress = {
|
||||
/** Main nav labels for Persian users */
|
||||
export const homeNav: NavItem[] = [
|
||||
{ label: "ارزشها", href: "/values" },
|
||||
{ label: "اساتید", href: "/faculty" },
|
||||
{ label: "اساتید", href: "https://mst.aut.ac.ir/content/31094/شبکه-اساتید" },
|
||||
{ label: "درباره ما", href: "/about" },
|
||||
{ label: "دورههای کوتاه", href: "/professional" },
|
||||
{ label: "دورههای صنعتی", href: "/professional" },
|
||||
{ label: "دانشگاه امیرکبیر", href: "https://mst.aut.ac.ir/", prominent: true },
|
||||
];
|
||||
|
||||
export const professionalNav: NavItem[] = [
|
||||
|
||||
@@ -20,8 +20,11 @@ export interface Course {
|
||||
/** Optional price in toman; omit/null = do not show price in UI */
|
||||
price?: number | null;
|
||||
registrationUrl: string;
|
||||
imageUrl: string;
|
||||
posterImageUrl: string;
|
||||
brochureImageUrl: string;
|
||||
seoDescription: string;
|
||||
/** Tags for filtering (e.g., "کارگاه", "دوره سازمانی", "گزیده") */
|
||||
tags?: string[];
|
||||
}
|
||||
|
||||
export type ProgramGroup = "standard" | "executive";
|
||||
@@ -93,6 +96,7 @@ export interface NavItem {
|
||||
label: string;
|
||||
href: string;
|
||||
children?: NavItem[];
|
||||
prominent?: boolean;
|
||||
}
|
||||
|
||||
export interface FacultyMember {
|
||||
|
||||
@@ -36,7 +36,9 @@ const courseFields = {
|
||||
.union([z.number().int().nonnegative("قیمت نمیتواند منفی باشد"), z.null()])
|
||||
.optional(),
|
||||
registrationUrl: urlOrPath,
|
||||
imageUrl: urlOrPath,
|
||||
posterImageUrl: urlOrPath,
|
||||
brochureImageUrl: urlOrPath,
|
||||
tags: z.array(z.string()).default([]),
|
||||
seoDescription: z.string(),
|
||||
published: z.boolean(),
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user