|
|
@ -1,10 +1,80 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div |
|
|
|
<div |
|
|
|
|
|
|
|
v-if="isCourseLoading" |
|
|
|
|
|
|
|
class="flex flex-col gap-4" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<div class="flex gap-4 items-center"> |
|
|
|
|
|
|
|
<Skeleton |
|
|
|
|
|
|
|
height="2.5rem" |
|
|
|
|
|
|
|
width="12rem" |
|
|
|
|
|
|
|
class="mr-auto" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<Skeleton |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
height="2.5rem" |
|
|
|
|
|
|
|
width="8rem" |
|
|
|
|
|
|
|
v-if="isCurrentTeacher" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<Skeleton |
|
|
|
|
|
|
|
height="2.5rem" |
|
|
|
|
|
|
|
width="3rem" |
|
|
|
|
|
|
|
v-if="isCurrentTeacher" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Skeleton |
|
|
|
|
|
|
|
height="16rem" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="flex items-center gap-6"> |
|
|
|
|
|
|
|
<Skeleton |
|
|
|
|
|
|
|
height="1.5rem" |
|
|
|
|
|
|
|
width="6rem" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<Skeleton |
|
|
|
|
|
|
|
v-if="isCurrentTeacher" |
|
|
|
|
|
|
|
height="1.5rem" |
|
|
|
|
|
|
|
width="6rem" |
|
|
|
|
|
|
|
class="ml-auto" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<Skeleton |
|
|
|
|
|
|
|
v-if="isCurrentTeacher" |
|
|
|
|
|
|
|
height="1.5rem" |
|
|
|
|
|
|
|
width="6rem" |
|
|
|
|
|
|
|
class="aspect-square" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<Skeleton |
|
|
|
|
|
|
|
v-if="isCurrentTeacher" |
|
|
|
|
|
|
|
height="1.5rem" |
|
|
|
|
|
|
|
width="6rem" |
|
|
|
|
|
|
|
class="aspect-square" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<Skeleton |
|
|
|
|
|
|
|
v-if="isCurrentTeacher" |
|
|
|
|
|
|
|
height="1.5rem" |
|
|
|
|
|
|
|
width="6rem" |
|
|
|
|
|
|
|
class="aspect-square" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<hr class="mt-0 mb-4"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="grid gap-y-12 sm:gap-x-5 md:gap-x-16 md:gap-y-12 justify-between grid-cols-course-tools"> |
|
|
|
|
|
|
|
<Skeleton |
|
|
|
|
|
|
|
v-for="v in 30" |
|
|
|
|
|
|
|
:key="v" |
|
|
|
|
|
|
|
height="auto" |
|
|
|
|
|
|
|
width="7.5rem" |
|
|
|
|
|
|
|
class="aspect-square" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div |
|
|
|
|
|
|
|
v-else |
|
|
|
class="flex flex-col gap-4" |
|
|
|
class="flex flex-col gap-4" |
|
|
|
> |
|
|
|
> |
|
|
|
<div class="flex gap-4 items-center"> |
|
|
|
<div class="flex gap-4 items-center"> |
|
|
|
<h2 |
|
|
|
<h2 |
|
|
|
v-if="course" |
|
|
|
|
|
|
|
class="mr-auto" |
|
|
|
class="mr-auto" |
|
|
|
> |
|
|
|
> |
|
|
|
{{ course.title }} |
|
|
|
{{ course.title }} |
|
|
@ -12,10 +82,6 @@ |
|
|
|
({{ session.name }}) |
|
|
|
({{ session.name }}) |
|
|
|
</small> |
|
|
|
</small> |
|
|
|
</h2> |
|
|
|
</h2> |
|
|
|
<Skeleton |
|
|
|
|
|
|
|
v-else |
|
|
|
|
|
|
|
height="2rem" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Button |
|
|
|
<Button |
|
|
|
v-if="course && isCurrentTeacher" |
|
|
|
v-if="course && isCurrentTeacher" |
|
|
@ -67,27 +133,19 @@ |
|
|
|
@click="updateIntro(intro)" |
|
|
|
@click="updateIntro(intro)" |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div |
|
|
|
<EmptyState |
|
|
|
v-else |
|
|
|
v-else-if="introTool" |
|
|
|
|
|
|
|
:summary="t('You don\'t have any course content yet.')" |
|
|
|
|
|
|
|
:detail="t('Add a course introduction to display to your students.')" |
|
|
|
|
|
|
|
icon="mdi mdi-book-open-page-variant" |
|
|
|
> |
|
|
|
> |
|
|
|
<EmptyState |
|
|
|
<Button |
|
|
|
v-if="introTool" |
|
|
|
class="mt-4 p-button-outlined" |
|
|
|
:summary="t('You don\'t have any course content yet.')" |
|
|
|
icon="mdi mdi-plus" |
|
|
|
:detail="t('Add a course introduction to display to your students.')" |
|
|
|
:label="t('Course introduction')" |
|
|
|
icon="mdi mdi-book-open-page-variant" |
|
|
|
@click="addIntro(course, introTool)" |
|
|
|
> |
|
|
|
|
|
|
|
<Button |
|
|
|
|
|
|
|
class="mt-4 p-button-outlined" |
|
|
|
|
|
|
|
icon="mdi mdi-plus" |
|
|
|
|
|
|
|
:label="t('Course introduction')" |
|
|
|
|
|
|
|
@click="addIntro(course, introTool)" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</EmptyState> |
|
|
|
|
|
|
|
<Skeleton |
|
|
|
|
|
|
|
v-else |
|
|
|
|
|
|
|
height="18rem" |
|
|
|
|
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</EmptyState> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div |
|
|
|
<div |
|
|
|
v-else-if="intro" |
|
|
|
v-else-if="intro" |
|
|
@ -96,48 +154,22 @@ |
|
|
|
|
|
|
|
|
|
|
|
<div class="flex items-center gap-6"> |
|
|
|
<div class="flex items-center gap-6"> |
|
|
|
<h6 v-t="'Tools'" /> |
|
|
|
<h6 v-t="'Tools'" /> |
|
|
|
|
|
|
|
|
|
|
|
<Skeleton |
|
|
|
|
|
|
|
v-if="!course" |
|
|
|
|
|
|
|
height="2rem" |
|
|
|
|
|
|
|
width="6rem" |
|
|
|
|
|
|
|
class="ml-auto aspect-square" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<Skeleton |
|
|
|
|
|
|
|
v-if="!course" |
|
|
|
|
|
|
|
height="2rem" |
|
|
|
|
|
|
|
width="6rem" |
|
|
|
|
|
|
|
class="aspect-square" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<Skeleton |
|
|
|
|
|
|
|
v-if="!course" |
|
|
|
|
|
|
|
height="2rem" |
|
|
|
|
|
|
|
width="6rem" |
|
|
|
|
|
|
|
class="aspect-square" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<Skeleton |
|
|
|
|
|
|
|
v-if="!course" |
|
|
|
|
|
|
|
height="2rem" |
|
|
|
|
|
|
|
width="6rem" |
|
|
|
|
|
|
|
class="aspect-square" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Button |
|
|
|
<Button |
|
|
|
v-if="course && isCurrentTeacher" |
|
|
|
v-if="isCurrentTeacher" |
|
|
|
icon="mdi mdi-eye" |
|
|
|
icon="mdi mdi-eye" |
|
|
|
:label="t('Show all')" |
|
|
|
:label="t('Show all')" |
|
|
|
class="p-button-text p-button-plain p-button-sm ml-auto" |
|
|
|
class="p-button-text p-button-plain p-button-sm ml-auto" |
|
|
|
:disabled="isSorting || isCustomizing" |
|
|
|
:disabled="isSorting || isCustomizing" |
|
|
|
/> |
|
|
|
/> |
|
|
|
<Button |
|
|
|
<Button |
|
|
|
v-if="course && isCurrentTeacher" |
|
|
|
v-if="isCurrentTeacher" |
|
|
|
icon="mdi mdi-eye-off" |
|
|
|
icon="mdi mdi-eye-off" |
|
|
|
:label="t('Hide all')" |
|
|
|
:label="t('Hide all')" |
|
|
|
class="p-button-text p-button-plain p-button-sm" |
|
|
|
class="p-button-text p-button-plain p-button-sm" |
|
|
|
:disabled="isSorting || isCustomizing" |
|
|
|
:disabled="isSorting || isCustomizing" |
|
|
|
/> |
|
|
|
/> |
|
|
|
<ToggleButton |
|
|
|
<ToggleButton |
|
|
|
v-if="course && isCurrentTeacher" |
|
|
|
v-if="isCurrentTeacher" |
|
|
|
v-model="isSorting" |
|
|
|
v-model="isSorting" |
|
|
|
on-icon="mdi mdi-swap-vertical" |
|
|
|
on-icon="mdi mdi-swap-vertical" |
|
|
|
off-icon="mdi mdi-swap-vertical" |
|
|
|
off-icon="mdi mdi-swap-vertical" |
|
|
@ -147,7 +179,7 @@ |
|
|
|
:disabled="isCustomizing" |
|
|
|
:disabled="isCustomizing" |
|
|
|
/> |
|
|
|
/> |
|
|
|
<ToggleButton |
|
|
|
<ToggleButton |
|
|
|
v-if="course && isCurrentTeacher" |
|
|
|
v-if="isCurrentTeacher" |
|
|
|
v-model="isCustomizing" |
|
|
|
v-model="isCustomizing" |
|
|
|
on-icon="mdi mdi-format-paint" |
|
|
|
on-icon="mdi mdi-format-paint" |
|
|
|
off-icon="mdi mdi-format-paint" |
|
|
|
off-icon="mdi mdi-format-paint" |
|
|
@ -159,22 +191,7 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<hr class="mt-0 mb-4"> |
|
|
|
<hr class="mt-0 mb-4"> |
|
|
|
|
|
|
|
|
|
|
|
<div |
|
|
|
<div class="grid gap-y-12 sm:gap-x-5 md:gap-x-16 md:gap-y-12 justify-between grid-cols-course-tools"> |
|
|
|
v-if="!course" |
|
|
|
|
|
|
|
class="grid gap-y-12 sm:gap-x-5 md:gap-x-16 md:gap-y-12 justify-between grid-cols-course-tools" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<Skeleton |
|
|
|
|
|
|
|
v-for="v in 30" |
|
|
|
|
|
|
|
:key="v" |
|
|
|
|
|
|
|
height="auto" |
|
|
|
|
|
|
|
width="7.5rem" |
|
|
|
|
|
|
|
class="aspect-square" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div |
|
|
|
|
|
|
|
v-else |
|
|
|
|
|
|
|
class="grid gap-y-12 sm:gap-x-5 md:gap-x-16 md:gap-y-12 justify-between grid-cols-course-tools" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<CourseToolList |
|
|
|
<CourseToolList |
|
|
|
v-for="(tool, index) in tools.authoring" |
|
|
|
v-for="(tool, index) in tools.authoring" |
|
|
|
:key="index" |
|
|
|
:key="index" |
|
|
@ -248,6 +265,8 @@ const createInSession = ref(false); |
|
|
|
let courseId = route.params.id; |
|
|
|
let courseId = route.params.id; |
|
|
|
let sessionId = route.query.sid ?? 0; |
|
|
|
let sessionId = route.query.sid ?? 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const isCourseLoading = ref(true); |
|
|
|
|
|
|
|
|
|
|
|
const isCurrentTeacher = computed(() => store.getters['security/isCurrentTeacher']); |
|
|
|
const isCurrentTeacher = computed(() => store.getters['security/isCurrentTeacher']); |
|
|
|
|
|
|
|
|
|
|
|
const isSorting = ref(false); |
|
|
|
const isSorting = ref(false); |
|
|
@ -277,6 +296,8 @@ axios |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
getIntro(); |
|
|
|
getIntro(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
isCourseLoading.value = false; |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch(error => console.log(error)); |
|
|
|
.catch(error => console.log(error)); |
|
|
|
|
|
|
|
|
|
|
@ -304,17 +325,19 @@ async function getIntro () { |
|
|
|
sid: sessionId, |
|
|
|
sid: sessionId, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
store.dispatch('ctoolintro/findAll', filter) |
|
|
|
try { |
|
|
|
.then(response => { |
|
|
|
const response = await store.dispatch('ctoolintro/findAll', filter); |
|
|
|
if (response) { |
|
|
|
if (response) { |
|
|
|
if (sessionId) { |
|
|
|
if (sessionId) { |
|
|
|
createInSession.value = false; |
|
|
|
createInSession.value = false; |
|
|
|
} |
|
|
|
|
|
|
|
// first item |
|
|
|
|
|
|
|
intro.value = response[0]; |
|
|
|
|
|
|
|
translateHtml(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
// first item |
|
|
|
|
|
|
|
intro.value = response[0]; |
|
|
|
|
|
|
|
translateHtml(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
|
|
console.error(e); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|