From 9f3139a3306298af35d8db14ff9355c938be9db7 Mon Sep 17 00:00:00 2001 From: Sanasol Date: Thu, 15 Feb 2018 15:26:11 +0700 Subject: [PATCH 1/4] social icons --- apps/course/templates/course/course.html | 71 ++++++++++++++++++------ web/src/js/modules/courses.js | 2 +- web/src/sass/_common.sass | 2 + 3 files changed, 57 insertions(+), 18 deletions(-) diff --git a/apps/course/templates/course/course.html b/apps/course/templates/course/course.html index 07634b1a..62ad1a2c 100644 --- a/apps/course/templates/course/course.html +++ b/apps/course/templates/course/course.html @@ -158,16 +158,35 @@ {% endif %} -
+ + @@ -392,14 +411,32 @@
diff --git a/web/src/js/modules/courses.js b/web/src/js/modules/courses.js index 8463c4c3..90ffeb97 100644 --- a/web/src/js/modules/courses.js +++ b/web/src/js/modules/courses.js @@ -3,7 +3,7 @@ import moment from 'moment'; import createHistory from 'history/createBrowserHistory'; // Likely -import 'ilyabirman-likely/release/likely.css'; +// import 'ilyabirman-likely/release/likely.css'; import 'ilyabirman-likely/release/likely.js'; moment.locale('ru'); diff --git a/web/src/sass/_common.sass b/web/src/sass/_common.sass index 13a6e6e0..0363006f 100755 --- a/web/src/sass/_common.sass +++ b/web/src/sass/_common.sass @@ -2575,6 +2575,8 @@ a.grey-link margin-right: 20px .icon font-size: 40px + span:first-child + display: none; &_sm &__title margin-bottom: 15px &_sm &__item From 465a927b964b361056e2287a0a393428ed2ba997 Mon Sep 17 00:00:00 2001 From: Vitaly Baev Date: Thu, 15 Feb 2018 12:11:23 +0300 Subject: [PATCH 2/4] =?UTF-8?q?=D0=94=D0=BE=D0=BF=D0=BE=D0=BB=D0=BD=D0=B8?= =?UTF-8?q?=D1=82=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D0=B5=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B5=D1=80=D0=BA=D0=B8=20=D0=B2=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/js/modules/api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/js/modules/api.js b/web/src/js/modules/api.js index 0dbff28e..3921fb67 100644 --- a/web/src/js/modules/api.js +++ b/web/src/js/modules/api.js @@ -238,8 +238,8 @@ export const api = { id: courseJSON.id, title: courseJSON.title, short_description: courseJSON.short_description, - category: courseJSON.category.id ? courseJSON.category.id : courseJSON.category, - author: courseJSON.author.id ? courseJSON.author.id : courseJSON.author, + category: courseJSON.category && courseJSON.category.id ? courseJSON.category.id : courseJSON.category, + author: courseJSON.author && courseJSON.author.id ? courseJSON.author.id : courseJSON.author, price: parseFloat(courseJSON.price), is_paid: parseFloat(courseJSON.price) > 0, is_deferred: isDeferred, From 9605f88a098eada68730292336f6e5217c6b1d45 Mon Sep 17 00:00:00 2001 From: Vitaly Baev Date: Thu, 15 Feb 2018 12:18:05 +0300 Subject: [PATCH 3/4] =?UTF-8?q?=D0=9C=D0=B5=D0=BB=D0=BA=D0=B8=D0=B5=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/CourseRedactor.vue | 46 +++++++++++++++------------ 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/web/src/components/CourseRedactor.vue b/web/src/components/CourseRedactor.vue index dfdb2678..2f2fd7fb 100644 --- a/web/src/components/CourseRedactor.vue +++ b/web/src/components/CourseRedactor.vue @@ -334,6 +334,7 @@ ], showErrors: false, savingTimeout: null, + savingDebounceTimeout: null, categoryOptions: [], courseSyncHook: false, // Если true, то watch не будет отправлять курс на обновление } @@ -519,30 +520,35 @@ let newTab = window.open(`/course/${this.course.id}`, '_blank'); newTab.focus(); }, - saveCourseDraft: debounce(function (newValue, oldValue) { + saveCourseDraft: function (newValue, oldValue) { if (!oldValue.id) { return; } - this.courseSaving = true; - clearTimeout(this.savingTimeout); - document.getElementById('course-redactor__saving-status').innerText = 'СОХРАНЕНИЕ'; - api.saveCourse(this.course, this.accessToken) - .then((response) => { - this.courseSaving = false; - document.getElementById('course-redactor__saving-status').innerText = 'СОХРАНЕНО'; - this.savingTimeout = setTimeout(() => { - document.getElementById('course-redactor__saving-status').innerText = ''; - }, 2000); - this.courseSyncHook = true; - this.course = api.convertCourseJson(response.data); - this.$nextTick(() => { - this.courseSyncHook = false; + if (this.savingDebounceTimeout) { + clearTimeout(this.savingDebounceTimeout); + } + this.savingDebounceTimeout = setTimeout(() => { + this.courseSaving = true; + clearTimeout(this.savingTimeout); + document.getElementById('course-redactor__saving-status').innerText = 'СОХРАНЕНИЕ'; + api.saveCourse(this.course, this.accessToken) + .then((response) => { + this.courseSaving = false; + document.getElementById('course-redactor__saving-status').innerText = 'СОХРАНЕНО'; + this.savingTimeout = setTimeout(() => { + document.getElementById('course-redactor__saving-status').innerText = ''; + }, 2000); + this.courseSyncHook = true; + this.course = api.convertCourseJson(response.data); + this.$nextTick(() => { + this.courseSyncHook = false; + }) }) - }) - .catch((err) => { - this.courseSaving = false; - }); - }, 2000) + .catch((err) => { + this.courseSaving = false; + }); + }, 2000); + } }, mounted() { api.getCategories(this.accessToken) From 8e1b20b83acbce17998a83fa10cb1b3982b414cd Mon Sep 17 00:00:00 2001 From: Vitaly Baev Date: Thu, 15 Feb 2018 12:33:15 +0300 Subject: [PATCH 4/4] =?UTF-8?q?=D0=A1=D0=BE=D1=85=D1=80=D0=B0=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B8=20=D0=BE=D1=82=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BA=D0=B0=20=D0=B0=D0=B2=D1=82=D0=BE=D1=80=D0=B0=20?= =?UTF-8?q?=D0=BA=D1=83=D1=80=D1=81=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/js/modules/api.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/src/js/modules/api.js b/web/src/js/modules/api.js index 3921fb67..22ec85d8 100644 --- a/web/src/js/modules/api.js +++ b/web/src/js/modules/api.js @@ -64,6 +64,7 @@ export const api = { const courseJson = { title: courseObject.title, + author: courseObject.author ? courseObject.author : null, short_description: courseObject.short_description, category: courseObject.category, price: courseObject.is_paid ? courseObject.price : 0, @@ -237,6 +238,7 @@ export const api = { return { id: courseJSON.id, title: courseJSON.title, + author: courseJSON.author, short_description: courseJSON.short_description, category: courseJSON.category && courseJSON.category.id ? courseJSON.category.id : courseJSON.category, author: courseJSON.author && courseJSON.author.id ? courseJSON.author.id : courseJSON.author,