+
@@ -25,11 +26,17 @@
import { mapGetters } from 'vuex'
import i18n from '@/lang'
import Setting from './Setting'
+import { EditorInput } from './inputComponents'
import _ from 'lodash'
export default {
name: 'Other',
- components: { Setting },
+ components: { EditorInput, Setting },
+ data() {
+ return {
+ editorContent: ''
+ }
+ },
computed: {
...mapGetters([
'settings'
@@ -81,12 +88,22 @@ export default {
},
remoteIpData() {
return _.get(this.settings.settings, [':pleroma', 'Pleroma.Web.Plugs.RemoteIp']) || {}
+ },
+ termsOfServicesContent() {
+ return this.$store.state.settings.termsOfServices
}
},
+ async mounted() {
+ await this.$store.dispatch('FetchInstanceDocument', 'terms-of-service')
+ },
methods: {
+ handleEditorUpdate(content) {
+ this.editorContent = content
+ },
async onSubmit() {
try {
await this.$store.dispatch('SubmitChanges')
+ await this.$store.dispatch('UpdateInstanceDocs', { name: 'terms-of-service', content: this.editorContent })
} catch (e) {
return
}
diff --git a/src/views/settings/components/inputComponents/EditorInput.vue b/src/views/settings/components/inputComponents/EditorInput.vue
index 5af829d6..3f6b3bdc 100644
--- a/src/views/settings/components/inputComponents/EditorInput.vue
+++ b/src/views/settings/components/inputComponents/EditorInput.vue
@@ -1,8 +1,8 @@
-
+
- {{ $t('settings.instancePanel') }}
+ {{ name === 'instance-panel' ? $t('settings.instancePanel') : $t('settings.termsOfServices') }}
@@ -126,6 +126,10 @@ export default {
content: {
type: String,
default: ''
+ },
+ name: {
+ type: String,
+ default: ''
}
},
data() {
@@ -173,8 +177,8 @@ export default {
this.editor.destroy()
},
methods: {
- async removeInstanceDoc(name) {
- await this.$store.dispatch('RemoveInstanceDocument', 'instance-panel')
+ async removeInstanceDoc() {
+ await this.$store.dispatch('RemoveInstanceDocument', this.name)
this.editor.setContent(this.content)
}
}