|
|
|
@ -37,10 +37,8 @@ |
|
|
|
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">{{titles.shortDescription}}</div> |
|
|
|
<div class="field__label">{{titles.shortDescription}}</div> |
|
|
|
<div class="field__wrap"> |
|
|
|
<div class="field__wrap"> |
|
|
|
<textarea class="field__textarea" |
|
|
|
<vue-redactor :value="course.short_description" |
|
|
|
v-autosize="course.short_description" |
|
|
|
v-on:update:value="(value) => { this.course.short_description = value; }" /> |
|
|
|
@input="$v.course.short_description.$touch()" |
|
|
|
|
|
|
|
v-model="course.short_description"></textarea> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -49,7 +47,7 @@ |
|
|
|
v-bind:class="{ error: ($v.course.category.$dirty || showErrors) && $v.course.category.$invalid }"> |
|
|
|
v-bind:class="{ error: ($v.course.category.$dirty || showErrors) && $v.course.category.$invalid }"> |
|
|
|
<div class="field__label field__label_gray">КАТЕГОРИЯ</div> |
|
|
|
<div class="field__label field__label_gray">КАТЕГОРИЯ</div> |
|
|
|
<div class="field__wrap"> |
|
|
|
<div class="field__wrap"> |
|
|
|
<lil-select :value.sync="categorySelect" :options="categoryOptions" |
|
|
|
<lil-select :value.sync="course.category" :options="categoryOptions" |
|
|
|
placeholder="Выберите категорию"/> |
|
|
|
placeholder="Выберите категорию"/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -113,6 +111,13 @@ |
|
|
|
<button disabled class="field__append">руб.</button> |
|
|
|
<button disabled class="field__append">руб.</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div v-if="!live" class="info__field field"> |
|
|
|
|
|
|
|
<div class="field__label field__label_gray">ВОЗРАСТ</div> |
|
|
|
|
|
|
|
<div class="field__wrap"> |
|
|
|
|
|
|
|
<lil-select :value.sync="course.age" :options="ages" value-key="value" |
|
|
|
|
|
|
|
placeholder="Выберите возраст"/> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
<label v-if="me && !live && me.role === ROLE_ADMIN" class="info__switch switch switch_lg"> |
|
|
|
<label v-if="me && !live && me.role === ROLE_ADMIN" class="info__switch switch switch_lg"> |
|
|
|
<input type="checkbox" class="switch__input" v-model="course.is_featured"> |
|
|
|
<input type="checkbox" class="switch__input" v-model="course.is_featured"> |
|
|
|
<span class="switch__content">Выделить</span> |
|
|
|
<span class="switch__content">Выделить</span> |
|
|
|
@ -198,7 +203,7 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="lessons__subtitle subtitle">{{ lesson.title }}</div> |
|
|
|
<div class="lessons__subtitle subtitle">{{ lesson.title }}</div> |
|
|
|
<div class="lessons__row"> |
|
|
|
<div class="lessons__row"> |
|
|
|
<div class="lessons__content">{{ lesson.short_description }}</div> |
|
|
|
<div class="lessons__content" v-html="lesson.short_description"></div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</vue-draggable> |
|
|
|
</vue-draggable> |
|
|
|
@ -232,6 +237,7 @@ |
|
|
|
import LinkInput from './inputs/LinkInput' |
|
|
|
import LinkInput from './inputs/LinkInput' |
|
|
|
import DatePicker from 'vuejs-datepicker' |
|
|
|
import DatePicker from 'vuejs-datepicker' |
|
|
|
import BlockContent from './blocks/BlockContent' |
|
|
|
import BlockContent from './blocks/BlockContent' |
|
|
|
|
|
|
|
import VueRedactor from './redactor/VueRedactor'; |
|
|
|
import LilSelect from "./inputs/LilSelect"; |
|
|
|
import LilSelect from "./inputs/LilSelect"; |
|
|
|
import LessonRedactor from "./LessonRedactor"; |
|
|
|
import LessonRedactor from "./LessonRedactor"; |
|
|
|
import {api} from "../js/modules/api"; |
|
|
|
import {api} from "../js/modules/api"; |
|
|
|
@ -269,6 +275,7 @@ |
|
|
|
duration: null, |
|
|
|
duration: null, |
|
|
|
author: null, |
|
|
|
author: null, |
|
|
|
price: null, |
|
|
|
price: null, |
|
|
|
|
|
|
|
age: 0, |
|
|
|
url: '', |
|
|
|
url: '', |
|
|
|
coverImage: '', |
|
|
|
coverImage: '', |
|
|
|
kit__body: null, |
|
|
|
kit__body: null, |
|
|
|
@ -333,6 +340,40 @@ |
|
|
|
'value': '18:00', |
|
|
|
'value': '18:00', |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
], |
|
|
|
|
|
|
|
ages: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
'title': 'Любой возраст', |
|
|
|
|
|
|
|
'value': 0, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
'title': 'до 5', |
|
|
|
|
|
|
|
'value': 1, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
'title': '5-7', |
|
|
|
|
|
|
|
'value': 2, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
'title': '7-9', |
|
|
|
|
|
|
|
'value': 3, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
'title': '9-12', |
|
|
|
|
|
|
|
'value': 4, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
'title': '12-15', |
|
|
|
|
|
|
|
'value': 5, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
'title': '15-18', |
|
|
|
|
|
|
|
'value': 6, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
'title': 'от 18', |
|
|
|
|
|
|
|
'value': 7, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
|
|
weekdays: [ |
|
|
|
weekdays: [ |
|
|
|
'', |
|
|
|
'', |
|
|
|
@ -441,15 +482,6 @@ |
|
|
|
this.course.url = slugify(this.course.title); |
|
|
|
this.course.url = slugify(this.course.title); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
updateCategory() { |
|
|
|
|
|
|
|
if (this.categoryOptions && Array.isArray(this.categoryOptions) && this.course.category) { |
|
|
|
|
|
|
|
this.categoryOptions.forEach((category) => { |
|
|
|
|
|
|
|
if (category.id === this.course.category) { |
|
|
|
|
|
|
|
this.course.categorySelect = category; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
removeLesson(lessonIndex) { |
|
|
|
removeLesson(lessonIndex) { |
|
|
|
if (!confirm('Вы действительно хотите удалить этот урок?')) { |
|
|
|
if (!confirm('Вы действительно хотите удалить этот урок?')) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
@ -885,14 +917,8 @@ |
|
|
|
promises.push(cats); |
|
|
|
promises.push(cats); |
|
|
|
cats.then((response) => { |
|
|
|
cats.then((response) => { |
|
|
|
if (response.data) { |
|
|
|
if (response.data) { |
|
|
|
this.categoryOptions = response.data.results.map((category) => { |
|
|
|
this.categoryOptions = response.data.results; |
|
|
|
return { |
|
|
|
|
|
|
|
title: category.title, |
|
|
|
|
|
|
|
value: category.id |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
this.updateCategory(); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if(this.live) { |
|
|
|
if(this.live) { |
|
|
|
@ -932,7 +958,6 @@ |
|
|
|
|
|
|
|
|
|
|
|
this.scheduleOptions = _.orderBy(options, (item)=>{return moment(item.value)}); |
|
|
|
this.scheduleOptions = _.orderBy(options, (item)=>{return moment(item.value)}); |
|
|
|
} |
|
|
|
} |
|
|
|
this.updateCategory(); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -1003,23 +1028,6 @@ |
|
|
|
this.course.price = value || 0; |
|
|
|
this.course.price = value || 0; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
categorySelect: { |
|
|
|
|
|
|
|
get() { |
|
|
|
|
|
|
|
if (!this.categoryOptions || this.categoryOptions.length === 0 || !this.course || !this.course.category) { |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
let value; |
|
|
|
|
|
|
|
this.categoryOptions.forEach((category) => { |
|
|
|
|
|
|
|
if (category.value === this.course.category) { |
|
|
|
|
|
|
|
value = category; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return value; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
set(value) { |
|
|
|
|
|
|
|
this.course.category = value.value; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// userSelect: { |
|
|
|
// userSelect: { |
|
|
|
// get() { |
|
|
|
// get() { |
|
|
|
// if (!this.users || this.users.length === 0 || !this.course || !this.course.author) { |
|
|
|
// if (!this.users || this.users.length === 0 || !this.course || !this.course.author) { |
|
|
|
@ -1078,6 +1086,7 @@ |
|
|
|
'vue-datepicker': DatePicker, |
|
|
|
'vue-datepicker': DatePicker, |
|
|
|
'lesson-redactor': LessonRedactor, |
|
|
|
'lesson-redactor': LessonRedactor, |
|
|
|
'vue-draggable': Draggable, |
|
|
|
'vue-draggable': Draggable, |
|
|
|
|
|
|
|
'vue-redactor': VueRedactor, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
@ -1178,9 +1187,10 @@ |
|
|
|
overflow: scroll; |
|
|
|
overflow: scroll; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.field_short_description { |
|
|
|
.field_short_description .redactor-box { |
|
|
|
|
|
|
|
overflow-x: visible; |
|
|
|
|
|
|
|
overflow-y: auto; |
|
|
|
max-height: 200px; |
|
|
|
max-height: 200px; |
|
|
|
overflow: scroll; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |
|
|
|
|
|
|
|
|
|
|
|
|