|
|
|
|
@ -198,7 +198,7 @@ |
|
|
|
|
</div> |
|
|
|
|
<div class="lessons__subtitle subtitle">{{ lesson.title }}</div> |
|
|
|
|
<div class="lessons__row"> |
|
|
|
|
<div class="lessons__content">{{ lesson.short_description | linebreaks }}</div> |
|
|
|
|
<div class="lessons__content">{{ lesson.short_description }}</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</vue-draggable> |
|
|
|
|
@ -463,18 +463,18 @@ |
|
|
|
|
}, |
|
|
|
|
editLesson(lessonIndex) { |
|
|
|
|
this.currentLesson = this.lessons[lessonIndex]; |
|
|
|
|
history.push("/course/create/lessons/edit/"+this.currentLesson.id); |
|
|
|
|
history.push(`/course/${this.course.id}/lessons/${this.currentLesson.id}/edit`); |
|
|
|
|
this.viewSection = 'lessons-edit'; |
|
|
|
|
}, |
|
|
|
|
showCourse() { |
|
|
|
|
if (this.viewSection !== 'course') { |
|
|
|
|
history.push("/course/create"); |
|
|
|
|
history.push(this.course.id ? `/course/${this.course.id}/edit` : "/course/create"); |
|
|
|
|
} |
|
|
|
|
this.viewSection = 'course' |
|
|
|
|
}, |
|
|
|
|
showLessons() { |
|
|
|
|
if (this.viewSection !== 'lessons') { |
|
|
|
|
history.push("/course/create/lessons"); |
|
|
|
|
history.push(`/course/${this.course.id}/edit/lessons`); |
|
|
|
|
} |
|
|
|
|
this.viewSection = 'lessons'; |
|
|
|
|
}, |
|
|
|
|
@ -485,7 +485,7 @@ |
|
|
|
|
content: [], |
|
|
|
|
}; |
|
|
|
|
if (this.viewSection !== 'lessons-edit') { |
|
|
|
|
history.push("/course/create/lessons/new"); |
|
|
|
|
history.push(`/course/${this.course.id}/lessons/new`); |
|
|
|
|
} |
|
|
|
|
this.viewSection = 'lessons-edit'; |
|
|
|
|
window.scrollTo(0, 0); |
|
|
|
|
@ -558,7 +558,7 @@ |
|
|
|
|
return req; |
|
|
|
|
}, |
|
|
|
|
goToLessons() { |
|
|
|
|
history.push("/course/create/lessons"); |
|
|
|
|
history.push(`/course/${this.course.id}/edit/lessons`); |
|
|
|
|
this.viewSection = 'lessons'; |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
const elementTop = $('#course-redactor__nav').position().top - 130; |
|
|
|
|
@ -813,18 +813,17 @@ |
|
|
|
|
}, |
|
|
|
|
updateViewSection(location, action) { |
|
|
|
|
//console.log('updateViewSection[action]', action); |
|
|
|
|
if (location.pathname === '/course/create/lessons') { |
|
|
|
|
if (location.pathname.match(/course\/\d+\/edit\/lessons/)) { |
|
|
|
|
this.viewSection = 'lessons'; |
|
|
|
|
} else if (location.pathname === '/course/create') { |
|
|
|
|
this.viewSection = 'course'; |
|
|
|
|
} else if (location.pathname === '/course/create/lessons/new') { |
|
|
|
|
} else if (location.pathname.match(/course\/\d+\/lessons\/new/)){ |
|
|
|
|
this.viewSection = 'lessons-edit'; |
|
|
|
|
} else if (location.pathname.indexOf('/course/create/lessons/edit') !== -1) { |
|
|
|
|
let lessonId = parseInt(location.pathname.split('/').pop()); |
|
|
|
|
//console.log('lessonId', lessonId, this.lessons.toString()); |
|
|
|
|
//console.log('lessod edit', this.lessons.find((i)=>{return i.id === lessonId})); |
|
|
|
|
} else if (location.pathname.match(/course\/\d+\/lessons\/\d+\/edit/)) { |
|
|
|
|
// let lessonId = parseInt(location.pathname.split('/').pop()); |
|
|
|
|
const lessonId = +location.pathname.match(/lessons\/(\d+)\/edit/)[1]; |
|
|
|
|
this.currentLesson = this.lessons.find((i)=>{return i.id === lessonId}); |
|
|
|
|
this.viewSection = 'lessons-edit'; |
|
|
|
|
} else { |
|
|
|
|
this.viewSection = 'course'; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onLessonsChanged() { |
|
|
|
|
|