From 9576c3cd25c70ffdac3aff281a8a7f0d6be6567e Mon Sep 17 00:00:00 2001 From: gzbender Date: Sun, 27 Jan 2019 23:25:40 +0500 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B1=D0=BB=D0=B5=D0=BC?= =?UTF-8?q?=D0=B0=20=D1=81=20=D1=81=D0=BE=D1=85=D1=80=D0=B0=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=D0=BC=20=D1=81=D0=BE=D0=B4=D0=B5=D1=80=D0=B6?= =?UTF-8?q?=D0=B8=D0=BC=D0=BE=D0=B3=D0=BE=20=D0=BA=D1=83=D1=80=D1=81=D0=BE?= =?UTF-8?q?=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/course/templates/course/course_edit.html | 9 +++++++++ project/templates/lilcity/edit_index.html | 7 ++----- web/src/components/CourseRedactor.vue | 7 ++++--- web/src/js/modules/api.js | 5 +++-- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/apps/course/templates/course/course_edit.html b/apps/course/templates/course/course_edit.html index 296f8da1..83990c00 100644 --- a/apps/course/templates/course/course_edit.html +++ b/apps/course/templates/course/course_edit.html @@ -7,6 +7,15 @@ Создание {% if live == 'true' %}стрима{% else %}курса{% endif %} {% endif %} {% endblock title%} + +{% block header_buttons %} + {% if live == 'true' %} + + {% else %} + + {% endif %} +{% endblock header_buttons %} + {% block content %} - {% if live == 'true' %} - - {% else %} - - {% endif %} + {% block header_buttons %} + {% endblock header_buttons %} {% include 'templates/blocks/user_menu.html' %} diff --git a/web/src/components/CourseRedactor.vue b/web/src/components/CourseRedactor.vue index b705382b..d2c7fddc 100644 --- a/web/src/components/CourseRedactor.vue +++ b/web/src/components/CourseRedactor.vue @@ -34,7 +34,8 @@ v-model="course.title" placeholder="Добавить заголовок"> -
+
@@ -663,7 +664,7 @@ if(this.live) { window.location = '/school/lessons'; } else { - api.publishCourse(this.course.id, this.accessToken) + api.publishCourse(this.course, this.accessToken) .then((response) => { window.location = '/course/on-moderation'; }) @@ -1006,7 +1007,7 @@ }, courseFullUrl() { let suffix = this.course.slug || this.course.id || 'ваша_ссылка'; - return `https://lil.city/course/${suffix}`; + return `https://lil.school/course/${suffix}`; }, }, beforeDestroy() { diff --git a/web/src/js/modules/api.js b/web/src/js/modules/api.js index 929696fd..c9627aac 100644 --- a/web/src/js/modules/api.js +++ b/web/src/js/modules/api.js @@ -437,8 +437,9 @@ export const api = { } }); }, - publishCourse: (courseId, accessToken) => { - return api.patch(`/api/v1/courses/${courseId}/`, {status: 1}, { + publishCourse: (course, accessToken) => { + course.status = 1; + return api.patch(`/api/v1/courses/${course.id}/`, course, { headers: { 'Authorization': `Token ${accessToken}`, }