Commit 51b8764c authored by Edgar Z. Alvarenga's avatar Edgar Z. Alvarenga

Add Impressum and Impressum editor

parent 8f83996f
......@@ -4895,6 +4895,11 @@
"type-detect": "4.0.8"
}
},
"deep-equal": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz",
"integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU="
},
"deep-extend": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
......@@ -6134,8 +6139,7 @@
"extend": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
"integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==",
"dev": true
"integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
},
"extend-shallow": {
"version": "3.0.2",
......@@ -6270,6 +6274,11 @@
"integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=",
"dev": true
},
"fast-diff": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.1.2.tgz",
"integrity": "sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig=="
},
"fast-glob": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.3.tgz",
......@@ -11628,8 +11637,7 @@
"object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
"dev": true
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
},
"object-component": {
"version": "0.0.3",
......@@ -12058,6 +12066,11 @@
"no-case": "2.3.2"
}
},
"parchment": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/parchment/-/parchment-1.1.4.tgz",
"integrity": "sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg=="
},
"parse-asn1": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz",
......@@ -14439,6 +14452,41 @@
"integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=",
"dev": true
},
"quill": {
"version": "1.3.6",
"resolved": "https://registry.npmjs.org/quill/-/quill-1.3.6.tgz",
"integrity": "sha512-K0mvhimWZN6s+9OQ249CH2IEPZ9JmkFuCQeHAOQax3EZ2nDJ3wfGh59mnlQaZV2i7u8eFarx6wAtvQKgShojug==",
"requires": {
"clone": "2.1.2",
"deep-equal": "1.0.1",
"eventemitter3": "2.0.3",
"extend": "3.0.2",
"parchment": "1.1.4",
"quill-delta": "3.6.3"
},
"dependencies": {
"clone": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz",
"integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18="
},
"eventemitter3": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-2.0.3.tgz",
"integrity": "sha1-teEHm1n7XhuidxwKmTvgYKWMmbo="
}
}
},
"quill-delta": {
"version": "3.6.3",
"resolved": "https://registry.npmjs.org/quill-delta/-/quill-delta-3.6.3.tgz",
"integrity": "sha512-wdIGBlcX13tCHOXGMVnnTVFtGRLoP0imqxM696fIPwIf5ODIYUHIvHbZcyvGlZFiFhK5XzDC2lpjbxRhnM05Tg==",
"requires": {
"deep-equal": "1.0.1",
"extend": "3.0.2",
"fast-diff": "1.1.2"
}
},
"randomatic": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz",
......@@ -17283,6 +17331,15 @@
"vue-style-loader": "4.1.0"
}
},
"vue-quill-editor": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/vue-quill-editor/-/vue-quill-editor-3.0.6.tgz",
"integrity": "sha512-g20oSZNWg8Hbu41Kinjd55e235qVWPLfg4NvsLW6d+DhgBTFbEuMpcWlUdrD6qT3+Noim6DRu18VLM9lVShXOQ==",
"requires": {
"object-assign": "4.1.1",
"quill": "1.3.6"
}
},
"vue-router": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.0.1.tgz",
......
......@@ -40,6 +40,7 @@
"vue-base64-file-upload": "^1.0.4",
"vue-cordova": "0.1.2",
"vue-head": "2.0.12",
"vue-quill-editor": "^3.0.6",
"vue-router": "3.0.1",
"vuetify": "1.2.3",
"vuetify-upload-button": "^1.2.2",
......@@ -140,4 +141,4 @@
"browser"
]
}
}
\ No newline at end of file
}
......@@ -13,7 +13,7 @@
{{ $vuetify.t('$vuetify.Footer.userTerms') }}
</v-flex>
<v-flex md2>
{{ $vuetify.t('$vuetify.Footer.impressum') }}
<router-link to="/impressum">{{ $vuetify.t('$vuetify.Footer.impressum') }}</router-link>
</v-flex>
</v-layout>
</v-footer>
......
......@@ -12,6 +12,14 @@ function getConfig (schoolId) {
return service.post('/rpc/config', {'space_id': schoolId})
}
function getPage (schoolId, page) {
return service.post('/rpc/get_page', {'space_id': schoolId, page_name: page})
}
function updatePage (schoolId, page, content) {
return service.post('/rpc/update_page', {'space_id': schoolId, page: page, content: content})
}
function updateConfig (schoolId, configKey, configValue) {
return service.post('/rpc/config_update',
{
......@@ -25,5 +33,7 @@ export default {
get,
getPublic,
getConfig,
updateConfig
updateConfig,
getPage,
updatePage
}
<template>
<v-layout class="impressum-editor" fill-height>
<v-flex>
<v-card>
<v-toolbar dark color="primary">
<v-btn icon dark @click="$emit('close-impressum-editor')">
<v-icon>close</v-icon>
</v-btn>
<v-toolbar-title>{{ $vuetify.t('$vuetify.AdminCommunity.impressumEdit') }}</v-toolbar-title>
<v-spacer></v-spacer>
<v-toolbar-items>
<v-btn dark flat @click="updateImpressum">{{ $vuetify.t('$vuetify.Form.save') }}</v-btn>
</v-toolbar-items>
</v-toolbar>
<v-card-text>
<quill-editor class="editor-example bubble"
ref="myTextEditor"
:content="impressum"
:options="editorOptions"
@change="onEditorChange($event)"
>
<div id="toolbar" slot="toolbar">
<!-- Add a bold button -->
<button class="ql-bold">Bold</button>
<button class="ql-italic">Italic</button>
<!-- Add font size dropdown -->
<select class="ql-size">
<option value="small"></option>
<!-- Note a missing, thus falsy value, is used to reset to default -->
<option selected></option>
<option value="large"></option>
<option value="huge"></option>
</select>
<select class="ql-font">
<option selected="selected"></option>
<option value="serif"></option>
<option value="monospace"></option>
</select>
</div>
</quill-editor>
</v-card-text>
</v-card>
</v-flex>
</v-layout>
</template>
<script>
import api from '@/api'
export default {
name: 'ImpressumEditor',
data: function () {
return {
impressum: '',
editorOptions: {
placeholder: this.$vuetify.t('$vuetify.AdminCommunity.impressumEdit'),
modules: {
toolbar: '#toolbar'
}
}
}
},
beforeMount: function () {
api.school.getPage(this.$store.getters.school_id, 'impressum').then(res => {
this.impressum = res.data
})
},
computed: {
},
props: {
},
methods: {
updateImpressum: function () {
console.log(this.impressum)
api.school.updatePage(this.$store.getters.school_id, 'impressum', this.impressum).then(res => {
this.$emit('close-impressum-editor')
})
},
onEditorChange: function ({ quill, html, text }) {
this.impressum = html
}
}
}
</script>
<style lang="scss">
.impressum-editor {
background-color: white;
}
.quill-editor {
}
.ql-editor {
max-height: 600px;
}
.v-card__text {
position: relative;
bottom: 0;
top: 0;
}
</style>
<template>
<v-container fluid grid-list-md fill-height>
<v-layout row wrap justify-center align-center>
<v-flex md10 v-html="page" pa-5 class="page">
</v-flex>
</v-layout>
</v-container>
</template>
<script>
import api from '@/api'
export default {
name: 'Page',
data: function () {
return {
page: ''
}
},
props: {
page_name: String
},
beforeMount: function () {
api.school.getPage(this.$store.getters.school_id, this.page_name).then((res) => {
this.page = res.data
})
},
methods: {
}
}
</script>
<style scoped lang="scss">
.page {
background-color: white;
}
</style>
......@@ -25,12 +25,19 @@
required
></v-text-field>
<v-btn
@click="openEditImpressum"
>{{ $vuetify.t('$vuetify.AdminCommunity.impressumEdit') }}</v-btn>
<v-btn
@click="updateSchool"
>{{ $vuetify.t('$vuetify.Form.save') }}</v-btn>
</v-card-text>
</v-card>
</v-flex>
<v-dialog v-model="editImpressum">
<ImpressumEditor @close-impressum-editor="editImpressum = false"/>
</v-dialog>
</v-layout>
</v-slide-y-transition>
</v-container>
......@@ -39,13 +46,16 @@
<script>
import api from '@/api'
import ImpressumEditor from '@/components/ImpressumEditor'
export default {
name: 'School',
components: { ImpressumEditor },
data: function () {
return {
schools: [],
schoolConfig: this.$store.getters.schoolConfig,
editImpressum: false,
headers: [
{
text: this.$vuetify.t('$vuetify.AdminCommunity.tableHeaderName'),
......@@ -63,6 +73,10 @@ export default {
submit: function () {
},
openEditImpressum: function () {
this.editImpressum = true
},
selectSchool: function (school) {
this.$store.commit('SET_SELECTED_SCHOOL', school.id)
this.$store.commit('SET_SCHOOL_NAME', school.name)
......
......@@ -310,7 +310,8 @@ export default {
},
AdminCommunity: {
'tableHeaderName': 'Name',
'mainSpaceName': 'Main Ideas space name'
'mainSpaceName': 'Main Ideas space name',
'impressumEdit': 'Impressum bearbeiten'
},
AdminUsers: {
'titleAdd': 'Neue Benutzer hinzufügen',
......
......@@ -7,6 +7,7 @@ import VueAxios from 'vue-axios'
import VueAuth from '@websanova/vue-auth'
import VeeValidate from 'vee-validate'
import 'vuetify/dist/vuetify.css'
import VueQuillEditor from 'vue-quill-editor'
import VueCordova from 'vue-cordova'
import VueHead from 'vue-head'
import en from './locale/en'
......@@ -17,6 +18,12 @@ import router from './router'
import store from './store'
import api from './api'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
Vue.use(VueQuillEditor)
Vue.use(Vuetify, {
lang: {
locales: { de, en },
......
......@@ -13,6 +13,7 @@ import Profile from '@/components/Profile'
import ProfileEdit from '@/components/ProfileEdit'
import UserEdit from '@/components/UserEdit'
import PassList from '@/components/PassList'
import Page from '@/components/Page'
import store from '@/store'
Vue.use(Router)
......@@ -102,6 +103,13 @@ const router = new Router({
name: 'ProfileEdit',
component: ProfileEdit,
meta: { auth: true }
},
{
path: '/impressum',
name: 'Impressum',
component: Page,
props: { page_name: 'impressum' },
meta: { auth: true }
}
]
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment