diff --git a/apps/course/templatetags/jsonify_queryset.py b/apps/course/templatetags/jsonify_queryset.py new file mode 100644 index 00000000..5599b552 --- /dev/null +++ b/apps/course/templatetags/jsonify_queryset.py @@ -0,0 +1,8 @@ +from django import template +import json + +register = template.Library() + +@register.filter +def jsonify(object,fields): + return json.dumps(list(object.values(*fields.split(',')))) diff --git a/apps/school/templates/school/livelessons_list.html b/apps/school/templates/school/livelessons_list.html index 2f3aaa5d..1f5bb8e5 100644 --- a/apps/school/templates/school/livelessons_list.html +++ b/apps/school/templates/school/livelessons_list.html @@ -1,4 +1,7 @@ -{% extends "templates/lilcity/index.html" %} {% load static %} {% block content %} +{% extends "templates/lilcity/index.html" %} +{% load jsonify from jsonify_queryset %} + +{% load static %} {% block content %}
Онлайн-курсы LilCity
@@ -6,11 +9,20 @@
- + + + + + + + +
{% endblock content %} + + +{% block foot %} + + +{% endblock foot %} diff --git a/web/src/components/LessonsAdmin.vue b/web/src/components/LessonsAdmin.vue new file mode 100644 index 00000000..091fe531 --- /dev/null +++ b/web/src/components/LessonsAdmin.vue @@ -0,0 +1,68 @@ + + + \ No newline at end of file diff --git a/web/src/js/lessons-admin.js b/web/src/js/lessons-admin.js new file mode 100644 index 00000000..11b48565 --- /dev/null +++ b/web/src/js/lessons-admin.js @@ -0,0 +1,16 @@ +import Vue from 'vue' +import 'babel-polyfill' +import LessonsAdmin from '../components/LessonsAdmin.vue' + +if (process.env.NODE_ENV === 'development') { + // Enable vue-devtools + Vue.config.devtools = true; +} + + +let app = new Vue({ + el: '#lilcity-vue-app', + components: { + 'lessons-admin': LessonsAdmin, + } +}); diff --git a/web/src/js/modules/notification.js b/web/src/js/modules/notification.js index e29ad3ab..9eedf0ed 100644 --- a/web/src/js/modules/notification.js +++ b/web/src/js/modules/notification.js @@ -4,7 +4,7 @@ import '../../sass/components/notification.scss'; export function showNotification(style, text) { let htmlNode = document.createElement('div'); - let htmlElement = $(htmlNode).addClass('notification').addClass(`notification--${style}`).text(text).appendTo($('body')); + let htmlElement = $(htmlNode).addClass('notification').addClass(`notification--${style}`).html(text).appendTo($('body')); if($('body').find('.notification').length) { var outerHeight = 0; diff --git a/web/src/js/modules/toggle.js b/web/src/js/modules/toggle.js index f12b1d18..309a65c0 100644 --- a/web/src/js/modules/toggle.js +++ b/web/src/js/modules/toggle.js @@ -5,13 +5,13 @@ $(document).ready(function () { e.preventDefault(); let _this = $(this); _this.toggleClass('active'); - _this.next().slideToggle(); + // _this.next().slideToggle(); }); $('.js-timing-toggle').on('click', function(e){ e.preventDefault(); let _this = $(this); let _parent = _this.closest('.timing__item') _parent.toggleClass('open'); - _parent.next().slideToggle(); + // _parent.next().slideToggle(); }); }); diff --git a/web/src/sass/_common.sass b/web/src/sass/_common.sass index cf4594ab..03509b52 100755 --- a/web/src/sass/_common.sass +++ b/web/src/sass/_common.sass @@ -2623,6 +2623,9 @@ a.grey-link opacity: 0 visibility: hidden transition: opacity .2s, visibility .2s + &__no-hover + opacity: 1 + visibility: visible &__action margin-left: 10px padding: 10px diff --git a/web/webpack.config.js b/web/webpack.config.js index c341491a..86bb2b2b 100644 --- a/web/webpack.config.js +++ b/web/webpack.config.js @@ -9,6 +9,7 @@ module.exports = { entry: { app: "./src/js/app.js", courseRedactor: "./src/js/course-redactor.js", + lessonsAdmin: "./src/js/lessons-admin.js", mixpanel: "./src/js/third_party/mixpanel-2-latest.js", sprite: glob('./src/icons/*.svg'), images: glob('./src/img/*'),