2019-12-20 13:04:34 +01:00
|
|
|
<template>
|
2020-02-18 08:57:00 +01:00
|
|
|
<div class="container section">
|
2020-06-19 19:27:10 +02:00
|
|
|
<h2 class="title">{{ $t("Terms") }}</h2>
|
2020-02-18 08:57:00 +01:00
|
|
|
<div class="content" v-html="config.terms.bodyHtml" />
|
|
|
|
</div>
|
2019-12-20 13:04:34 +01:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-02-18 08:57:00 +01:00
|
|
|
import { Component, Vue, Watch } from "vue-property-decorator";
|
|
|
|
import { TERMS } from "@/graphql/config";
|
|
|
|
import { IConfig } from "@/types/config.model";
|
|
|
|
import { InstanceTermsType } from "@/types/admin.model";
|
2019-12-20 13:04:34 +01:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
apollo: {
|
|
|
|
config: {
|
|
|
|
query: TERMS,
|
|
|
|
variables() {
|
|
|
|
return {
|
|
|
|
locale: this.locale,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
skip() {
|
|
|
|
return !this.locale;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
export default class Terms extends Vue {
|
|
|
|
config!: IConfig;
|
2020-02-18 08:57:00 +01:00
|
|
|
|
|
|
|
locale: string | null = null;
|
2019-12-20 13:04:34 +01:00
|
|
|
|
|
|
|
created() {
|
|
|
|
this.locale = this.$i18n.locale;
|
|
|
|
}
|
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
@Watch("config", { deep: true })
|
2019-12-20 13:04:34 +01:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
2020-02-18 08:57:00 +01:00
|
|
|
<style lang="scss" scoped>
|
2020-06-19 19:27:10 +02:00
|
|
|
.content /deep/ li {
|
|
|
|
margin-bottom: 1rem;
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
</style>
|