feat: Implement course discovery page with category sidebar filtering.
This commit is contained in:
parent
1eeec4d22c
commit
8ba1239685
3 changed files with 12 additions and 5 deletions
|
|
@ -35,7 +35,6 @@ const getLocalizedText = (text: any) => {
|
|||
<q-item
|
||||
v-for="cat in showAllCategories ? categories : categories.slice(0, 4)"
|
||||
:key="cat.id"
|
||||
tag="label"
|
||||
clickable
|
||||
v-ripple
|
||||
dense
|
||||
|
|
|
|||
|
|
@ -165,10 +165,12 @@ onMounted(() => {
|
|||
|
||||
<!-- LEFT SIDEBAR: Category Filter -->
|
||||
<div class="w-full lg:w-64 flex-shrink-0 lg:sticky lg:top-24 z-10">
|
||||
<CategorySidebar
|
||||
:categories="categories"
|
||||
v-model="selectedCategoryIds"
|
||||
/>
|
||||
<ClientOnly>
|
||||
<CategorySidebar
|
||||
:categories="categories"
|
||||
v-model="selectedCategoryIds"
|
||||
/>
|
||||
</ClientOnly>
|
||||
</div>
|
||||
|
||||
<!-- RIGHT CONTENT: Course Grid -->
|
||||
|
|
|
|||
|
|
@ -411,8 +411,14 @@ const performSaveProgress = async (force: boolean = false, keepalive: boolean =
|
|||
const isCompletedNow = res.success && (res.data?.is_completed || progressPercentage >= 0.95)
|
||||
|
||||
if (isCompletedNow) {
|
||||
const wasAlreadyCompleted = lesson.progress?.is_completed
|
||||
markLessonAsCompletedLocally(lesson.id)
|
||||
if (lesson.progress) lesson.progress.is_completed = true
|
||||
|
||||
// If newly completed, reload course data to unlock next lesson in sidebar
|
||||
if (!wasAlreadyCompleted) {
|
||||
await loadCourseData()
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Save progress failed', err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue