[admin] edit logo/title/description from settings
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
div
|
div
|
||||||
el-form(inline label-width="400px")
|
el-form(label-width="400px")
|
||||||
//- select timezone
|
//- select timezone
|
||||||
client-only
|
client-only
|
||||||
el-form-item(:label="$t('admin.select_instance_timezone')")
|
el-form-item(:label="$t('admin.select_instance_timezone')")
|
||||||
@@ -9,10 +9,25 @@
|
|||||||
span.float-left {{timezone.value}}
|
span.float-left {{timezone.value}}
|
||||||
small.float-right.text-danger {{timezone.offset}}
|
small.float-right.text-danger {{timezone.offset}}
|
||||||
|
|
||||||
|
el-form-item(:label="$t('common.title')")
|
||||||
|
el-input(v-model='title' @blur='save("title", title)')
|
||||||
|
|
||||||
|
el-form-item(:label="$t('common.description')")
|
||||||
|
el-input(v-model='description' @blur='save("description", description)')
|
||||||
|
|
||||||
//- allow open registration
|
//- allow open registration
|
||||||
el-form-item(:label="$t('admin.allow_registration_description')")
|
el-form-item(:label="$t('admin.allow_registration_description')")
|
||||||
el-switch(name='reg' v-model='allow_registration')
|
el-switch(name='reg' v-model='allow_registration')
|
||||||
|
|
||||||
|
el-form-item(:label="$t('admin.favicon')")
|
||||||
|
el-upload(ref='upload' :action='`${settings.baseurl}/api/settings/favicon`'
|
||||||
|
:limit='1'
|
||||||
|
name='favicon'
|
||||||
|
accept='image/*'
|
||||||
|
:multiple='false')
|
||||||
|
el-button(slot='trigger' size='small' type='primary') select file
|
||||||
|
.el-upload__tip(slot='tip') jpg/png files with a size less than 500kb
|
||||||
|
|
||||||
//- allow anon event
|
//- allow anon event
|
||||||
el-form-item(:label="$t('admin.allow_anon_event')")
|
el-form-item(:label="$t('admin.allow_anon_event')")
|
||||||
el-switch(v-model='allow_anon_event')
|
el-switch(v-model='allow_anon_event')
|
||||||
@@ -30,7 +45,14 @@ import moment from 'moment-timezone'
|
|||||||
import timezones from './timezones'
|
import timezones from './timezones'
|
||||||
export default {
|
export default {
|
||||||
name: 'Settings',
|
name: 'Settings',
|
||||||
|
data ({ $store }) {
|
||||||
|
return {
|
||||||
|
title: $store.state.settings.title,
|
||||||
|
description: $store.state.settings.description,
|
||||||
|
}
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
...mapState(['settings']),
|
||||||
timezones () {
|
timezones () {
|
||||||
const current_timezone = moment.tz.guess()
|
const current_timezone = moment.tz.guess()
|
||||||
return timezones
|
return timezones
|
||||||
@@ -60,6 +82,13 @@ export default {
|
|||||||
set (value) { this.setSetting({ key: 'recurrent_event_visible', value }) }
|
set (value) { this.setSetting({ key: 'recurrent_event_visible', value }) }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: mapActions(['setSetting'])
|
methods: {
|
||||||
|
...mapActions(['setSetting']),
|
||||||
|
save (key, value) {
|
||||||
|
if (this.settings[key] !== value) {
|
||||||
|
this.setSetting({ key, value })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user