diff --git a/api/v1/serializers/course.py b/api/v1/serializers/course.py index 7f45c7a2..55272f85 100644 --- a/api/v1/serializers/course.py +++ b/api/v1/serializers/course.py @@ -203,6 +203,7 @@ class LessonCreateSerializer(serializers.ModelSerializer): t.title = cdata['title'] t.lesson = lesson t.txt = cdata['txt'] + t.uuid = cdata['uuid'] t.save() else: t = Text.objects.create( @@ -210,6 +211,7 @@ class LessonCreateSerializer(serializers.ModelSerializer): title=cdata['title'], lesson=lesson, txt=cdata['txt'], + uuid=cdata['uuid'], ) elif ctype == 'image': if 'id' in cdata and cdata['id']: @@ -218,6 +220,7 @@ class LessonCreateSerializer(serializers.ModelSerializer): image.title = cdata['title'] image.lesson = lesson image.img = ImageObject.objects.get(id=cdata['img']) + image.uuid = cdata['uuid'] image.save() else: image = Image.objects.create( @@ -225,6 +228,7 @@ class LessonCreateSerializer(serializers.ModelSerializer): title=cdata['title'], lesson=lesson, img=ImageObject.objects.get(id=cdata['img']), + uuid=cdata['uuid'], ) elif ctype == 'image-text': if 'id' in cdata and cdata['id']: @@ -234,6 +238,7 @@ class LessonCreateSerializer(serializers.ModelSerializer): it.lesson = lesson it.img = ImageObject.objects.get(id=cdata['img']) it.txt = cdata['txt'] + it.uuid = cdata['uuid'] it.save() else: it = ImageText.objects.create( @@ -242,6 +247,7 @@ class LessonCreateSerializer(serializers.ModelSerializer): lesson=lesson, img=ImageObject.objects.get(id=cdata['img']), txt=cdata['txt'], + uuid=cdata['uuid'], ) elif ctype == 'video': if 'id' in cdata and cdata['id']: @@ -250,6 +256,7 @@ class LessonCreateSerializer(serializers.ModelSerializer): v.title = cdata['title'] v.lesson = lesson v.url = cdata['url'] + v.uuid = cdata['uuid'] v.save() else: v = Video.objects.create( @@ -257,6 +264,7 @@ class LessonCreateSerializer(serializers.ModelSerializer): title=cdata['title'], lesson=lesson, url=cdata['url'], + uuid=cdata['uuid'], ) elif ctype == 'images': if 'id' in cdata and cdata['id']: @@ -264,6 +272,7 @@ class LessonCreateSerializer(serializers.ModelSerializer): g.position = cdata['position'] g.title = cdata['title'] g.lesson = lesson + g.uuid = cdata['uuid'] g.save() if 'images' in cdata: for image in cdata['images']: @@ -276,6 +285,7 @@ class LessonCreateSerializer(serializers.ModelSerializer): lesson=lesson, position=cdata['position'], title=cdata['title'], + uuid=cdata['uuid'], ) if 'images' in cdata: for image in cdata['images']: diff --git a/api/v1/serializers/mixins.py b/api/v1/serializers/mixins.py index 71dd2029..cb19fafc 100644 --- a/api/v1/serializers/mixins.py +++ b/api/v1/serializers/mixins.py @@ -21,6 +21,7 @@ class DispatchContentMixin(object): t.title = cdata['title'] t.course = course t.txt = cdata['txt'] + t.uuid = cdata['uuid'] t.save() else: t = Text.objects.create( @@ -28,6 +29,7 @@ class DispatchContentMixin(object): title=cdata['title'], course=course, txt=cdata['txt'], + uuid=cdata['uuid'], ) elif ctype == 'image': if 'id' in cdata and cdata['id']: @@ -36,6 +38,7 @@ class DispatchContentMixin(object): image.title = cdata['title'] image.course = course image.img = ImageObject.objects.get(id=cdata['img']) + image.uuid = cdata['uuid'] image.save() else: image = Image.objects.create( @@ -43,6 +46,7 @@ class DispatchContentMixin(object): title=cdata['title'], course=course, img=ImageObject.objects.get(id=cdata['img']), + uuid=cdata['uuid'], ) elif ctype == 'image-text': if 'id' in cdata and cdata['id']: @@ -52,6 +56,7 @@ class DispatchContentMixin(object): it.course = course it.img = ImageObject.objects.get(id=cdata['img']) it.txt = cdata['txt'] + it.uuid = cdata['uuid'] it.save() else: it = ImageText.objects.create( @@ -60,6 +65,7 @@ class DispatchContentMixin(object): course=course, img=ImageObject.objects.get(id=cdata['img']), txt=cdata['txt'], + uuid=cdata['uuid'], ) elif ctype == 'video': if 'id' in cdata and cdata['id']: @@ -68,6 +74,7 @@ class DispatchContentMixin(object): v.title = cdata['title'] v.course = course v.url = cdata['url'] + v.uuid = cdata['uuid'] v.save() else: v = Video.objects.create( @@ -75,6 +82,7 @@ class DispatchContentMixin(object): title=cdata['title'], course=course, url=cdata['url'], + uuid=cdata['uuid'], ) elif ctype == 'images': if 'id' in cdata and cdata['id']: @@ -82,6 +90,7 @@ class DispatchContentMixin(object): g.course = course g.position = cdata['position'] g.title = cdata['title'] + g.uuid = cdata['uuid'] g.save() if 'images' in cdata: for image in cdata['images']: @@ -99,6 +108,7 @@ class DispatchContentMixin(object): course=course, position=cdata['position'], title=cdata['title'], + uuid=cdata['uuid'], ) if 'images' in cdata: for image in cdata['images']: diff --git a/api/v1/views.py b/api/v1/views.py index c47ce413..2782830b 100644 --- a/api/v1/views.py +++ b/api/v1/views.py @@ -341,11 +341,13 @@ class CommentViewSet(ExtendedModelViewSet): queryset = self.queryset is_deactivated = self.request.query_params.get('is_deactivated', '0') if is_deactivated == '0': - return queryset + queryset = queryset elif is_deactivated == '1': - return queryset.filter(deactivated_at__isnull=True) + queryset = queryset.filter(deactivated_at__isnull=True) elif is_deactivated == '2': - return queryset.filter(deactivated_at__isnull=False) + queryset = queryset.filter(deactivated_at__isnull=False) + + return queryset class AuthorRequestViewSet(ExtendedModelViewSet): diff --git a/apps/course/templates/course/_items.html b/apps/course/templates/course/_items.html index 33312e53..f7b7d666 100644 --- a/apps/course/templates/course/_items.html +++ b/apps/course/templates/course/_items.html @@ -33,6 +33,16 @@
ЧЕРНОВИК
+ {% elif course.status == 3 %} +
+
В АРХИВЕ
+
+
+ {% elif course.status == 4 %} +
+
ОТКЛОНЕН
+
+
{% endif %}
diff --git a/apps/course/templates/course/blocks/comment.html b/apps/course/templates/course/blocks/comment.html index 497c398d..096d0175 100644 --- a/apps/course/templates/course/blocks/comment.html +++ b/apps/course/templates/course/blocks/comment.html @@ -1,7 +1,7 @@ {% load static %} {% if not node.deactivated_at %} -
+
{% if node.author.photo %}
diff --git a/apps/course/templates/course/course.html b/apps/course/templates/course/course.html index 0a3c2ce4..48105a1f 100644 --- a/apps/course/templates/course/course.html +++ b/apps/course/templates/course/course.html @@ -174,7 +174,7 @@ {% if course.is_deferred_start %}
Курс начнется:
-
{{ course.deferred_start_at_humanize }}
+
{{ course.deferred_start_at_humanize }}
{% else %} {% comment %} diff --git a/apps/notification/templates/notification/email/_base.html b/apps/notification/templates/notification/email/_base.html index b4ce1c89..7ae29045 100644 --- a/apps/notification/templates/notification/email/_base.html +++ b/apps/notification/templates/notification/email/_base.html @@ -45,7 +45,7 @@ - +
2017 © Lil City, UAB. {% now "Y" %} © Lil City, UAB. diff --git a/apps/payment/views.py b/apps/payment/views.py index e7490ad9..7f68a963 100644 --- a/apps/payment/views.py +++ b/apps/payment/views.py @@ -46,7 +46,7 @@ class CourseBuyView(TemplateView): host = request.scheme + '://' + request.get_host() course = Course.objects.get(id=pk) if request.user == course.author: - messages.error('Вы не можете приобрести свой курс.') + messages.error(request, 'Вы не можете приобрести свой курс.') return redirect(reverse_lazy('course', args=[course.id])) course_payment = CoursePayment.objects.create( user=request.user, diff --git a/project/templates/lilcity/edit_index.html b/project/templates/lilcity/edit_index.html index 0c2fc067..b5e79164 100644 --- a/project/templates/lilcity/edit_index.html +++ b/project/templates/lilcity/edit_index.html @@ -278,7 +278,7 @@
-
Выбор урока/дня
+
Выбор курса/дня
При записи на 5 уроков скидка 10%.
@@ -345,6 +345,10 @@
+ {% block foot %}{% endblock foot %} diff --git a/project/templates/lilcity/index.html b/project/templates/lilcity/index.html index dbdbcfe2..a39fb3b8 100644 --- a/project/templates/lilcity/index.html +++ b/project/templates/lilcity/index.html @@ -131,7 +131,7 @@
{% endcomment %} -
ВИДЕО-КУРСЫ +
ВИДЕОКУРСЫ
{% category_menu_items category %}
@@ -248,7 +248,7 @@