fix: misc lesson issues

This commit is contained in:
Jannat Patel
2024-04-25 16:41:56 +05:30
parent 804fc8e391
commit 1a2cb0fc3c
9 changed files with 1013 additions and 806 deletions

View File

@@ -2,9 +2,9 @@
<div class="text-base"> <div class="text-base">
<div <div
v-if="title && (outline.data?.length || allowEdit)" v-if="title && (outline.data?.length || allowEdit)"
class="flex items-center justify-between mb-4" class="flex items-center justify-between mb-4 pl-2"
> >
<div class="font-semibold" :class="allowEdit ? 'text-base' : 'text-lg'"> <div class="font-semibold text-lg">
{{ __(title) }} {{ __(title) }}
</div> </div>
<Button size="sm" v-if="allowEdit" @click="openChapterModal()"> <Button size="sm" v-if="allowEdit" @click="openChapterModal()">
@@ -73,7 +73,7 @@
</router-link> </router-link>
</div> </div>
</div> </div>
<div v-if="allowEdit" class="flex mt-2 pl-8"> <div v-if="allowEdit" class="flex mt-2 mb-4 pl-8">
<router-link <router-link
:to="{ :to="{
name: 'CreateLesson', name: 'CreateLesson',

View File

@@ -24,7 +24,12 @@
<Quiz :quiz="getId(block)" /> <Quiz :quiz="getId(block)" />
</div> </div>
<div v-else-if="block.includes('{{ Video')"> <div v-else-if="block.includes('{{ Video')">
<video controls width="100%" controlsList="nodownload"> <video
controls
width="100%"
controlsList="nodownload"
oncontextmenu="return false;"
>
<source :src="getId(block)" type="video/mp4" /> <source :src="getId(block)" type="video/mp4" />
</video> </video>
</div> </div>

View File

@@ -16,6 +16,7 @@
muted muted
width="100%" width="100%"
controlsList="nodownload" controlsList="nodownload"
oncontextmenu="return false;"
class="rounded-sm" class="rounded-sm"
> >
<source src="/Youtube.mov" type="video/mp4" /> <source src="/Youtube.mov" type="video/mp4" />

View File

@@ -165,7 +165,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="border-l px-5 pt-5"> <div class="border-l pt-5">
<!-- <CreateOutline v-if="courseResource.doc" :course="courseResource.doc"/> --> <!-- <CreateOutline v-if="courseResource.doc" :course="courseResource.doc"/> -->
<CourseOutline <CourseOutline
v-if="courseResource.data" v-if="courseResource.data"
@@ -220,7 +220,7 @@ const course = reactive({
}) })
onMounted(() => { onMounted(() => {
if (!user.data?.is_moderator || !user.data?.is_instructor) { if (!user.data?.is_moderator && !user.data?.is_instructor) {
router.push({ name: 'Courses' }) router.push({ name: 'Courses' })
} }
if (props.courseName !== 'new') { if (props.courseName !== 'new') {

View File

@@ -114,6 +114,7 @@ const renderEditor = (holder) => {
return new EditorJS({ return new EditorJS({
holder: holder, holder: holder,
tools: getEditorTools(), tools: getEditorTools(),
autofocus: true,
}) })
} }

View File

@@ -151,7 +151,7 @@
</div> </div>
</div> </div>
<div class="sticky top-10"> <div class="sticky top-10">
<div class="bg-gray-50 p-5 border-b"> <div class="bg-gray-50 py-5 pl-2 border-b">
<div class="text-lg font-semibold"> <div class="text-lg font-semibold">
{{ lesson.data.course_title }} {{ lesson.data.course_title }}
</div> </div>
@@ -381,10 +381,6 @@ const allowInstructorContent = () => {
font-weight: 500; font-weight: 500;
} }
.codex-editor__redactor {
padding-bottom: 0 !important;
}
.embed-tool__caption { .embed-tool__caption {
display: none; display: none;
} }

View File

@@ -137,6 +137,9 @@ export function getEditorTools() {
paragraph: { paragraph: {
class: Paragraph, class: Paragraph,
inlineToolbar: true, inlineToolbar: true,
config: {
preserveBlank: true,
},
}, },
codeBox: { codeBox: {
class: CodeBox, class: CodeBox,

View File

@@ -16,7 +16,7 @@ export class Upload {
renderUpload(file) { renderUpload(file) {
if (this.isVideo(file.file_type)) { if (this.isVideo(file.file_type)) {
return `<video controls width='100%' controlsList='nodownload' class="mb-4"> return `<video controls width='100%' controlsList='nodownload' class="mb-4" oncontextmenu="return false;">
<source src=${encodeURI(file.file_url)} type='video/mp4'> <source src=${encodeURI(file.file_url)} type='video/mp4'>
</video>` </video>`
} else if (this.isAudio(file.file_type)) { } else if (this.isAudio(file.file_type)) {

File diff suppressed because it is too large Load Diff