Update database connection details and enhance course management functionality. Changed DATABASE_URL in deployment workflow to a direct connection string. Added course pruning logic in seed script to maintain database integrity. Updated faculty and registration forms to include additional fields for better data capture. Refined layout components for improved user experience and responsiveness.

This commit is contained in:
smhk1376 committed 2026-09-29 04:25:30 +03:30
1 parent 0874b968ba
commit 6909a935fd
74 files changed
+1506 -420

No files matched your search

@@ -128,7 +128,9 @@ export function CategoryCourseExplorer({
</CardDescription>
<div className="flex flex-wrap items-center justify-between gap-2 text-xs text-background/55">
<span>
{course.durationHours} ساعت · {formatLabel(course.format)}
{course.durationHours
? `${course.durationHours} ساعت · ${formatLabel(course.format)}`
: formatLabel(course.format)}
</span>
{priceLabel ? (
<span className="font-semibold text-background/90">
@@ -15,7 +15,14 @@ export function ContactInterestForm({
successLabel: string;
courseSlug?: string;
}) {
const [form, setForm] = useState({ fullName: "", email: "", phone: "", message: "" });
const [form, setForm] = useState({
fullName: "",
email: "",
phone: "",
position: "",
organization: "",
message: "",
});
const [loading, setLoading] = useState(false);
const [error, setError] = useState("");
const [sent, setSent] = useState(false);
@@ -91,6 +98,28 @@ export function ContactInterestForm({
className="h-11"
/>
</div>
<div className="grid gap-4 sm:grid-cols-2">
<div className="space-y-1.5">
<Label htmlFor="position">سمت</Label>
<Input
id="position"
value={form.position}
onChange={(e) => set("position", e.target.value)}
required
className="h-11"
/>
</div>
<div className="space-y-1.5">
<Label htmlFor="organization">سازمان</Label>
<Input
id="organization"
value={form.organization}
onChange={(e) => set("organization", e.target.value)}
required
className="h-11"
/>
</div>
</div>
<div className="space-y-1.5">
<Label htmlFor="message">پیام</Label>
<Textarea
@@ -105,4 +134,4 @@ export function ContactInterestForm({
</Button>
</form>
);
}
}
+1 -1
View File
@@ -4,8 +4,8 @@ import { Container } from "@/components/atoms/Container";
import { Separator } from "@/components/ui/separator";
import {
siteAddress,
siteShortName,
siteUniversity,
siteShortName,
} from "@/lib/site-config";
export function SiteFooter({
@@ -24,7 +24,7 @@ type Payload = {
title: string;
summary: string;
category: string;
durationHours: number;
durationHours: number | null;
format: string;
price: number | null;
registrationUrl: string;
@@ -45,8 +45,8 @@ export function CourseForm({ initial }: CourseFormProps) {
title: initial?.title ?? "",
summary: initial?.summary ?? "",
category: initial?.category ?? "leadership",
durationHours: initial?.durationHours ?? 16,
format: initial?.format ?? "online",
durationHours: initial?.durationHours ?? null,
format: initial?.format ?? "in-person",
price: initial?.price ?? null,
registrationUrl: initial?.registrationUrl ?? "/register/",
imageUrl: initial?.imageUrl ?? "",
@@ -186,12 +186,10 @@ export function CourseForm({ initial }: CourseFormProps) {
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="leadership">رهبری</SelectItem>
<SelectItem value="technology">فناوری</SelectItem>
<SelectItem value="innovation">نوآوری</SelectItem>
<SelectItem value="energy">انرژی</SelectItem>
<SelectItem value="design">طراحی</SelectItem>
<SelectItem value="digital">دیجیتال</SelectItem>
<SelectItem value="technology">هوش مصنوعی و تحول سازمان</SelectItem>
<SelectItem value="digital">برند و بازاریابی</SelectItem>
<SelectItem value="innovation">برندینگ</SelectItem>
<SelectItem value="leadership">هم‌اندیشی مدیریتی</SelectItem>
</SelectContent>
</Select>
</div>
@@ -214,9 +212,15 @@ export function CourseForm({ initial }: CourseFormProps) {
id="durationHours"
type="number"
min={1}
value={form.durationHours}
onChange={(e) => set("durationHours", Number(e.target.value))}
required
value={form.durationHours ?? ""}
onChange={(e) => {
const raw = e.target.value;
set(
"durationHours",
raw === "" ? null : Number(raw),
);
}}
placeholder="اختیاری"
/>
</div>
<div className="space-y-1.5 sm:col-span-3">
@@ -107,6 +107,8 @@ export function RegistrationsTable({ rows }: { rows: AdminRegistration[] }) {
<TableHead>نام</TableHead>
<TableHead>ایمیل</TableHead>
<TableHead>تلفن</TableHead>
<TableHead>سمت</TableHead>
<TableHead>سازمان</TableHead>
<TableHead>دوره</TableHead>
<TableHead>وضعیت</TableHead>
<TableHead>تغییر وضعیت</TableHead>
@@ -120,6 +122,8 @@ export function RegistrationsTable({ rows }: { rows: AdminRegistration[] }) {
<TableCell className="font-medium">{lead.full_name}</TableCell>
<TableCell className="text-muted-foreground">{lead.email}</TableCell>
<TableCell className="text-muted-foreground">{lead.phone ?? "—"}</TableCell>
<TableCell className="text-muted-foreground">{lead.position ?? "—"}</TableCell>
<TableCell className="text-muted-foreground">{lead.organization ?? "—"}</TableCell>
<TableCell className="text-muted-foreground">
{lead.course_slug ?? "—"}
</TableCell>