From 982acb07116ea2fd6580a4a1bb191a51d8716a59 Mon Sep 17 00:00:00 2001 From: Adeyemi Adetunji Date: Sat, 7 Sep 2024 10:18:21 +0100 Subject: [PATCH] feat: Update course landing page with sections (#456) * feat: add sections ui to the landing page * quick fixes * quick fixes * feat: add translations * run translation script * fix: sections not showing on the landing page --------- Co-authored-by: Rotimi Best --- .../components/SectionsDisplay.svelte | 49 ++++++ .../components/CourseLandingPage/index.svelte | 141 ++++++++++++------ .../src/lib/utils/services/courses/index.ts | 2 +- .../src/lib/utils/translations/de.json | 6 +- .../src/lib/utils/translations/en.json | 4 + .../src/lib/utils/translations/es.json | 6 +- .../src/lib/utils/translations/fr.json | 6 +- .../src/lib/utils/translations/hi.json | 6 +- .../src/lib/utils/translations/pt.json | 6 +- .../src/lib/utils/translations/ru.json | 6 +- .../src/lib/utils/translations/vi.json | 6 +- .../courses/[id]/landingpage/+page.svelte | 13 +- 12 files changed, 193 insertions(+), 58 deletions(-) create mode 100644 apps/dashboard/src/lib/components/CourseLandingPage/components/SectionsDisplay.svelte diff --git a/apps/dashboard/src/lib/components/CourseLandingPage/components/SectionsDisplay.svelte b/apps/dashboard/src/lib/components/CourseLandingPage/components/SectionsDisplay.svelte new file mode 100644 index 00000000..ace1f5a0 --- /dev/null +++ b/apps/dashboard/src/lib/components/CourseLandingPage/components/SectionsDisplay.svelte @@ -0,0 +1,49 @@ + + +
+ +
+ + toggleShowLessons(index)}> + {#if showLessons[index]} + + {:else} + + {/if} + + {title} + {lessonCount} + {$t('course.navItem.landing_page.lessons')}, {exerciseCount} + {$t('course.navItem.landing_page.exercises')} +
+ + + {#if showLessons[index]} + {#each lessons as lesson} +
+ + {lesson.title} +
+ {/each} + {/if} +
diff --git a/apps/dashboard/src/lib/components/CourseLandingPage/index.svelte b/apps/dashboard/src/lib/components/CourseLandingPage/index.svelte index b312ac1e..7423dc41 100644 --- a/apps/dashboard/src/lib/components/CourseLandingPage/index.svelte +++ b/apps/dashboard/src/lib/components/CourseLandingPage/index.svelte @@ -1,32 +1,34 @@