From cda44840f5d861ed5ab77aa22307e4cd743c05a6 Mon Sep 17 00:00:00 2001 From: gzbender Date: Wed, 27 Jun 2018 01:03:53 +0500 Subject: [PATCH] =?UTF-8?q?LIL-515=20=D0=9F=D1=80=D0=B5=D0=B2=D1=8C=D1=8E?= =?UTF-8?q?=20=D0=BF=D1=80=D0=B8=20=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D0=B8=20=D1=83=D1=80=D0=BE=D0=BA=D0=B0=20=D0=BA=D1=83?= =?UTF-8?q?=D1=80=D1=81=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/LessonRedactor.vue | 38 ++++++++++++++++++--------- web/src/js/modules/api.js | 3 +++ 2 files changed, 29 insertions(+), 12 deletions(-) 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/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) } },