Show legal links from api if configured
continuous-integration/drone/push Build is passing Details

This commit is contained in:
kolaente 2020-07-18 21:39:30 +02:00
parent 8ab9824f96
commit 0be280aae3
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
9 changed files with 56 additions and 0 deletions

View File

@ -60,6 +60,8 @@
<router-link :to="{name: 'user.settings'}" class="dropdown-item">
Settings
</router-link>
<a :href="imprintUrl" v-if="imprintUrl" class="dropdown-item" target="_blank">Imprint</a>
<a :href="privacyPolicyUrl" v-if="privacyPolicyUrl" class="dropdown-item" target="_blank">Privacy policy</a>
<a @click="logout()" class="dropdown-item">
Logout
</a>
@ -404,6 +406,8 @@
},
currentList: CURRENT_LIST,
background: 'background',
imprintUrl: state => state.config.legal.imprintUrl,
privacyPolicyUrl: state => state.config.legal.privacyPolicyUrl,
}),
methods: {
logout() {

View File

@ -0,0 +1,19 @@
<template>
<div class="legal-links">
<a :href="imprintUrl" v-if="imprintUrl" target="_blank">Imprint</a>
<span v-if="imprintUrl && privacyPolicyUrl"> | </span>
<a :href="privacyPolicyUrl" v-if="privacyPolicyUrl" target="_blank">Privacy policy</a>
</div>
</template>
<script>
import {mapState} from 'vuex'
export default {
name: 'legal',
computed: mapState({
imprintUrl: state => state.config.legal.imprintUrl,
privacyPolicyUrl: state => state.config.legal.privacyPolicyUrl,
})
}
</script>

View File

@ -15,6 +15,10 @@ export default {
taskAttachmentsEnabled: true,
totpEnabled: true,
enabledBackgroundProviders: [],
legal: {
imprintUrl: '',
privacyPolicyUrl: '',
}
}),
mutations: {
[CONFIG](state, config) {
@ -28,6 +32,8 @@ export default {
state.taskAttachmentsEnabled = config.task_attachments_enabled
state.totpEnabled = config.totp_enabled
state.enabledBackgroundProviders = config.enabled_background_providers
state.legal.imprintUrl = config.legal.imprint_url
state.legal.privacyPolicyUrl = config.legal.privacy_policy_url
},
},
actions: {

View File

@ -19,3 +19,4 @@
@import 'list-backgrounds';
@import 'color-picker';
@import 'namespaces';
@import 'legal';

View File

@ -0,0 +1,6 @@
.legal-links {
margin-top: 1rem;
text-align: right;
color: $grey-light;
font-size: 1rem;
}

View File

@ -66,6 +66,7 @@
{{ errorMessage }}
</div>
</form>
<legal/>
</div>
</div>
</template>
@ -77,8 +78,12 @@
import {HTTP} from '../../http-common'
import message from '../../message'
import {ERROR_MESSAGE, LOADING} from '../../store/mutation-types'
import legal from '../../components/misc/legal'
export default {
components: {
legal,
},
data() {
return {
confirmedEmailSuccess: false,

View File

@ -34,6 +34,7 @@
</div>
<router-link :to="{ name: 'user.login' }" class="button is-primary">Login</router-link>
</div>
<legal/>
</div>
</div>
</template>
@ -41,8 +42,12 @@
<script>
import PasswordResetModel from '../../models/passwordReset'
import PasswordResetService from '../../services/passwordReset'
import Legal from '../../components/misc/legal'
export default {
components: {
Legal,
},
data() {
return {
passwordResetService: PasswordResetService,

View File

@ -41,6 +41,7 @@
{{ errorMessage }}
</div>
</form>
<legal/>
</div>
</div>
</template>
@ -49,8 +50,12 @@
import router from '../../router'
import {mapState} from 'vuex'
import {ERROR_MESSAGE, LOADING} from '../../store/mutation-types'
import Legal from '../../components/misc/legal'
export default {
components: {
Legal,
},
data() {
return {
credentials: {

View File

@ -26,6 +26,7 @@
</div>
<router-link :to="{ name: 'user.login' }" class="button is-primary">Login</router-link>
</div>
<legal/>
</div>
</div>
</template>
@ -33,8 +34,12 @@
<script>
import PasswordResetModel from '../../models/passwordReset'
import PasswordResetService from '../../services/passwordReset'
import Legal from '../../components/misc/legal'
export default {
components: {
Legal,
},
data() {
return {
passwordResetService: PasswordResetService,