Move customizable terms-of-service into its separate .html file.

This commit is contained in:
Shpuld Shpuldson 2017-06-19 16:35:35 +03:00
parent 95605c32f1
commit bfbc94d697
4 changed files with 18 additions and 4 deletions

View file

@ -4,6 +4,9 @@ const registration = {
error: false,
registering: false
}),
computed: {
termsofservice () { return this.$store.state.config.tos }
},
methods: {
submit () {
this.registering = true

View file

@ -42,9 +42,7 @@
<button :disabled="registering" type='submit' class='btn btn-default base05 base01-background'>Submit</button>
</div>
</div>
<div class='terms-of-service'>
<h4>Terms of Service</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<div class='terms-of-service' v-html="termsofservice">
</div>
</div>
<div v-if="error" class='form-group'>

View file

@ -86,9 +86,15 @@ new Vue({
window.fetch('/static/config.json')
.then((res) => res.json())
.then(({name, theme, background, logo}) => {
.then(({name, theme, background, logo, tos}) => {
store.dispatch('setOption', { name: 'name', value: name })
store.dispatch('setOption', { name: 'theme', value: theme })
store.dispatch('setOption', { name: 'background', value: background })
store.dispatch('setOption', { name: 'logo', value: logo })
})
window.fetch('/static/terms-of-service.html')
.then((res) => res.text())
.then((html) => {
store.dispatch('setOption', { name: 'tos', value: html })
})

View file

@ -0,0 +1,7 @@
<h4>Terms of Service</h4>
<p>This is a placeholder ToS.</p>
<p>Edit <code>"/static/terms-of-service.html"</code> to make it fit the needs of your instance.</p>
<br>
<img src="/static/logo.png"/ style="display: block; margin: auto;">