Enhance image upload functionality for admin and improve course navigation. Added support for image uploads in course forms and generic forms, utilizing a new ImageUploadField component. Updated navigation to dynamically include course tags and refined layout components for better user experience. Configured Docker for persistent uploads with a dedicated volume.
This commit is contained in:
1 parent
ef1ccea0ad
commit
66a8e8f213
29 files changed
+748
-125
No files matched your search
@@ -1,9 +1,15 @@
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { SiteFooter } from "@/components/organisms/SiteFooter";
|
||||
import { SiteHeader } from "@/components/organisms/SiteHeader";
|
||||
import { getCourses } from "@/lib/data/courses";
|
||||
import { buildCourseNavChildren } from "@/lib/course-nav";
|
||||
import { getCourses, listPublishedCourseTags } from "@/lib/data/courses";
|
||||
import { getPrograms } from "@/lib/data/programs";
|
||||
import { professionalNav, siteShortName } from "@/lib/site-config";
|
||||
import {
|
||||
courseNavParentTag,
|
||||
courseNavTagOrder,
|
||||
professionalNav,
|
||||
siteShortName,
|
||||
} from "@/lib/site-config";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
@@ -16,16 +22,31 @@ export default async function ProfessionalLayout({
|
||||
const year = new Date().getFullYear();
|
||||
let courses: Awaited<ReturnType<typeof getCourses>> = [];
|
||||
let programs: Awaited<ReturnType<typeof getPrograms>> = [];
|
||||
let courseTags: string[] = [...courseNavTagOrder];
|
||||
try {
|
||||
[courses, programs] = await Promise.all([getCourses(), getPrograms()]);
|
||||
[courses, programs, courseTags] = await Promise.all([
|
||||
getCourses(),
|
||||
getPrograms(),
|
||||
listPublishedCourseTags(),
|
||||
]);
|
||||
if (courseTags.length === 0) courseTags = [...courseNavTagOrder];
|
||||
} catch (err) {
|
||||
console.error("[professional/layout] CMS fetch failed:", err);
|
||||
}
|
||||
|
||||
const navItems = professionalNav.map((item) =>
|
||||
item.label === courseNavParentTag
|
||||
? {
|
||||
...item,
|
||||
children: buildCourseNavChildren(courseTags),
|
||||
}
|
||||
: item,
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<SiteHeader
|
||||
items={professionalNav}
|
||||
items={navItems}
|
||||
searchLabel={t("nav.search")}
|
||||
brandTitle={siteShortName}
|
||||
brandSubtitle={t("nav.brandSubtitle")}
|
||||
|
||||
Reference in new issue
Block a user