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
@@ -2,10 +2,11 @@ import { getTranslations } from "next-intl/server";
|
||||
import { CampaignBanners } from "@/components/organisms/CampaignBanners";
|
||||
import { SiteFooter } from "@/components/organisms/SiteFooter";
|
||||
import { SiteHeader } from "@/components/organisms/SiteHeader";
|
||||
import { getCourses } from "@/lib/data/courses";
|
||||
import { buildHomeNavWithCourseTags } from "@/lib/course-nav";
|
||||
import { getCourses, listPublishedCourseTags } from "@/lib/data/courses";
|
||||
import { getPrograms } from "@/lib/data/programs";
|
||||
import { getCampaignBanners } from "@/lib/data/site";
|
||||
import { homeNav, siteShortName } from "@/lib/site-config";
|
||||
import { courseNavTagOrder, siteShortName } from "@/lib/site-config";
|
||||
|
||||
// Public CMS pages must read Postgres at request time — static bake at Docker
|
||||
// build often has no DATABASE_URL and ships empty lists.
|
||||
@@ -21,20 +22,25 @@ export default async function MainLayout({
|
||||
let courses: Awaited<ReturnType<typeof getCourses>> = [];
|
||||
let programs: Awaited<ReturnType<typeof getPrograms>> = [];
|
||||
let banners: Awaited<ReturnType<typeof getCampaignBanners>> = [];
|
||||
let courseTags: string[] = [...courseNavTagOrder];
|
||||
try {
|
||||
[courses, programs, banners] = await Promise.all([
|
||||
[courses, programs, banners, courseTags] = await Promise.all([
|
||||
getCourses(),
|
||||
getPrograms(),
|
||||
getCampaignBanners(),
|
||||
listPublishedCourseTags(),
|
||||
]);
|
||||
if (courseTags.length === 0) courseTags = [...courseNavTagOrder];
|
||||
} catch (err) {
|
||||
console.error("[main/layout] CMS fetch failed:", err);
|
||||
}
|
||||
|
||||
const navItems = buildHomeNavWithCourseTags(courseTags);
|
||||
|
||||
return (
|
||||
<>
|
||||
<SiteHeader
|
||||
items={homeNav}
|
||||
items={navItems}
|
||||
searchLabel={t("nav.search")}
|
||||
brandTitle={siteShortName}
|
||||
brandSubtitle={t("nav.brandSubtitle")}
|
||||
|
||||
Reference in new issue
Block a user