|
|
|
@ -25,11 +25,11 @@ |
|
|
|
<div class="info__title"> |
|
|
|
<div class="info__title"> |
|
|
|
<div class="info__field field field_info" |
|
|
|
<div class="info__field field field_info" |
|
|
|
v-bind:class="{ error: ($v.course.title.$dirty || showErrors) && $v.course.title.$invalid }"> |
|
|
|
v-bind:class="{ error: ($v.course.title.$dirty || showErrors) && $v.course.title.$invalid }"> |
|
|
|
<div class="field__label">НАЗВАНИЕ КУРСА</div> |
|
|
|
<div class="field__label">{{titles.courseTitle}}</div> |
|
|
|
<div class="field__wrap"> |
|
|
|
<div class="field__wrap"> |
|
|
|
<textarea class="field__textarea field__textarea_lg" |
|
|
|
<textarea class="field__textarea" |
|
|
|
rows="1" |
|
|
|
rows="1" |
|
|
|
title="Название курса" |
|
|
|
:title="titles.courseTitle" |
|
|
|
v-autosize="course.title" |
|
|
|
v-autosize="course.title" |
|
|
|
@change="onCourseNameInput" |
|
|
|
@change="onCourseNameInput" |
|
|
|
v-model="course.title"></textarea> |
|
|
|
v-model="course.title"></textarea> |
|
|
|
@ -37,11 +37,9 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="info__field field field_info" |
|
|
|
<div class="info__field field field_info" |
|
|
|
v-bind:class="{ error: ($v.course.short_description.$dirty || showErrors) && $v.course.short_description.$invalid }"> |
|
|
|
v-bind:class="{ error: ($v.course.short_description.$dirty || showErrors) && $v.course.short_description.$invalid }"> |
|
|
|
<div class="field__label">КРАТКО О КУРСЕ</div> |
|
|
|
<div class="field__label">{{titles.shortDescription}}</div> |
|
|
|
<div class="field__wrap"> |
|
|
|
<div class="field__wrap"> |
|
|
|
<textarea class="field__input" |
|
|
|
<textarea class="field__textarea" |
|
|
|
rows="1" |
|
|
|
|
|
|
|
placeholder="Кратко о курсе" |
|
|
|
|
|
|
|
v-autosize="course.short_description" |
|
|
|
v-autosize="course.short_description" |
|
|
|
@input="$v.course.short_description.$touch()" |
|
|
|
@input="$v.course.short_description.$touch()" |
|
|
|
v-model="course.short_description"></textarea> |
|
|
|
v-model="course.short_description"></textarea> |
|
|
|
@ -291,6 +289,7 @@ |
|
|
|
props: ["authorName", "authorPicture", "accessToken", "courseId", "live"], |
|
|
|
props: ["authorName", "authorPicture", "accessToken", "courseId", "live"], |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
|
|
|
|
titles: {}, |
|
|
|
mounting: false, |
|
|
|
mounting: false, |
|
|
|
viewSection: 'course', |
|
|
|
viewSection: 'course', |
|
|
|
me: null, |
|
|
|
me: null, |
|
|
|
@ -635,17 +634,18 @@ |
|
|
|
if(this.validate()) { |
|
|
|
if(this.validate()) { |
|
|
|
const publishButton = $('#course-redactor__publish-button'); |
|
|
|
const publishButton = $('#course-redactor__publish-button'); |
|
|
|
publishButton.attr('disabled', 'disabled'); |
|
|
|
publishButton.attr('disabled', 'disabled'); |
|
|
|
api.publishCourse(this.course.id, this.accessToken) |
|
|
|
|
|
|
|
.then((response) => { |
|
|
|
if(this.live) { |
|
|
|
if(this.live) { |
|
|
|
window.location = '/school/lessons'; |
|
|
|
window.location = '/school/lessons'; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
api.publishCourse(this.course.id, this.accessToken) |
|
|
|
window.location = '/course/on-moderation'; |
|
|
|
.then((response) => { |
|
|
|
} |
|
|
|
window.location = '/course/on-moderation'; |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
.catch(() => { |
|
|
|
publishButton.removeAttr('disabled'); |
|
|
|
publishButton.removeAttr('disabled'); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
validate(silent) { |
|
|
|
validate(silent) { |
|
|
|
@ -802,6 +802,15 @@ |
|
|
|
mounted() { |
|
|
|
mounted() { |
|
|
|
this.mounting = true; |
|
|
|
this.mounting = true; |
|
|
|
moment.locale('ru'); |
|
|
|
moment.locale('ru'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.titles['courseTitle'] = 'НАЗВАНИЕ КУРСА'; |
|
|
|
|
|
|
|
this.titles['shortDescription'] = 'КРАТКО О КУРСЕ'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(this.live) { |
|
|
|
|
|
|
|
this.titles['courseTitle'] = 'НАЗВАНИЕ УРОКА'; |
|
|
|
|
|
|
|
this.titles['shortDescription'] = 'КРАТКО ОБ УРОКЕ'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.course.live = this.live; |
|
|
|
this.course.live = this.live; |
|
|
|
// Listen for changes to the current location. |
|
|
|
// Listen for changes to the current location. |
|
|
|
this.unlisten = history.listen(this.updateViewSection); |
|
|
|
this.unlisten = history.listen(this.updateViewSection); |
|
|
|
@ -823,7 +832,7 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if(this.live) { |
|
|
|
if(this.live) { |
|
|
|
let schedule = api.getSchedule(this.accessToken); |
|
|
|
let schedule = api.getSchedule(this.accessToken, {live_lesson_exist: false}); |
|
|
|
promises.push(schedule); |
|
|
|
promises.push(schedule); |
|
|
|
|
|
|
|
|
|
|
|
schedule.then((response) => { |
|
|
|
schedule.then((response) => { |
|
|
|
|