Add anonymous and remote participations
This commit is contained in:
64
js/src/views/Terms.vue
Normal file
64
js/src/views/Terms.vue
Normal file
@@ -0,0 +1,64 @@
|
||||
<template>
|
||||
<div class="container section">
|
||||
<h2 class="title">{{ $t('Privacy Policy')}}</h2>
|
||||
<div class="content" v-html="config.terms.bodyHtml" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {
|
||||
Component,
|
||||
Vue, Watch,
|
||||
} from 'vue-property-decorator';
|
||||
import { TERMS } from '@/graphql/config';
|
||||
import { IConfig } from '@/types/config.model';
|
||||
import { RouteName } from '@/router';
|
||||
import { InstanceTermsType } from '@/types/admin.model';
|
||||
|
||||
@Component({
|
||||
apollo: {
|
||||
config: {
|
||||
query: TERMS,
|
||||
variables() {
|
||||
return {
|
||||
locale: this.locale,
|
||||
};
|
||||
},
|
||||
skip() {
|
||||
return !this.locale;
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
export default class Terms extends Vue {
|
||||
config!: IConfig;
|
||||
locale: string|null = null;
|
||||
|
||||
created() {
|
||||
this.locale = this.$i18n.locale;
|
||||
}
|
||||
|
||||
@Watch('config', { deep: true })
|
||||
watchConfig(config: IConfig) {
|
||||
if (config.terms.type) {
|
||||
console.log(this.config.terms);
|
||||
this.redirectToUrl();
|
||||
}
|
||||
}
|
||||
|
||||
redirectToUrl() {
|
||||
if (this.config.terms.type === InstanceTermsType.URL) {
|
||||
window.location.replace(this.config.terms.url);
|
||||
}
|
||||
}
|
||||
|
||||
RouteName = RouteName;
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
@import "@/variables.scss";
|
||||
|
||||
main > .container {
|
||||
background: $white;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user