From 490987e2107eb44e2914afa4c5a6b15aa41cd87b Mon Sep 17 00:00:00 2001 From: gzbender Date: Wed, 12 Sep 2018 14:22:36 +0500 Subject: [PATCH] =?UTF-8?q?LIL-645=20=D0=92=D1=8B=D0=B2=D0=BE=D0=B4=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D0=B2=20=D1=80=D0=B5=D0=B4=D0=B0=D0=BA=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=B5=20=D0=B3=D0=B0=D0=BB=D0=B5=D1=80=D0=B5=D0=B8?= =?UTF-8?q?=20=D0=BF=D1=80=D0=B5=D0=B2=D1=8C=D1=8E,=20=D0=B0=20=D0=BD?= =?UTF-8?q?=D0=B5=20=D0=BE=D1=80=D0=B8=D0=B3=D0=B8=D0=BD=D0=B0=D0=BB=D1=8B?= =?UTF-8?q?=20=D0=B8=D0=B7=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/v1/serializers/mixins.py | 2 +- project/templates/blocks/lil_store_js.html | 3 +- project/templates/lilcity/edit_index.html | 2 +- project/urls.py | 1 + web/src/components/ContestRedactor.vue | 136 +----------- web/src/components/CourseRedactor.vue | 67 +----- web/src/components/LessonRedactor.vue | 68 +----- web/src/components/blocks/BlockContent.vue | 87 ++++++++ web/src/components/blocks/BlockImages.vue | 25 ++- web/src/components/blocks/Image.vue | 1 + web/src/js/app.js | 16 +- web/src/js/contest-redactor.js | 17 +- web/src/js/course-redactor.js | 20 +- web/src/js/modules/api.js | 228 +++------------------ 14 files changed, 162 insertions(+), 511 deletions(-) create mode 100644 web/src/components/blocks/BlockContent.vue diff --git a/api/v1/serializers/mixins.py b/api/v1/serializers/mixins.py index 40584503..cfddefd5 100644 --- a/api/v1/serializers/mixins.py +++ b/api/v1/serializers/mixins.py @@ -115,7 +115,7 @@ class DispatchContentMixin(object): setattr(g, obj_type, obj) g.save() if 'images' in cdata: - for image in cdata['images']: + for image in cdata['gallery_images']: if 'img' in image and image['img']: if 'id' in image and image['id']: gi = GalleryImage.objects.get(id=image['id']) diff --git a/project/templates/blocks/lil_store_js.html b/project/templates/blocks/lil_store_js.html index c67073a5..25600834 100644 --- a/project/templates/blocks/lil_store_js.html +++ b/project/templates/blocks/lil_store_js.html @@ -6,6 +6,7 @@ isMobile: {{ request.user_agent.is_mobile|yesno:"true,false" }}, user: { id: '{{ request.user.id|default:'' }}', - } + }, + components: {} }; diff --git a/project/templates/lilcity/edit_index.html b/project/templates/lilcity/edit_index.html index 18be67aa..70691489 100644 --- a/project/templates/lilcity/edit_index.html +++ b/project/templates/lilcity/edit_index.html @@ -316,12 +316,12 @@ {% include 'templates/blocks/lil_store_js.html' %} - {% block foot %}{% endblock foot %} + diff --git a/project/urls.py b/project/urls.py index 60a492c4..b844398b 100644 --- a/project/urls.py +++ b/project/urls.py @@ -55,6 +55,7 @@ urlpatterns = [ path('course//', CourseView.as_view(), name='course'), path('course//checkout', CourseBuyView.as_view(), name='course-checkout'), path('course//edit', CourseEditView.as_view(), name='course_edit'), + path('course//edit/lessons', CourseEditView.as_view(), name='course_edit_lessons'), path('course//lessons', CourseView.as_view(template_name='course/course_only_lessons.html', only_lessons=True), name='course-only-lessons'), path('course//like', likes, name='likes'), path('course//comment', coursecomment, name='coursecomment'), diff --git a/web/src/components/ContestRedactor.vue b/web/src/components/ContestRedactor.vue index 41820a66..a0cffc9d 100644 --- a/web/src/components/ContestRedactor.vue +++ b/web/src/components/ContestRedactor.vue @@ -66,45 +66,7 @@
- -
- - - - - -
-
- - +
@@ -113,15 +75,9 @@ diff --git a/web/src/components/CourseRedactor.vue b/web/src/components/CourseRedactor.vue index b3703785..0f5ae924 100644 --- a/web/src/components/CourseRedactor.vue +++ b/web/src/components/CourseRedactor.vue @@ -166,45 +166,7 @@
- -
- - - - - -
-
- - +