diff --git a/apps/course/templates/course/lesson.html b/apps/course/templates/course/lesson.html
index 6c9511ae..662a4dd5 100644
--- a/apps/course/templates/course/lesson.html
+++ b/apps/course/templates/course/lesson.html
@@ -2,11 +2,12 @@
{% load static %}
{% block title %}{{ lesson.title }} - {{ block.super }}{% endblock title %}
+{% block ogimage %}http://{{request.META.HTTP_HOST}}{% if lesson.course.cover %}{{ lesson.course.cover.image.url }}{% else %}{% static 'img/og_courses.jpg' %}{% endif %}{% endblock ogimage %}
{% block content %}
{% else %}
-
+
{% endif %}
{% if live_lesson %}
-
+
{% comment %}
@@ -36,12 +36,12 @@
-
+
- {% endif %} {% endcomment %}
+ {% endif %}
Вернуться к списку уроков
- {% comment %} {% if next_lesson %}
-
+ {% if next_lesson %}
+
Перейти к следующему уроку
{{ lesson.title }}
@@ -32,7 +33,7 @@
{% if lesson.cover %}
{{ live_lesson.date }}
{% endif %}
{{ school_schedule.start_at }} (МСК)
{% if school_schedule.weekday in school_schedules_purchased %}
- {% if live_lesson and school_schedule.is_online or live_lesson and is_previous and live_lesson in live_lessons %}
- {% include './open_lesson.html' %}
- {% endif %}
+ {% if live_lesson and live_lesson.title %}
+ {% include './open_lesson.html' %}
+ {% endif %}
{% else %}
- {% include './day_pay_btn.html' %}
+ {% include './day_pay_btn.html' %}
{% endif %}
-
{{ school_schedule.title }}{% if live_lesson %},
+
{% comment %}
@@ -36,12 +36,12 @@
{{ school_schedule.title }}{% if live_lesson and live_lesson.title %},
{{ live_lesson.title }}
{% endif %}
- {% if live_lesson %}
+ {% if live_lesson and live_lesson.short_description %}
{{ live_lesson.short_description }}
{% else %}
{{ school_schedule.description }}
diff --git a/apps/school/templates/blocks/schedule_purchased.html b/apps/school/templates/blocks/schedule_purchased.html
index 03e98e92..7f8f035d 100644
--- a/apps/school/templates/blocks/schedule_purchased.html
+++ b/apps/school/templates/blocks/schedule_purchased.html
@@ -9,7 +9,6 @@
Подписка истекает
{{ subscription_ends }}
- {% include './prolong_btn.html' %}
{% else %}
Подписка
истекла
diff --git a/apps/school/templates/school/livelesson_detail.html b/apps/school/templates/school/livelesson_detail.html
index 92ca42e1..1bcb3227 100644
--- a/apps/school/templates/school/livelesson_detail.html
+++ b/apps/school/templates/school/livelesson_detail.html
@@ -10,7 +10,7 @@
{% if live_lesson %}
-
+ {{ livelesson.short_description }}
{% if livelesson.stream_index %}
-
Если видео не загрузилось обновите страницу
diff --git a/apps/school/templates/school/summer_school.html b/apps/school/templates/school/summer_school.html
index 133f8d8b..00da0bf8 100644
--- a/apps/school/templates/school/summer_school.html
+++ b/apps/school/templates/school/summer_school.html
@@ -1,5 +1,6 @@
{% extends "templates/lilcity/index.html" %} {% load static %}
{% block title %}Онлайн-школа LilCity{% endblock title%}
+{% block ogimage %}http://{{request.META.HTTP_HOST}}{% static 'img/og_summer_school.jpg' %}{% endblock %}
{% block content %}
{% if not is_purchased %}
{% include "../summer/promo.html" %}
diff --git a/apps/school/templates/summer/_schedule_purchased_item.html b/apps/school/templates/summer/_schedule_purchased_item.html
index 8017a687..b9d1db1f 100644
--- a/apps/school/templates/summer/_schedule_purchased_item.html
+++ b/apps/school/templates/summer/_schedule_purchased_item.html
@@ -6,17 +6,17 @@
{{ school_schedule }}
{{ live_lesson.date }}
{% endif %}
{{ school_schedule.start_at }} (МСК)
{% if school_schedule.weekday in school_schedules_purchased %}
- {% if live_lesson and school_schedule.is_online or live_lesson and is_previous and live_lesson in live_lessons %}
- {% include './open_lesson.html' %}
- {% endif %}
+ {% if live_lesson and live_lesson.title %}
+ {% include './open_lesson.html' %}
+ {% endif %}
{% else %}
- {% include './day_pay_btn.html' %}
+ {% include './day_pay_btn.html' %}
{% endif %}
-
{{ school_schedule.title }}{% if live_lesson %},
+
{{ school_schedule.title }}{% if live_lesson and live_lesson.title %},
{{ live_lesson.title }}
{% endif %}
- {% if live_lesson %}
+ {% if live_lesson and live_lesson.short_description %}
{{ live_lesson.short_description }}
{% else %}
{{ school_schedule.description }}
diff --git a/apps/school/templates/summer/schedule_purchased.html b/apps/school/templates/summer/schedule_purchased.html
index 467be723..63e963fd 100644
--- a/apps/school/templates/summer/schedule_purchased.html
+++ b/apps/school/templates/summer/schedule_purchased.html
@@ -9,7 +9,6 @@
Подписка истекает
{{ subscription_ends }}
- {% include './prolong_btn.html' %}
{% else %}
Подписка
истекла
diff --git a/apps/user/templates/user/profile.html b/apps/user/templates/user/profile.html
index cea0b4ee..caddc204 100644
--- a/apps/user/templates/user/profile.html
+++ b/apps/user/templates/user/profile.html
@@ -67,18 +67,18 @@
-
+
{% if not simple_user %}
-
-
-
+
-->
+
-
{% if is_purchased_future %}
{% if not simple_user %}
-
{% else %}
@@ -127,7 +127,7 @@
+
diff --git a/project/templates/blocks/promo.html b/project/templates/blocks/promo.html
index 8fa641f4..29cdd2b6 100644
--- a/project/templates/blocks/promo.html
+++ b/project/templates/blocks/promo.html
@@ -46,9 +46,13 @@
{% if published.exists %}
diff --git a/project/settings.py b/project/settings.py
index fe902536..9323745c 100644
--- a/project/settings.py
+++ b/project/settings.py
@@ -55,6 +55,7 @@ INSTALLED_APPS = [
'corsheaders',
'sorl.thumbnail',
'raven.contrib.django.raven_compat',
+ 'django_user_agents',
] + [
'apps.auth.apps',
'apps.user',
@@ -68,6 +69,7 @@ INSTALLED_APPS = [
MIDDLEWARE = [
'corsheaders.middleware.CorsMiddleware',
+ 'django_user_agents.middleware.UserAgentMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
diff --git a/project/templates/blocks/about.html b/project/templates/blocks/about.html
index 4caf08de..8deec906 100644
--- a/project/templates/blocks/about.html
+++ b/project/templates/blocks/about.html
@@ -44,21 +44,19 @@
-
- {% if not is_purchased and not is_purchased_future %}купить доступ от {{ min_school_price }} руб./месяц{% endif %}
- {% if is_purchased_future and not is_purchased %}ваша подписка начинается {{school_purchased_future.date_start}}{% endif %}
- {% if is_purchased %}ваша подписка истекает {{ subscription_ends_humanize }}
перейти к оплате{% endif %} - + > + купить доступ от {{ min_school_price }} руб./месяц + + {% endif %}
перейти к оплате{% endif %} - + > + купить доступ от {{ min_school_price }} руб./месяц + + {% endif %}
- Присоединяйтесь в Рисовальный лагерь
+ Урок Рисовальный лагерь, Альбрехт Дюрер завершен
+ Следующий урок пройдет 4 июля
+ Следующий урок пройдет 4 июля
+ {% if is_purchased %}
+ Перейти в урок
+ {% else %}
{% if not is_purchased and not is_purchased_future %}Получить доступ{% endif %}
{% if is_purchased_future and not is_purchased %}ваша подписка начинается {{school_purchased_future.date_start}}{% endif %}
- {% if is_purchased %}ваша подписка истекает {{ subscription_ends_humanize }}
перейти к оплате{% endif %} + {% endif %} + О лагере
{% endif %}
diff --git a/project/templates/blocks/user_menu.html b/project/templates/blocks/user_menu.html
index 54ebf6b6..13f4fbdf 100644
--- a/project/templates/blocks/user_menu.html
+++ b/project/templates/blocks/user_menu.html
@@ -1,7 +1,7 @@
{% load static %} {% load thumbnail %}
{% if request.user.is_authenticated %}
перейти к оплате{% endif %} + {% endif %} + О лагере
-
+
{% thumbnail request.user.photo "48x48" crop="center" as im %}
{% empty %}
diff --git a/project/templates/lilcity/index.html b/project/templates/lilcity/index.html
index 30b5541a..a4d0539d 100644
--- a/project/templates/lilcity/index.html
+++ b/project/templates/lilcity/index.html
@@ -25,7 +25,7 @@
{% comment %} {% endcomment %}
-
+
diff --git a/project/views.py b/project/views.py
index 17c23078..bb6f6d64 100644
--- a/project/views.py
+++ b/project/views.py
@@ -62,7 +62,6 @@ class IndexView(TemplateView):
'teachers': User.objects.filter(role=User.TEACHER_ROLE, show_in_mainpage=True),
'subscription_ends': schoolpayment_queryset.filter(add_days=False).first().date_end if school_payment_exists else None,
'subscription_ends_humanize': schoolpayment_queryset.filter(add_days=False).first().date_end_humanize if school_payment_exists else None,
-
'school_purchased_future': school_purchased_future,
'is_purchased_future': school_payment_exists_future,
diff --git a/requirements.txt b/requirements.txt
index 63995574..05894ddd 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -25,3 +25,7 @@ twilio==6.14.7
git+https://github.com/ivlevdenis/paymentwall-python.git
# python-instagram==1.3.2
git+https://github.com/ivlevdenis/python-instagram.git
+django-user-agents==0.3.2
+user-agents==1.1.0
+ua-parser==0.8.0
+
diff --git a/web/src/components/CourseRedactor.vue b/web/src/components/CourseRedactor.vue
index a2fa6ced..3ba9359e 100644
--- a/web/src/components/CourseRedactor.vue
+++ b/web/src/components/CourseRedactor.vue
@@ -84,13 +84,13 @@
ДАТА
ДОСТУП
@@ -656,11 +656,11 @@
this.course = api.convertCourseJson(response.data);
this.course.live = this.live;
- if (this.live && this.course.date) {
+ /* if (this.live && this.course.date) {
this.course.date = _.find(this.scheduleOptions, (item) => {
return item.value == this.course.date;
})
- }
+ } */
this.$nextTick(() => {
this.courseLoading = false;
@@ -841,11 +841,11 @@
this.course.id = courseData.id;
}
- if(this.live && courseData.date) {
+ /*if(this.live && courseData.date) {
this.course.date = _.find(this.scheduleOptions, function(item){
return item.value == courseData.date;
});
- }
+ }*/
this.$nextTick(() => {
this.courseSyncHook = false;
});
diff --git a/web/src/components/LessonRedactor.vue b/web/src/components/LessonRedactor.vue
index 82faaadb..a0a245e2 100644
--- a/web/src/components/LessonRedactor.vue
+++ b/web/src/components/LessonRedactor.vue
@@ -14,16 +14,22 @@
{{ title }}
-
-
-
-
-
-
-
-
+
@@ -81,6 +87,7 @@
import BlockImages from './blocks/BlockImages'
import BlockImageText from './blocks/BlockImageText'
import BlockVideo from './blocks/BlockVideo'
+ import LilImage from "./blocks/Image"
import {api} from "../js/modules/api";
import Draggable from 'vuedraggable';
import _ from 'lodash'
@@ -105,7 +112,13 @@
if (blockToRemove.data.id) {
api.removeContentBlock(blockToRemove, this.accessToken);
}
- }
+ },
+ onUpdateCoverUrl(newValue) {
+ this.lesson.coverImage = newValue;
+ },
+ onUpdateCoverId(newValue) {
+ this.lesson.coverImageId = newValue;
+ },
},
computed: {
title() {
@@ -120,10 +133,11 @@
'block-images': BlockImages,
'block-video': BlockVideo,
'vue-draggable': Draggable,
+ 'lil-image': LilImage,
}
}
\ No newline at end of file
+
diff --git a/web/src/img/og_blog.jpg b/web/src/img/og_blog.jpg
new file mode 100644
index 00000000..cabead92
Binary files /dev/null and b/web/src/img/og_blog.jpg differ
diff --git a/web/src/img/og_courses.jpg b/web/src/img/og_courses.jpg
new file mode 100644
index 00000000..918718fe
Binary files /dev/null and b/web/src/img/og_courses.jpg differ
diff --git a/web/src/img/og_main.jpg b/web/src/img/og_main.jpg
new file mode 100644
index 00000000..d9c04f59
Binary files /dev/null and b/web/src/img/og_main.jpg differ
diff --git a/web/src/img/og_summer_school.jpg b/web/src/img/og_summer_school.jpg
new file mode 100644
index 00000000..2adc8a7a
Binary files /dev/null and b/web/src/img/og_summer_school.jpg differ
diff --git a/web/src/js/modules/api.js b/web/src/js/modules/api.js
index 59c98939..36dc5f99 100644
--- a/web/src/js/modules/api.js
+++ b/web/src/js/modules/api.js
@@ -204,6 +204,7 @@ export const api = {
const isAdding = (!lessonObject.hasOwnProperty('id') || !lessonObject.hasOwnProperty('id'));
const lessonJson = {
+ cover: lessonObject.coverImageId ? lessonObject.coverImageId : null,
title: lessonObject.title,
short_description: lessonObject.short_description,
course: lessonObject.course_id,
@@ -284,6 +285,8 @@ export const api = {
id: lessonJSON.id,
title: lessonJSON.title,
short_description: lessonJSON.short_description,
+ coverImageId: lessonJSON.cover && lessonJSON.cover.id ? lessonJSON.cover.id : null,
+ coverImage: lessonJSON.cover && lessonJSON.cover.image ? lessonJSON.cover.image : null,
content: api.convertContentResponse(lessonJSON.content)
}
},
diff --git a/web/src/sass/_common.sass b/web/src/sass/_common.sass
index 096e0b1b..7e5a870a 100755
--- a/web/src/sass/_common.sass
+++ b/web/src/sass/_common.sass
@@ -2648,8 +2648,15 @@ a.grey-link
flex: 0 0 140px
+m
display: none
+ &__pic-wrapper
+ width: 130px;
+ height: 130px;
+ border-radius: 50%;
+ overflow: hidden;
&__pic
- display: block
+ top: 50%;
+ position: relative;
+ transform: translateY(-50%);
width: 100%
&__content
flex: 0 0 calc(100% - 165px)
@@ -3061,8 +3068,6 @@ a.grey-link
border-bottom: 1px solid $border
align-items: center
justify-content: center
- +m
- margin: 0 -15px 30px
&__btn
height: 56px
border-bottom: 1px solid $border
@@ -3072,7 +3077,8 @@ a.grey-link
letter-spacing: 1px
transition: border-color .2s, color .2s
+m
- flex: 0 0 50%
+ flex: 0 0 35%
+ font-size: 10px
&:not(:last-child)
margin-right: 40px
+m
+
+
+
+
+
+
+
+
+
+
+
+