mirror of
https://github.com/frappe/lms.git
synced 2026-05-02 13:39:31 +03:00
@@ -1,5 +0,0 @@
|
||||
<template>
|
||||
<div class="flex border-b sticky pr-5">
|
||||
<div id="app-header" class="flex-1"></div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -70,6 +70,9 @@
|
||||
<FileUploader
|
||||
v-if="!submissionFile"
|
||||
:fileTypes="getType()"
|
||||
:uploadArgs="{
|
||||
private: true,
|
||||
}"
|
||||
:validateFile="validateFile"
|
||||
@success="(file) => saveSubmission(file)"
|
||||
>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
style="min-height: 350px"
|
||||
>
|
||||
<div
|
||||
class="w-[100%] h-[168px] bg-cover bg-center bg-no-repeat"
|
||||
class="w-[100%] h-[168px] bg-cover bg-center bg-no-repeat border-t border-x rounded-t-md"
|
||||
:style="
|
||||
course.image
|
||||
? { backgroundImage: `url('${encodeURI(course.image)}')` }
|
||||
|
||||
@@ -169,6 +169,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<CourseProgressSummary
|
||||
v-if="user.data?.is_moderator || is_instructor()"
|
||||
v-model="showProgressModal"
|
||||
:courseName="course.data.name"
|
||||
:enrollments="course.data.enrollments"
|
||||
|
||||
@@ -10,5 +10,4 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import AppSidebar from './AppSidebar.vue'
|
||||
import AppHeader from './AppHeader.vue'
|
||||
</script>
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
<template>
|
||||
<Teleport to="#app-header" v-if="showHeader">
|
||||
<slot>
|
||||
<header
|
||||
class="flex h-10.5 items-center justify-between py-[7px] sm:pl-5 pl-2"
|
||||
>
|
||||
<div class="flex items-center gap-2">
|
||||
<slot name="left-header" />
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<slot name="right-header" class="flex items-center gap-2" />
|
||||
</div>
|
||||
</header>
|
||||
</slot>
|
||||
</Teleport>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, nextTick } from 'vue'
|
||||
|
||||
const showHeader = ref(false)
|
||||
|
||||
nextTick(() => {
|
||||
showHeader.value = true
|
||||
})
|
||||
</script>
|
||||
@@ -152,6 +152,7 @@ const show = defineModel<boolean>({ default: false })
|
||||
const searchFilter = ref<string | null>(null)
|
||||
type Filters = {
|
||||
course: string | undefined
|
||||
|
||||
member_name?: string[]
|
||||
}
|
||||
|
||||
|
||||
@@ -103,9 +103,10 @@ import {
|
||||
Tooltip,
|
||||
usePageMeta,
|
||||
} from 'frappe-ui'
|
||||
import { computed, watch } from 'vue'
|
||||
import { computed, inject, watch } from 'vue'
|
||||
import { Users, Star } from 'lucide-vue-next'
|
||||
import { sessionStore } from '@/stores/session'
|
||||
import { useRouter } from 'vue-router'
|
||||
import CourseCardOverlay from '@/components/CourseCardOverlay.vue'
|
||||
import CourseOutline from '@/components/CourseOutline.vue'
|
||||
import CourseReviews from '@/components/CourseReviews.vue'
|
||||
@@ -114,6 +115,8 @@ import CourseInstructors from '@/components/CourseInstructors.vue'
|
||||
import RelatedCourses from '@/components/RelatedCourses.vue'
|
||||
|
||||
const { brand } = sessionStore()
|
||||
const router = useRouter()
|
||||
const user = inject('$user')
|
||||
|
||||
const props = defineProps({
|
||||
courseName: {
|
||||
@@ -140,6 +143,24 @@ watch(
|
||||
}
|
||||
)
|
||||
|
||||
watch(course, () => {
|
||||
if (!isInstructor() && !course.data?.published && !course.data?.upcoming) {
|
||||
router.push({
|
||||
name: 'Courses',
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
const isInstructor = () => {
|
||||
let user_is_instructor = false
|
||||
course.data?.instructors.forEach((instructor) => {
|
||||
if (!user_is_instructor && instructor.name == user.data?.name) {
|
||||
user_is_instructor = true
|
||||
}
|
||||
})
|
||||
return user_is_instructor
|
||||
}
|
||||
|
||||
const breadcrumbs = computed(() => {
|
||||
let items = [{ label: 'Courses', route: { name: 'Courses' } }]
|
||||
items.push({
|
||||
|
||||
Reference in New Issue
Block a user