feat: lesson pagination

This commit is contained in:
Jannat Patel
2023-12-18 19:17:17 +05:30
parent 372425bed2
commit 5928b8e5f9
7 changed files with 35 additions and 16 deletions

View File

@@ -1,11 +0,0 @@
<template>
</template>
<script setup>
const props = defineProps({
batchName: {
type: Object,
required: true,
},
})
</script>

View File

@@ -24,6 +24,12 @@
<Star class="h-4 w-4 text-gray-700" />
<span> {{ course.avg_rating }} </span>
</div>
<div v-if="course.status != 'Approved'">
<Badge variant="solid" :theme="course.status === 'Under Review' ? 'orange' : 'blue'" size="sm">
{{ course.status }}
</Badge>
</div>
</div>
<div class="text-xl font-semibold">
@@ -65,9 +71,9 @@
</template>
<script setup>
import { BookOpen, Users, Star } from 'lucide-vue-next'
import { computed } from 'vue'
import UserAvatar from '@/components/UserAvatar.vue'
import { sessionStore } from '@/stores/session'
import { Badge } from "frappe-ui"
const { isLoggedIn, user } = sessionStore()

View File

@@ -13,7 +13,7 @@
</DisclosureButton>
<DisclosurePanel class="px-10 pb-4" :static="index == 0">
<div v-for="lesson in chapter.lessons" :key="lesson.name">
<div class="flex items-center text-base mb-2">
<div class="flex items-center text-base mb-3">
<MonitorPlay v-if="lesson.icon === 'icon-youtube'" class="h-4 w-4 text-gray-900 stroke-1 mr-2"/>
<HelpCircle v-else-if="lesson.icon === 'icon-quiz'" class="h-4 w-4 text-gray-900 stroke-1 mr-2"/>
<FileText v-else-if="lesson.icon === 'icon-list'" class="h-4 w-4 text-gray-900 stroke-1 mr-2"/>

View File

@@ -107,7 +107,6 @@ const rating_percent = computed(() => {
}
[1,2,3,4,5].forEach((key) => {
console.log(key, rating_count[key], reviews.data.length);
rating_percent[key] = (rating_count[key] / reviews.data.length * 100).toFixed(2);
});
return rating_percent;