Merge branch 'dev' of gitlab.com:lilcity/backend into dev

remotes/origin/hasaccess
Ivlev Denis 8 years ago
commit b86435ff71
  1. 71
      apps/course/templates/course/course.html
  2. 46
      web/src/components/CourseRedactor.vue
  3. 6
      web/src/js/modules/api.js
  4. 2
      web/src/js/modules/courses.js
  5. 2
      web/src/sass/_common.sass

@ -158,16 +158,35 @@
</svg>
{% endif %}
</a>
<div class="course__share share share_sm">
<div class="share">
<div class="share__title">Поделиться курсом</div>
<div class="share__list">
<div class="likely">
<div class="facebook">Facebook</div>
<div class="twitter">Twitter</div>
<div class="gplus">Google+</div>
<div class="vkontakte">VK</div>
<div class="pinterest">Pinterest</div>
</div>
<div class="share__list likely">
<!--<a class="share__item vkontakte" href="#">-->
<!--<svg class="icon icon-share-facebook">-->
<!--<use xlink:href="{% static 'img/sprite.svg' %}#icon-share-vkontakte"></use>-->
<!--</svg>-->
<!--</a>-->
<a class="share__item facebook" href="#">
<svg class="icon icon-share-facebook">
<use xlink:href="{% static 'img/sprite.svg' %}#icon-share-facebook"></use>
</svg>
</a>
<a class="share__item twitter" href="#">
<svg class="icon icon-share-twitter">
<use xlink:href="{% static 'img/sprite.svg' %}#icon-share-twitter"></use>
</svg>
</a>
<a class="share__item gplus" href="#">
<svg class="icon icon-share-google">
<use xlink:href="{% static 'img/sprite.svg' %}#icon-share-google"></use>
</svg>
</a>
<a class="share__item pinterest" href="#">
<svg class="icon icon-share-pinterest">
<use xlink:href="{% static 'img/sprite.svg' %}#icon-share-pinterest"></use>
</svg>
</a>
</div>
</div>
</div>
@ -392,14 +411,32 @@
<div class="section__center center center_sm">
<div class="share">
<div class="share__title">Поделиться курсом</div>
<div class="share__list">
<div class="likely">
<div class="facebook">Facebook</div>
<div class="twitter">Twitter</div>
<div class="gplus">Google+</div>
<div class="vkontakte">VK</div>
<div class="pinterest">Pinterest</div>
</div>
<div class="share__list likely">
<!--<a class="share__item vkontakte" href="#">-->
<!--<svg class="icon icon-share-facebook">-->
<!--<use xlink:href="{% static 'img/sprite.svg' %}#icon-share-vkontakte"></use>-->
<!--</svg>-->
<!--</a>-->
<a class="share__item facebook" href="#">
<svg class="icon icon-share-facebook">
<use xlink:href="{% static 'img/sprite.svg' %}#icon-share-facebook"></use>
</svg>
</a>
<a class="share__item twitter" href="#">
<svg class="icon icon-share-twitter">
<use xlink:href="{% static 'img/sprite.svg' %}#icon-share-twitter"></use>
</svg>
</a>
<a class="share__item gplus" href="#">
<svg class="icon icon-share-google">
<use xlink:href="{% static 'img/sprite.svg' %}#icon-share-google"></use>
</svg>
</a>
<a class="share__item pinterest" href="#">
<svg class="icon icon-share-pinterest">
<use xlink:href="{% static 'img/sprite.svg' %}#icon-share-pinterest"></use>
</svg>
</a>
</div>
</div>
</div>

@ -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)

@ -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,9 +238,10 @@ export const api = {
return {
id: courseJSON.id,
title: courseJSON.title,
author: courseJSON.author,
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,

@ -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');

@ -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

Loading…
Cancel
Save