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

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

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

No files matched your search

@@ -28,18 +28,19 @@ export function AcademicsOverlay({
return (
<div
className="fixed inset-0 z-[70] overflow-y-auto bg-card text-foreground"
className="fixed inset-0 z-[70] overflow-y-auto bg-background text-foreground"
role="dialog"
aria-modal="true"
aria-label={title}
>
<div className="h-1 bg-gradient-to-l from-primary via-accent to-primary" aria-hidden />
<Container className="py-8">
<div className="mb-8 flex items-center justify-between gap-4">
<Button
type="button"
variant="ghost"
onClick={onClose}
className="px-0 font-semibold hover:bg-transparent hover:text-primary"
className="px-0 font-semibold hover:bg-transparent hover:text-accent"
>
بازگشت به منو
</Button>
@@ -54,7 +55,7 @@ export function AcademicsOverlay({
</Button>
</div>
<h2 className="mb-10 max-w-3xl text-start text-3xl font-bold tracking-tight break-words sm:text-4xl">
<h2 className="mb-10 max-w-3xl text-start text-3xl font-bold leading-[1.35] break-words sm:text-4xl">
{title}
</h2>
@@ -66,7 +67,7 @@ export function AcademicsOverlay({
onClick={onClose}
className="group block"
>
<span className="text-base font-extrabold leading-snug group-hover:text-primary">
<span className="text-base font-bold leading-snug group-hover:text-accent">
{program.title}
</span>
<p className="mt-2 text-sm leading-relaxed text-muted-foreground">
@@ -77,7 +78,7 @@ export function AcademicsOverlay({
))}
</ul>
<h3 className="mt-14 mb-6 text-lg font-extrabold text-primary">
<h3 className="mt-14 mb-6 text-lg font-bold text-accent">
{executiveLabel}
</h3>
<ul className="grid gap-x-10 gap-y-8 sm:grid-cols-2 lg:grid-cols-3">
@@ -88,7 +89,7 @@ export function AcademicsOverlay({
onClick={onClose}
className="group block"
>
<span className="text-base font-extrabold leading-snug group-hover:text-primary">
<span className="text-base font-bold leading-snug group-hover:text-accent">
{program.title}
</span>
<p className="mt-2 text-sm leading-relaxed text-muted-foreground">
+4 -4
View File
@@ -47,13 +47,13 @@ export function CampaignBanners({ banners }: { banners: CampaignBanner[] }) {
const banner = visible[0];
return (
<div className="bg-chart-3 text-background">
<div className="bg-primary text-primary-foreground">
<Container className="flex min-w-0 items-center justify-between gap-3 py-3 sm:gap-4">
<p className="min-w-0 flex-1 text-sm leading-relaxed break-words">
<span className="text-background/90">{banner.text}</span>{" "}
<span className="text-primary-foreground/90">{banner.text}</span>{" "}
<Link
href={banner.href}
className="font-bold text-background underline-offset-4 hover:underline"
className="font-bold text-secondary underline-offset-4 hover:underline"
>
{banner.cta}
</Link>
@@ -63,7 +63,7 @@ export function CampaignBanners({ banners }: { banners: CampaignBanner[] }) {
variant="ghost"
size="icon"
aria-label="بستن بنر"
className="shrink-0 text-background/70 hover:bg-background/10 hover:text-background"
className="shrink-0 text-primary-foreground/70 hover:bg-primary-foreground/10 hover:text-primary-foreground"
onClick={() => dismiss(banner)}
>
<X className="size-4" />
+2 -2
View File
@@ -22,12 +22,12 @@ export function ErrorState({
return (
<main id="main-content" className="bg-background">
<Container className="flex min-h-[60vh] flex-col items-start justify-center py-20">
<p className="text-sm font-bold text-primary sm:text-base">خطا</p>
<p className="text-sm font-bold text-accent sm:text-base">خطا</p>
<Heading as="h1" level={2} className="mt-3">
بارگذاری صفحه ناموفق بود
</Heading>
<p className="mt-4 max-w-md text-base leading-8 text-muted-foreground">
لطفاً دوباره تلاش کنید. اگر مشکل ادامه داشت، چند لحظه بعد بازگردید.
لطفا دوباره تلاش کنید. اگر مشکل ادامه داشت، چند لحظه بعد بازگردید.
</p>
<div className="mt-8 flex flex-wrap gap-3">
<Button type="button" size="lg" className="font-bold" onClick={reset}>
+1 -1
View File
@@ -33,7 +33,7 @@ export function ProgramCarousel({
<div className="min-w-0">
<div className="mb-5 flex min-w-0 items-end justify-between gap-4">
{!hideTitle && title ? (
<h2 className="min-w-0 text-2xl font-bold tracking-tight break-words sm:text-3xl">
<h2 className="min-w-0 text-2xl font-bold leading-[1.4] break-words sm:text-3xl">
{title}
</h2>
) : (
+4 -3
View File
@@ -79,8 +79,9 @@ export function SearchOverlay({
aria-label={label}
>
<div className="border-b border-border bg-card">
<div className="h-1 bg-gradient-to-l from-primary via-accent to-primary" aria-hidden />
<div className="mx-auto flex max-w-4xl items-center justify-between px-4 py-5 sm:px-6">
<p className="text-sm font-semibold text-muted-foreground">{label}</p>
<p className="text-sm font-semibold text-primary">{label}</p>
<Button
variant="ghost"
size="icon"
@@ -107,7 +108,7 @@ export function SearchOverlay({
)}
>
<ResultGroup
title="برنامه‌ها"
title="برنامه ها"
items={results.programs.map((p) => ({
href: p.href,
title: p.title,
@@ -116,7 +117,7 @@ export function SearchOverlay({
onNavigate={() => setOpen(false)}
/>
<ResultGroup
title="دوره‌ها"
title="دوره ها"
items={results.courses.map((c) => ({
href: c.registrationUrl,
title: c.title,
+19 -15
View File
@@ -4,7 +4,7 @@ import { Container } from "@/components/atoms/Container";
import { Separator } from "@/components/ui/separator";
import {
siteAddress,
siteUniversity,
siteFaculty,
siteShortName,
} from "@/lib/site-config";
@@ -19,22 +19,26 @@ export function SiteFooter({
variant?: "home" | "professional";
}) {
return (
<footer className="border-t border-border bg-chart-3 pb-[env(safe-area-inset-bottom)] text-background">
<footer className="border-t border-border bg-primary pb-[env(safe-area-inset-bottom)] text-primary-foreground">
<Container className="py-12 sm:py-14">
<div className="grid gap-10 sm:grid-cols-2 lg:grid-cols-3 lg:gap-12">
<div className="max-w-sm space-y-4">
<BrandLogo
title={siteShortName}
subtitle={siteUniversity}
subtitle={siteFaculty}
onDark
/>
<p className="text-sm leading-7 text-background/65">
<p className="text-sm leading-7 text-primary-foreground/65">
{siteAddress.line}
</p>
<p className="text-sm text-primary-foreground/55">
کد پستی{" "}
<span dir="ltr">{siteAddress.postalCode}</span>
</p>
</div>
<nav aria-label="لینک‌های پاورقی" className="space-y-4">
<p className="text-xs font-semibold tracking-wide text-background/55">
<nav aria-label="لینک های پاورقی" className="space-y-4">
<p className="text-xs font-semibold tracking-wide text-primary-foreground/55">
{linksTitle}
</p>
<ul className="flex flex-col gap-2.5 text-sm font-medium">
@@ -42,7 +46,7 @@ export function SiteFooter({
<li key={link.href}>
<Link
href={link.href}
className="text-background/80 transition-colors hover:text-background"
className="text-primary-foreground/80 transition-colors hover:text-primary-foreground"
>
{link.label}
</Link>
@@ -52,15 +56,15 @@ export function SiteFooter({
</nav>
<div className="space-y-4 sm:max-w-xs lg:justify-self-end lg:text-end">
<p className="text-xs font-semibold tracking-wide text-background/55">
<p className="text-xs font-semibold tracking-wide text-primary-foreground/55">
تماس
</p>
<div className="space-y-1.5 text-sm text-background/75">
<div className="space-y-1.5 text-sm text-primary-foreground/75">
<p>
<a
href={`tel:${siteAddress.phone}`}
href={`tel:${siteAddress.phoneTel}`}
dir="ltr"
className="transition-colors hover:text-background"
className="transition-colors hover:text-primary-foreground"
>
{siteAddress.phone}
</a>
@@ -69,7 +73,7 @@ export function SiteFooter({
<a
href={`mailto:${siteAddress.email}`}
dir="ltr"
className="transition-colors hover:text-background"
className="transition-colors hover:text-primary-foreground"
>
{siteAddress.email}
</a>
@@ -79,7 +83,7 @@ export function SiteFooter({
href={siteAddress.mapUrl}
target="_blank"
rel="noopener noreferrer"
className="font-medium text-background/90 transition-colors hover:text-background"
className="font-medium text-primary-foreground/90 transition-colors hover:text-primary-foreground"
>
موقعیت روی نقشه
</a>
@@ -88,9 +92,9 @@ export function SiteFooter({
</div>
</div>
<Separator className="my-8 bg-background/10" />
<Separator className="my-8 bg-primary-foreground/10" />
<p className="text-xs text-background/45">{copyright}</p>
<p className="text-xs text-primary-foreground/45">{copyright}</p>
</Container>
</footer>
);
+22 -19
View File
@@ -55,8 +55,8 @@ function NavDropdown({
className={cn(
"inline-flex cursor-pointer items-center gap-1 rounded-lg px-3 py-2 text-sm font-semibold transition-colors outline-none",
isDark
? "text-background/80 hover:text-background"
: "text-foreground/75 hover:bg-muted hover:text-primary",
? "text-primary-foreground/80 hover:text-primary-foreground"
: "text-foreground/75 hover:bg-muted hover:text-accent",
)}
>
{item.label}
@@ -114,19 +114,20 @@ export function SiteHeader({
<>
<header
className={cn(
"site-header sticky top-0 z-50 pt-[env(safe-area-inset-top)] shadow-sm backdrop-blur-sm md:backdrop-blur-xl",
"site-header sticky top-0 z-50 overflow-hidden pt-[env(safe-area-inset-top)] shadow-sm backdrop-blur-sm md:backdrop-blur-xl",
isDark
? "border-b border-background/10 bg-chart-3/95 text-background"
? "border-b border-primary-foreground/10 bg-primary/95 text-primary-foreground"
: "border-b border-border bg-card/95 text-foreground",
)}
>
<Container className="flex h-[4.5rem] min-w-0 items-center justify-start gap-3 sm:h-20 sm:gap-6" dir="rtl">
<Container className="flex h-[4.5rem] min-w-0 items-center justify-start gap-3 overflow-hidden sm:h-20 sm:gap-6" dir="rtl">
<BrandLogo
href={brandHref}
title={brandTitle}
subtitle={brandSubtitle}
onDark={isDark}
className="max-w-[min(100%,14rem)] sm:max-w-[min(100%,20rem)]"
horizontal
className="h-full shrink-0"
/>
<nav
@@ -152,8 +153,8 @@ export function SiteHeader({
className={cn(
"rounded-lg px-3 py-2 text-sm font-semibold transition-colors",
isDark
? "text-background/80 hover:text-background"
: "text-foreground/75 hover:bg-muted hover:text-primary",
? "text-primary-foreground/80 hover:text-primary-foreground"
: "text-foreground/75 hover:bg-muted hover:text-accent",
)}
/>
);
@@ -163,7 +164,7 @@ export function SiteHeader({
<div
className={cn(
"ms-auto flex shrink-0 items-center gap-2 xl:ms-0",
isDark && "text-background",
isDark && "text-primary-foreground",
)}
>
<Link
@@ -171,8 +172,8 @@ export function SiteHeader({
className={cn(
"hidden rounded-lg px-3 py-2 text-sm font-semibold transition-colors sm:inline-flex",
isDark
? "text-background/80 hover:text-background"
: "text-foreground/75 hover:bg-muted hover:text-primary",
? "text-primary-foreground/80 hover:text-primary-foreground"
: "bg-secondary text-foreground hover:bg-secondary/80 hover:text-accent",
)}
>
{contactLabel}
@@ -202,7 +203,7 @@ export function SiteHeader({
{mobileOpen ? (
<div
className="fixed inset-0 z-[60] flex flex-col bg-chart-3 text-background pt-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)] xl:hidden"
className="fixed inset-0 z-[60] flex flex-col bg-primary text-primary-foreground pt-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)] xl:hidden"
role="dialog"
aria-modal="true"
aria-label="منوی اصلی"
@@ -213,35 +214,37 @@ export function SiteHeader({
title={brandTitle}
subtitle={brandSubtitle}
onDark
horizontal
compact
className="shrink-0"
/>
<Button
variant="ghost"
size="icon"
className="text-background hover:bg-background/10"
className="text-primary-foreground hover:bg-primary-foreground/10"
aria-label="بستن منو"
onClick={() => setMobileOpen(false)}
>
<X className="size-5" />
</Button>
</Container>
<Separator className="bg-background/10" />
<Separator className="bg-primary-foreground/10" />
<Container className="flex-1 overflow-y-auto py-6">
<ul className="space-y-1 text-start">
{items.map((item) => (
<li key={`nav:${item.href}:${item.label}`}>
{item.children && item.children.length > 0 ? (
<div className="py-2">
<p className="text-sm font-semibold text-background/55">
<p className="text-sm font-semibold text-primary-foreground/55">
{item.label}
</p>
<ul className="mt-1 space-y-0.5 border-s border-background/20 ps-3">
<ul className="mt-1 space-y-0.5 border-s border-primary-foreground/20 ps-3">
{item.children.map((child) => (
<li key={`nav:${child.href}:${child.label}`}>
<NavLink
item={child}
isDark
className="block py-2.5 text-base font-bold transition-colors hover:text-background/70"
className="block py-2.5 text-base font-bold transition-colors hover:text-primary-foreground/70"
onClick={() => setMobileOpen(false)}
/>
</li>
@@ -252,7 +255,7 @@ export function SiteHeader({
<NavLink
item={item}
isDark
className="block py-3.5 text-lg font-bold transition-colors hover:text-background/70"
className="block py-3.5 text-lg font-bold transition-colors hover:text-primary-foreground/70"
onClick={() => setMobileOpen(false)}
/>
)}
@@ -261,7 +264,7 @@ export function SiteHeader({
<li>
<Link
href="/contact"
className="block py-3.5 text-lg font-bold transition-colors hover:text-background/70"
className="block py-3.5 text-lg font-bold transition-colors hover:text-primary-foreground/70"
onClick={() => setMobileOpen(false)}
>
{contactLabel}
+19 -19
View File
@@ -38,49 +38,49 @@ import { isAdminEntityEnabled } from "@/lib/admin/disabled-entities";
const NAV_GROUPS = [
{
label: "نمای کلی",
items: [{ href: "/admin", label: "داشبورد", icon: LayoutDashboard, exact: true }],
items: [{ href: "/mstcontroller", label: "داشبورد", icon: LayoutDashboard, exact: true }],
},
{
label: "محتوا",
items: [
{ href: "/admin/courses", label: "دوره‌ها", icon: BookOpen, entity: "courses" },
{ href: "/mstcontroller/courses", label: "دوره ها", icon: BookOpen, entity: "courses" },
{
href: "/admin/course-categories",
label: "دسته‌بندی دوره‌ها",
href: "/mstcontroller/course-categories",
label: "دسته بندی دوره ها",
icon: Tags,
entity: "course-categories",
},
{
href: "/admin/course-tags",
label: "تگ‌های دوره",
href: "/mstcontroller/course-tags",
label: "تگ های دوره",
icon: Tags,
entity: "course-tags",
},
{ href: "/admin/programs", label: "برنامه‌ها", icon: GraduationCap, entity: "programs" },
{ href: "/admin/events", label: "رویدادها", icon: Calendar, entity: "events" },
{ href: "/admin/articles", label: "مقالات", icon: Newspaper, entity: "articles" },
{ href: "/admin/topics", label: "موضوعات", icon: Tags, entity: "topics" },
{ href: "/mstcontroller/programs", label: "برنامه ها", icon: GraduationCap, entity: "programs" },
{ href: "/mstcontroller/events", label: "رویدادها", icon: Calendar, entity: "events" },
{ href: "/mstcontroller/articles", label: "مقالات", icon: Newspaper, entity: "articles" },
{ href: "/mstcontroller/topics", label: "موضوعات", icon: Tags, entity: "topics" },
],
},
{
label: "جامعه",
items: [
{ href: "/admin/faculty", label: "اساتید", icon: Users, entity: "faculty" },
{ href: "/admin/alumni", label: "دانش‌آموختگان", icon: MessageSquareQuote, entity: "alumni" },
{ href: "/mstcontroller/faculty", label: "اساتید", icon: Users, entity: "faculty" },
{ href: "/mstcontroller/alumni", label: "دانش آموختگان", icon: MessageSquareQuote, entity: "alumni" },
],
},
{
label: "سایت",
items: [
{ href: "/admin/banners", label: "بنرهای کمپین", icon: Megaphone, entity: "banners" },
{ href: "/admin/stats", label: "آمار", icon: BarChart3, entity: "stats" },
{ href: "/admin/testimonials", label: "نظرات", icon: FileText, entity: "testimonials" },
{ href: "/admin/legal", label: "صفحات قانونی", icon: Scale, entity: "legal" },
{ href: "/mstcontroller/banners", label: "بنرهای کمپین", icon: Megaphone, entity: "banners" },
{ href: "/mstcontroller/stats", label: "آمار", icon: BarChart3, entity: "stats" },
{ href: "/mstcontroller/testimonials", label: "نظرات", icon: FileText, entity: "testimonials" },
{ href: "/mstcontroller/legal", label: "صفحات قانونی", icon: Scale, entity: "legal" },
],
},
{
label: "درخواست‌ها",
items: [{ href: "/admin/registrations", label: "برگ ثبت‌نام", icon: ClipboardList }],
label: "درخواست ها",
items: [{ href: "/mstcontroller/registrations", label: "برگ ثبت نام", icon: ClipboardList }],
},
] as const;
@@ -105,7 +105,7 @@ export function AdminSidebar({ userName }: { userName: string }) {
<SidebarMenuItem>
<SidebarMenuButton
size="lg"
render={<Link href="/admin" />}
render={<Link href="/mstcontroller" />}
className="data-active:bg-sidebar-accent"
>
<span className="relative size-8 shrink-0">
@@ -31,12 +31,12 @@ export function FacultySyncButton() {
const res = await fetch("/api/admin/faculty/sync", { method: "POST" });
const body = (await res.json()) as SyncPayload;
if (!res.ok || !body.ok || !body.data) {
setError(body.error ?? "همگام‌سازی ناموفق بود");
setError(body.error ?? "همگام سازی ناموفق بود");
return;
}
const { total, inserted, updated, imagesSaved } = body.data;
setMessage(
`${total} استاد خوانده شد — ${inserted} جدید، ${updated} به‌روز` +
`${total} استاد خوانده شد — ${inserted} جدید، ${updated} به روز` +
(imagesSaved > 0 ? `، ${imagesSaved} تصویر` : ""),
);
startTransition(() => {
@@ -77,7 +77,7 @@ export function ImageUploadField({
<div className="relative aspect-[16/9] w-full max-w-md bg-muted">
<Image
src={value}
alt="پیش‌نمایش تصویر"
alt="پیش نمایش تصویر"
fill
unoptimized
className="object-cover"
+2 -2
View File
@@ -8,7 +8,7 @@ import { Badge } from "@/components/ui/badge";
export const LEAD_STATUS_LABELS: Record<string, string> = {
new: "جدید",
contacted: "تماس گرفته شد",
enrolled: "ثبت‌نام شد",
enrolled: "ثبت نام شد",
rejected: "رد شد",
};
@@ -93,7 +93,7 @@ export function LeadsList({ leads }: { leads: LeadForDashboard[] }) {
<SelectContent>
<SelectItem value="new">جدید</SelectItem>
<SelectItem value="contacted">تماس گرفته شد</SelectItem>
<SelectItem value="enrolled">ثبت‌نام شد</SelectItem>
<SelectItem value="enrolled">ثبت نام شد</SelectItem>
<SelectItem value="rejected">رد شد</SelectItem>
</SelectContent>
</Select>
@@ -15,7 +15,7 @@ export function LogoutButton() {
} catch {
// ignore network errors — still navigate to login
} finally {
router.push("/admin/login");
router.push("/mstcontroller/login");
router.refresh();
}
}
@@ -24,7 +24,7 @@ function buildUrl(
if (tag && tag.trim()) params.set("tag", tag.trim());
if (category && category.trim()) params.set("category", category.trim());
const qs = params.toString();
return qs ? `/admin/courses?${qs}` : "/admin/courses";
return qs ? `/mstcontroller/courses?${qs}` : "/mstcontroller/courses";
}
export function CourseFilters({
@@ -63,7 +63,7 @@ export function CourseFilters({
setPublished("all");
setTag("");
setCategory("");
router.push("/admin/courses");
router.push("/mstcontroller/courses");
}
return (
@@ -93,8 +93,8 @@ export function CourseFilters({
</SelectTrigger>
<SelectContent>
<SelectItem value="all">همه</SelectItem>
<SelectItem value="true">منتشرشده</SelectItem>
<SelectItem value="false">پیش‌نویس</SelectItem>
<SelectItem value="true">منتشر شده</SelectItem>
<SelectItem value="false">پیش نویس</SelectItem>
</SelectContent>
</Select>
</div>
@@ -140,7 +140,7 @@ export function CourseFilters({
<Button type="submit">اعمال فیلتر</Button>
{hasFilters ? (
<Button type="button" variant="ghost" onClick={clear}>
پاک‌کردن فیلترها
پاک کردن فیلترها
</Button>
) : null}
</form>
@@ -17,7 +17,7 @@ export function CourseTable({ courses }: { courses: AdminCourse[] }) {
if (courses.length === 0) {
return (
<div className="flex flex-col items-center justify-center px-6 py-14 text-center">
<p className="text-sm font-medium text-foreground">دوره‌ای یافت نشد</p>
<p className="text-sm font-medium text-foreground">دوره ای یافت نشد</p>
<p className="mt-1 text-sm text-muted-foreground">
فیلتر را تغییر دهید یا دوره جدیدی بسازید.
</p>
@@ -86,8 +86,8 @@ export function CourseTable({ courses }: { courses: AdminCourse[] }) {
<TableCell>
<div className="flex items-center gap-2">
<Link
href={`/admin/courses/${course.id}/edit`}
className="text-sm text-primary hover:underline"
href={`/mstcontroller/courses/${course.id}/edit`}
className="text-sm text-accent hover:underline"
>
ویرایش
</Link>
@@ -96,7 +96,7 @@ export function CourseTable({ courses }: { courses: AdminCourse[] }) {
href={`/register/${course.slug}`}
className="text-sm text-muted-foreground hover:underline"
>
پیش‌نمایش
پیش نمایش
</Link>
)}
<DeleteCourseDialog id={course.id} title={course.title} />
@@ -45,7 +45,7 @@ export function DeleteCourseDialog({ id, title }: { id: string; title: string })
<DialogHeader>
<DialogTitle>حذف دوره</DialogTitle>
<DialogDescription>
دوره «{title}» برای همیشه حذف می‌شود. این عمل قابل بازگشت نیست.
دوره «{title}» برای همیشه حذف می شود. این عمل قابل بازگشت نیست.
</DialogDescription>
</DialogHeader>
{error && <p className="text-sm text-destructive">{error}</p>}
@@ -38,7 +38,7 @@ export function PublishToggle({ id, published }: { id: string; published: boolea
onClick={toggle}
disabled={loading}
>
{loading ? "..." : published ? "منتشرشده" : "پیش‌نویس"}
{loading ? "..." : published ? "منتشر شده" : "پیش نویس"}
</Button>
{error && <p className="mt-1 max-w-40 text-xs text-destructive">{error}</p>}
</div>
@@ -55,7 +55,7 @@ export function GenericDeleteDialog({
<DialogHeader>
<DialogTitle>حذف {noun}</DialogTitle>
<DialogDescription>
«{subject}» برای همیشه حذف می‌شود. این عمل قابل بازگشت نیست.
«{subject}» برای همیشه حذف می شود. این عمل قابل بازگشت نیست.
</DialogDescription>
</DialogHeader>
{error && <p className="text-sm text-destructive">{error}</p>}
@@ -17,7 +17,7 @@ function buildUrl(entity: string, search: string, published: string) {
if (search.trim()) params.set("search", search.trim());
if (published && published !== "all") params.set("published", published);
const qs = params.toString();
return qs ? `/admin/${entity}?${qs}` : `/admin/${entity}`;
return qs ? `/mstcontroller/${entity}?${qs}` : `/mstcontroller/${entity}`;
}
export function GenericFilters({
@@ -46,7 +46,7 @@ export function GenericFilters({
function clear() {
setSearch("");
setPublished("all");
router.push(`/admin/${entity}`);
router.push(`/mstcontroller/${entity}`);
}
return (
@@ -73,8 +73,8 @@ export function GenericFilters({
</SelectTrigger>
<SelectContent>
<SelectItem value="all">همه</SelectItem>
<SelectItem value="true">منتشرشده</SelectItem>
<SelectItem value="false">پیش‌نویس</SelectItem>
<SelectItem value="true">منتشر شده</SelectItem>
<SelectItem value="false">پیش نویس</SelectItem>
</SelectContent>
</Select>
</div>
@@ -82,7 +82,7 @@ export function GenericFilters({
<Button type="submit">اعمال فیلتر</Button>
{hasFilters && (
<Button type="button" variant="ghost" onClick={clear}>
پاک‌کردن فیلترها
پاک کردن فیلترها
</Button>
)}
</form>
@@ -107,7 +107,7 @@ export function GenericForm({
setError(data.error || "خطا در ذخیره");
return;
}
router.push(`/admin/${spec.key}`);
router.push(`/mstcontroller/${spec.key}`);
router.refresh();
} finally {
setLoading(false);
@@ -237,7 +237,7 @@ export function GenericForm({
<form onSubmit={handleSubmit}>
<AdminFormCard
title={isEdit ? `ویرایش ${spec.noun}` : `ثبت ${spec.noun} جدید`}
description="پس از ذخیره، فهرست به‌روز می‌شود."
description="پس از ذخیره، فهرست به روز می شود."
footer={
<>
<Button type="submit" disabled={loading}>
@@ -248,7 +248,7 @@ export function GenericForm({
: `ایجاد ${spec.noun}`}
</Button>
<Link
href={`/admin/${spec.key}`}
href={`/mstcontroller/${spec.key}`}
className={cn(buttonVariants({ variant: "outline" }))}
>
انصراف
@@ -54,7 +54,7 @@ export function GenericTable({ spec, rows }: { spec: AdminEntitySpec; rows: unkn
const isPublish = col.name === "published";
return (
<TableCell key={col.name}>
<Badge variant={isPublish || label === "پیش‌نویس" ? "outline" : "secondary"}>
<Badge variant={isPublish || label === "پیش نویس" ? "outline" : "secondary"}>
{value === null || value === undefined || value === "" ? "—" : label}
</Badge>
</TableCell>
@@ -75,8 +75,8 @@ export function GenericTable({ spec, rows }: { spec: AdminEntitySpec; rows: unkn
<PublishToggle apiPath={spec.apiPath} id={id} published={Boolean(r.published)} />
)}
<Link
href={`/admin/${spec.key}/${id}/edit`}
className="text-sm text-primary hover:underline"
href={`/mstcontroller/${spec.key}/${id}/edit`}
className="text-sm text-accent hover:underline"
>
ویرایش
</Link>
@@ -85,7 +85,7 @@ export function GenericTable({ spec, rows }: { spec: AdminEntitySpec; rows: unkn
href={preview}
className="text-sm text-muted-foreground hover:underline"
>
پیش‌نمایش
پیش نمایش
</Link>
)}
<GenericDeleteDialog apiPath={spec.apiPath} id={id} noun={spec.noun} subject={String(r[spec.columns[0].name] ?? "")} />
@@ -46,7 +46,7 @@ export function PublishToggle({
onClick={toggle}
disabled={loading}
>
{loading ? "..." : published ? "منتشرشده" : "پیش‌نویس"}
{loading ? "..." : published ? "منتشر شده" : "پیش نویس"}
</Button>
{error && <p className="mt-1 max-w-40 text-xs text-destructive">{error}</p>}
</div>
@@ -17,7 +17,7 @@ function buildUrl(search: string, status: string) {
if (search.trim()) params.set("search", search.trim());
if (status && status !== "all") params.set("status", status);
const qs = params.toString();
return qs ? `/admin/registrations?${qs}` : "/admin/registrations";
return qs ? `/mstcontroller/registrations?${qs}` : "/mstcontroller/registrations";
}
export function RegistrationFilters({
@@ -40,7 +40,7 @@ export function RegistrationFilters({
function clear() {
setSearch("");
setStatus("all");
router.push("/admin/registrations");
router.push("/mstcontroller/registrations");
}
return (
@@ -68,7 +68,7 @@ export function RegistrationFilters({
<SelectItem value="all">همه</SelectItem>
<SelectItem value="new">جدید</SelectItem>
<SelectItem value="contacted">تماس گرفته شد</SelectItem>
<SelectItem value="enrolled">ثبت‌نام شد</SelectItem>
<SelectItem value="enrolled">ثبت نام شد</SelectItem>
<SelectItem value="rejected">رد شد</SelectItem>
</SelectContent>
</Select>
@@ -76,7 +76,7 @@ export function RegistrationFilters({
<Button type="submit">اعمال فیلتر</Button>
{hasFilters && (
<Button type="button" variant="ghost" onClick={clear}>
پاک‌کردن فیلترها
پاک کردن فیلترها
</Button>
)}
</form>
@@ -140,7 +140,7 @@ export function RegistrationsTable({ rows }: { rows: AdminRegistration[] }) {
<SelectContent>
<SelectItem value="new">جدید</SelectItem>
<SelectItem value="contacted">تماس گرفته شد</SelectItem>
<SelectItem value="enrolled">ثبت‌نام شد</SelectItem>
<SelectItem value="enrolled">ثبت نام شد</SelectItem>
<SelectItem value="rejected">رد شد</SelectItem>
</SelectContent>
</Select>