mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
add: more commits
Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
// data/placement.data.js
|
||||
//
|
||||
// Mirrors the backend placement registry (models/advertisements/advertisements.placements.js
|
||||
// in new_starr). Each entry is a page + position slot; the format (hero/banner/popup/sidebar)
|
||||
// is derived from the placement, never chosen independently. Keep this list in sync with the
|
||||
// backend registry when adding a new placement — same pattern as ADVERTISEMENT_TYPES already
|
||||
// mirroring the backend type ENUM.
|
||||
|
||||
export const PLACEMENTS = [
|
||||
{ key: "dashboard.hero", format: "hero", page: "dashboard", pageLabel: "Dashboard", slotLabel: "Hero (top of page)" },
|
||||
{ key: "dashboard.popup", format: "popup", page: "dashboard", pageLabel: "Dashboard", slotLabel: "Popup (on load)" },
|
||||
{ key: "course_list.banner", format: "banner", page: "course_list", pageLabel: "Courses", slotLabel: "Banner (above course grid)" },
|
||||
{ key: "course_details.banner", format: "banner", page: "course_details", pageLabel: "Course Details", slotLabel: "Banner (below hero)" },
|
||||
{ key: "course_details.sidebar", format: "sidebar", page: "course_details", pageLabel: "Course Details", slotLabel: "Sidebar (beside course content)" },
|
||||
{ key: "plans.banner", format: "banner", page: "plans", pageLabel: "Plans", slotLabel: "Banner (above plan cards)" },
|
||||
];
|
||||
|
||||
export const PLACEMENT_MAP = Object.fromEntries(PLACEMENTS.map((p) => [p.key, p]));
|
||||
|
||||
// Grouped by page — powers the cascading Page → Position picker in Add/EditAdvertisement.
|
||||
export const AD_PAGES = Object.values(
|
||||
PLACEMENTS.reduce((acc, p) => {
|
||||
if (!acc[p.page]) acc[p.page] = { page: p.page, pageLabel: p.pageLabel, placements: [] };
|
||||
acc[p.page].placements.push(p);
|
||||
return acc;
|
||||
}, {})
|
||||
);
|
||||
Reference in New Issue
Block a user