diff --git a/api/v1/serializers/school.py b/api/v1/serializers/school.py
index 8c4322cc..751bb6c2 100644
--- a/api/v1/serializers/school.py
+++ b/api/v1/serializers/school.py
@@ -133,6 +133,7 @@ class LiveLessonCreateSerializer(DispatchContentMixin, serializers.ModelSerializ
'short_description',
'stream',
'date',
+ 'cover',
'content',
'live',
'created_at',
@@ -169,6 +170,7 @@ class LiveLessonCreateSerializer(DispatchContentMixin, serializers.ModelSerializ
class LiveLessonSerializer(serializers.ModelSerializer):
content = ContentSerializer(many=True)
live = serializers.SerializerMethodField()
+ cover = ImageObjectSerializer()
class Meta:
model = LiveLesson
@@ -178,6 +180,7 @@ class LiveLessonSerializer(serializers.ModelSerializer):
'short_description',
'stream',
'date',
+ 'cover',
'content',
'live',
'created_at',
diff --git a/apps/course/migrations/0037_auto_20180507_1422.py b/apps/course/migrations/0037_auto_20180507_1422.py
new file mode 100644
index 00000000..3d542550
--- /dev/null
+++ b/apps/course/migrations/0037_auto_20180507_1422.py
@@ -0,0 +1,19 @@
+# Generated by Django 2.0.4 on 2018-05-07 14:22
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('course', '0036_auto_20180426_1256'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='course',
+ name='category',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='courses', to='course.Category'),
+ ),
+ ]
diff --git a/apps/course/models.py b/apps/course/models.py
index 14d77132..54384890 100644
--- a/apps/course/models.py
+++ b/apps/course/models.py
@@ -77,7 +77,7 @@ class Course(BaseModel, DeactivatedMixin):
'Отложенный запуск курса', help_text='Заполнить если курс отложенный',
null=True, blank=True, validators=[deferred_start_at_validator],
)
- category = models.ForeignKey('Category', null=True, blank=True, on_delete=models.PROTECT)
+ category = models.ForeignKey('Category', null=True, blank=True, on_delete=models.PROTECT, related_name='courses')
duration = models.IntegerField('Продолжительность курса', default=0)
is_featured = models.BooleanField(default=False)
status = models.PositiveSmallIntegerField(
diff --git a/apps/course/templates/course/_items.html b/apps/course/templates/course/_items.html
index 77cf7cd5..b181a3e2 100644
--- a/apps/course/templates/course/_items.html
+++ b/apps/course/templates/course/_items.html
@@ -5,7 +5,7 @@
diff --git a/apps/course/templates/course/course_only_lessons.html b/apps/course/templates/course/course_only_lessons.html
index cfe29b49..1a311d65 100644
--- a/apps/course/templates/course/course_only_lessons.html
+++ b/apps/course/templates/course/course_only_lessons.html
@@ -137,7 +137,7 @@
Описание курса
- {% if request.user.role == request.user.AUTHOR_ROLE or request.user.role == request.user.ADMIN_ROLE %}
+ {% if course.author == request.user and request.user.role >= request.user.AUTHOR_ROLE %}
Содержание курса
{% if request.user.is_authenticated %} {% if not request.user.is_email_proved and not request.user.fb_id %}
diff --git a/project/templates/blocks/popup_buy.html b/project/templates/blocks/popup_buy.html
index 0bb1b761..1b87695f 100644
--- a/project/templates/blocks/popup_buy.html
+++ b/project/templates/blocks/popup_buy.html
@@ -12,16 +12,10 @@
@@ -53,7 +47,11 @@
Ваш заказ:
+ {% if config.SCHOOL_LOGO_IMAGE %}
+
+ {% else %}
+ {% endif %}
diff --git a/project/templates/blocks/user_menu.html b/project/templates/blocks/user_menu.html
new file mode 100644
index 00000000..5679af79
--- /dev/null
+++ b/project/templates/blocks/user_menu.html
@@ -0,0 +1,43 @@
+{% load static %} {% load thumbnail %}
+{% if request.user.is_authenticated %}
+
+{% else %}
+
+{% endif %}
diff --git a/project/templates/lilcity/edit_index.html b/project/templates/lilcity/edit_index.html
index 38dc3b65..23bb204a 100644
--- a/project/templates/lilcity/edit_index.html
+++ b/project/templates/lilcity/edit_index.html
@@ -55,51 +55,7 @@
- {% if request.user.is_authenticated %}
-
- {% else %}
-
- {% endif %}
+ {% include 'templates/blocks/user_menu.html' %}
{% if request.user.is_authenticated %}
diff --git a/web/src/components/CourseRedactor.vue b/web/src/components/CourseRedactor.vue
index 25feea79..b56c186c 100644
--- a/web/src/components/CourseRedactor.vue
+++ b/web/src/components/CourseRedactor.vue
@@ -115,10 +115,10 @@
руб.
-
-
-
-
+
+
+ Выделить
+
@@ -850,15 +850,34 @@
schedule.then((response) => {
if (response.data) {
- this.scheduleOptions = _.orderBy(response.data.results.map((schedule) => {
- var now = new Date();
- now.setDate(now.getDate() + (schedule.weekday + (7 - now.getDay())) % 7);
- return {
- title: `${schedule.title} (${this.weekdays[schedule.weekday]}, ${moment(now).format("D MMM")})`,
+ let schedule = [];
+ response.data.results.forEach((item) => {
+ schedule[item.weekday] = item.title;
+ });
+
+ console.log('schedule', schedule);
+
+ let options = [];
+
+ for(let i=-7;i<=10;i++) {
+ let now = new Date();
+ now.setDate(now.getDate() + i);
+
+ let weekday = now.getDay() || 7;
+
+
+ console.log('data', i, now.getDay(), weekday, now, moment(now).format("D MMM"));
+
+ options.push({
+ title: `${schedule[weekday]} (${this.weekdays[weekday]}, ${moment(now).format("D MMM")})`,
value: moment(now).format('YYYY-MM-DD')
- }
- }), (item)=>{return moment(item.value)});
+ });
+ }
+
+ console.log('options',options);
+
+ this.scheduleOptions = _.orderBy(options, (item)=>{return moment(item.value)});
}
this.updateCategory();
});
@@ -877,7 +896,7 @@
if (usersResponse.data) {
this.users = usersResponse.data.results.map((user) => {
return {
- title: `${user.first_name} ${user.last_name} (${user.email})`,
+ title: `${user.first_name} ${user.last_name}`,
value: user.id
}
});
diff --git a/web/src/components/LessonRedactor.vue b/web/src/components/LessonRedactor.vue
index c43a0242..cbc433d4 100644
--- a/web/src/components/LessonRedactor.vue
+++ b/web/src/components/LessonRedactor.vue
@@ -21,7 +21,7 @@
diff --git a/web/src/components/consts.js b/web/src/components/consts.js
index c078d72e..139ad04b 100644
--- a/web/src/components/consts.js
+++ b/web/src/components/consts.js
@@ -1,3 +1,4 @@
export const ROLE_USER = 0;
export const ROLE_AUTHOR = 1;
-export const ROLE_ADMIN = 2;
\ No newline at end of file
+export const ROLE_TEACHER = 2;
+export const ROLE_ADMIN = 3;
\ No newline at end of file
diff --git a/web/src/components/inputs/LilSelect.vue b/web/src/components/inputs/LilSelect.vue
index 6845fece..7fd19d60 100644
--- a/web/src/components/inputs/LilSelect.vue
+++ b/web/src/components/inputs/LilSelect.vue
@@ -4,7 +4,7 @@
{{ selectedTitle }}
-
diff --git a/web/src/sass/_common.sass b/web/src/sass/_common.sass
index fae1cb73..cc6f3fa7 100755
--- a/web/src/sass/_common.sass
+++ b/web/src/sass/_common.sass
@@ -2658,6 +2658,17 @@ a.grey-link
&__content
margin-bottom: 30px
color: #191919
+ &__video_frame
+ width: 640px
+ height: 360px
+ +m
+ width: 100%
+ &__chat_frame
+ width: 600px
+ height: 600px
+ +m
+ width: 100%
+
.lessons
&__subtitle