gancio-upstream/pages/about.vue

37 lines
942 B
Vue
Raw Normal View History

2019-04-05 00:10:19 +02:00
<template lang="pug">
2022-07-01 15:55:09 +02:00
v-container
2024-01-23 09:15:01 +01:00
v-card-text(v-if='$auth.user && $auth.user.is_admin')
Editor.px-3.ma-0(v-model='about' :label="$t('common.about')")
v-card-text(v-else v-html='about')
v-card-actions(v-if='$auth.user && $auth.user.is_admin')
v-spacer
v-btn(color='primary' outlined
@click='save') {{$t('common.save')}}
2019-05-30 12:04:14 +02:00
</template>
2019-08-07 01:26:14 +02:00
<script>
2020-01-15 23:31:28 +01:00
import Editor from '@/components/Editor'
import { mapState, mapActions } from 'vuex'
2019-08-07 01:26:14 +02:00
export default {
2020-01-15 23:31:28 +01:00
components: { Editor },
data ({ $store }) {
return {
about: $store.state.settings.about || this.$t('about')
}
},
2020-11-17 00:32:36 +01:00
head () {
return {
title: `${this.settings.title} - ${this.$t('common.info')}`
}
},
2019-08-07 01:26:14 +02:00
computed: mapState(['settings']),
methods: {
...mapActions(['setSetting']),
save () {
2020-10-09 00:42:03 +02:00
this.$root.$message('common.ok', { color: 'success' })
this.setSetting({ key: 'about', value: this.about })
}
2019-08-07 01:26:14 +02:00
}
}
</script>