parent
92c997fe9d
commit
560c04f938
8 changed files with 117 additions and 9 deletions
@ -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(',')))) |
||||||
@ -0,0 +1,68 @@ |
|||||||
|
<template> |
||||||
|
<div> |
||||||
|
<div class="kit__body"> |
||||||
|
<div class="lessons__list"> |
||||||
|
<div class="lessons__item" v-for="(lesson, index) in lessons"> |
||||||
|
<div class="lessons__actions lessons__actions__no-hover"> |
||||||
|
<button type="button" class="lessons__action" @click="removeLesson(lesson.id)"> |
||||||
|
<svg class="icon icon-delete"> |
||||||
|
<use xlink:href="/static/img/sprite.svg#icon-delete"></use> |
||||||
|
</svg> |
||||||
|
</button> |
||||||
|
<button type="button" class="lessons__action" @click="editLesson(lesson.id)"> |
||||||
|
<svg class="icon icon-edit"> |
||||||
|
<use xlink:href="/static/img/sprite.svg#icon-edit"></use> |
||||||
|
</svg> |
||||||
|
</button> |
||||||
|
</div> |
||||||
|
<div class="lessons__subtitle subtitle">{{ lesson.title }}</div> |
||||||
|
<div class="lessons__row"> |
||||||
|
<div class="lessons__content">{{ lesson.short_description }}</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="lessons__foot"> |
||||||
|
<button type="button" class="lessons__btn btn btn_md" @click="addLesson">СОЗДАТЬ УРОК</button> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
// import { ROLE_ADMIN, ROLE_AUTHOR } from './consts' |
||||||
|
// import LinkInput from './inputs/LinkInput' |
||||||
|
// import DatePicker from 'vuejs-datepicker' |
||||||
|
// import BlockText from './blocks/BlockText' |
||||||
|
// import BlockImage from './blocks/BlockImage' |
||||||
|
// import BlockImages from './blocks/BlockImages' |
||||||
|
// import BlockImageText from './blocks/BlockImageText' |
||||||
|
// import BlockVideo from './blocks/BlockVideo' |
||||||
|
// import LilSelect from "./inputs/LilSelect"; |
||||||
|
// import LessonRedactor from "./LessonRedactor"; |
||||||
|
// import {api} from "../js/modules/api"; |
||||||
|
// import BlockAdd from "./blocks/BlockAdd"; |
||||||
|
// import $ from 'jquery'; |
||||||
|
// import {required, minValue, numeric, url } from 'vuelidate/lib/validators' |
||||||
|
// import slugify from 'slugify'; |
||||||
|
// import Draggable from 'vuedraggable'; |
||||||
|
import {showNotification} from "../js/modules/notification"; |
||||||
|
// import createHistory from "history/createBrowserHistory"; |
||||||
|
// import moment from 'moment' |
||||||
|
// import _ from 'lodash' |
||||||
|
|
||||||
|
export default { |
||||||
|
name: "leessons-admin", |
||||||
|
props: ["lessons"], |
||||||
|
methods: { |
||||||
|
addLesson() { |
||||||
|
window.location = '/course/create/live'; |
||||||
|
}, |
||||||
|
editLesson(id) { |
||||||
|
window.location = '/school/lessons/'+id+'/edit'; |
||||||
|
}, |
||||||
|
removeLesson(id) { |
||||||
|
showNotification('error', '<p>Вжух и удалили!<sup style="vertical-align: super;">(на самом деле нет)</sup></p>'); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
@ -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, |
||||||
|
} |
||||||
|
}); |
||||||
Loading…
Reference in new issue