[feat] new enable_comments disable_gamification

This commit is contained in:
les
2019-10-22 01:01:41 +02:00
parent 19ca6e8f38
commit 20dc56cb8f
3 changed files with 17 additions and 4 deletions

View File

@@ -1,9 +1,12 @@
<template lang="pug"> <template lang="pug">
div div
el-divider {{$t('admin.federation')}}
el-form(inline label-width='400px') el-form(inline label-width='400px')
el-form-item(:label="$t('admin.enable_federation')") el-form-item(:label="$t('admin.enable_federation')")
el-switch(v-model='enable_federation') el-switch(v-model='enable_federation')
el-form-item(:label="$t('admin.enable_comments')")
el-switch(v-model='enable_comments')
el-form-item(:label="$t('admin.disable_gamification')")
el-switch(v-model='disable_gamification')
</template> </template>
<script> <script>
import { mapState, mapActions } from 'vuex' import { mapState, mapActions } from 'vuex'
@@ -17,6 +20,14 @@ export default {
get () { return this.settings.enable_federation }, get () { return this.settings.enable_federation },
set (value) { this.setSetting({ key: 'enable_federation', value }) } set (value) { this.setSetting({ key: 'enable_federation', value }) }
}, },
enable_comments: {
get () { return this.settings.enable_comments },
set (value) { this.setSetting({ key: 'enable_comments', value }) }
},
disable_gamification: {
get () { return this.settings.disable_gamification },
set (value) { this.setSetting({ key: 'disable_gamification', value }) }
},
} }
} }
</script> </script>

View File

@@ -15,6 +15,7 @@ const debug = require('debug')('federation')
* ref: https://www.w3.org/TR/activitypub/#Overview * ref: https://www.w3.org/TR/activitypub/#Overview
*/ */
router.use(cors())
router.use((req, res, next) => { router.use((req, res, next) => {
if(settingsController.settings.enable_federation) return next() if(settingsController.settings.enable_federation) return next()
debug('Federation disabled!') debug('Federation disabled!')
@@ -22,7 +23,6 @@ router.use((req, res, next) => {
next(false) next(false)
}) })
router.use(cors())
router.use(express.json({ type: ['application/json', 'application/activity+json', 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'] })) router.use(express.json({ type: ['application/json', 'application/activity+json', 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'] }))
router.get('/m/:event_id', async (req, res) => { router.get('/m/:event_id', async (req, res) => {

View File

@@ -14,7 +14,9 @@ export const state = () => ({
allow_anon_event: true, allow_anon_event: true,
allow_recurrent_event: true, allow_recurrent_event: true,
recurrent_event_visible: false, recurrent_event_visible: false,
enable_federation: false enable_federation: false,
enable_comments: false,
disable_gamification: true
}, },
in_past: false, in_past: false,
filters: { filters: {