diff --git a/backend/src/main/kotlin/hu/bme/sch/cmsch/component/home/HomeComponent.kt b/backend/src/main/kotlin/hu/bme/sch/cmsch/component/home/HomeComponent.kt index 971ad64f..4c33ee89 100644 --- a/backend/src/main/kotlin/hu/bme/sch/cmsch/component/home/HomeComponent.kt +++ b/backend/src/main/kotlin/hu/bme/sch/cmsch/component/home/HomeComponent.kt @@ -33,7 +33,7 @@ class HomeComponent( displayGroup, welcomeMessage, - youtubeVideoId, + youtubeVideoIds, content, showEvents, @@ -78,9 +78,9 @@ class HomeComponent( fieldName = "Üdvözlő üzenet", description = "Ha üres akkor nincs, a {} pedig ki van cserélve az oldal nevére" ) - val youtubeVideoId = SettingProxy(componentSettingService, component, - "youtubeVideoId", "", type = SettingType.TEXT, - fieldName = "Promó videó", description = "Ha üres akkor nincs, csak youtube videó id-vel működik," + + val youtubeVideoIds = SettingProxy(componentSettingService, component, + "youtubeVideoIds", "", type = SettingType.TEXT, + fieldName = "Promó videó(k)", description = "Ha üres akkor nincs, csak youtube videó id-vel működik, ha többet szeretnél, vesszővel felsorolva tudod ezt megtenni" + " pl: '8PhToFtwKvY' (A '?controls=0' az opcionális)" ) diff --git a/frontend/src/api/contexts/config/types.ts b/frontend/src/api/contexts/config/types.ts index c0fb5d24..7b6b327d 100644 --- a/frontend/src/api/contexts/config/types.ts +++ b/frontend/src/api/contexts/config/types.ts @@ -105,7 +105,7 @@ export interface Home { title: string welcomeMessage: string content: string - youtubeVideoId: string + youtubeVideoIds: string showEvents: boolean showNews: boolean } diff --git a/frontend/src/pages/home/home.page.tsx b/frontend/src/pages/home/home.page.tsx index a1734e2f..58a4c2be 100644 --- a/frontend/src/pages/home/home.page.tsx +++ b/frontend/src/pages/home/home.page.tsx @@ -44,6 +44,10 @@ const HomePage = () => { const eventsToday = events?.filter((ev) => isToday(ev.timestampStart)) || [] const eventsLater = events?.filter((ev) => !isToday(ev.timestampStart)).slice(0, 3) || [] + const videoIds = homeConfig?.youtubeVideoIds + ?.split(',') + ?.map((videoId) => videoId.trim()) + ?.filter(Boolean) return ( @@ -80,7 +84,13 @@ const HomePage = () => { )} - {homeConfig?.youtubeVideoId && } + {videoIds?.length > 0 && ( + <> + {videoIds.map((videoId) => ( + + ))} + + )} {homeConfig?.content && (