From 0be280aae3fa1b0071d5c7ba62ff1dba69a7053a Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 18 Jul 2020 21:39:30 +0200 Subject: [PATCH] Show legal links from api if configured --- src/App.vue | 4 ++++ src/components/misc/legal.vue | 19 +++++++++++++++++++ src/store/modules/config.js | 6 ++++++ src/styles/components/_all.scss | 1 + src/styles/components/legal.scss | 6 ++++++ src/views/user/Login.vue | 5 +++++ src/views/user/PasswordReset.vue | 5 +++++ src/views/user/Register.vue | 5 +++++ src/views/user/RequestPasswordReset.vue | 5 +++++ 9 files changed, 56 insertions(+) create mode 100644 src/components/misc/legal.vue create mode 100644 src/styles/components/legal.scss diff --git a/src/App.vue b/src/App.vue index 229ccaa5..b36dc6e2 100644 --- a/src/App.vue +++ b/src/App.vue @@ -60,6 +60,8 @@ Settings + Imprint + Privacy policy Logout @@ -404,6 +406,8 @@ }, currentList: CURRENT_LIST, background: 'background', + imprintUrl: state => state.config.legal.imprintUrl, + privacyPolicyUrl: state => state.config.legal.privacyPolicyUrl, }), methods: { logout() { diff --git a/src/components/misc/legal.vue b/src/components/misc/legal.vue new file mode 100644 index 00000000..f1eb90de --- /dev/null +++ b/src/components/misc/legal.vue @@ -0,0 +1,19 @@ + + + diff --git a/src/store/modules/config.js b/src/store/modules/config.js index 3026f94f..f26a6579 100644 --- a/src/store/modules/config.js +++ b/src/store/modules/config.js @@ -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: { diff --git a/src/styles/components/_all.scss b/src/styles/components/_all.scss index 64879ad0..b7628d43 100644 --- a/src/styles/components/_all.scss +++ b/src/styles/components/_all.scss @@ -19,3 +19,4 @@ @import 'list-backgrounds'; @import 'color-picker'; @import 'namespaces'; +@import 'legal'; diff --git a/src/styles/components/legal.scss b/src/styles/components/legal.scss new file mode 100644 index 00000000..07715431 --- /dev/null +++ b/src/styles/components/legal.scss @@ -0,0 +1,6 @@ +.legal-links { + margin-top: 1rem; + text-align: right; + color: $grey-light; + font-size: 1rem; +} \ No newline at end of file diff --git a/src/views/user/Login.vue b/src/views/user/Login.vue index 18f04401..959c757f 100644 --- a/src/views/user/Login.vue +++ b/src/views/user/Login.vue @@ -66,6 +66,7 @@ {{ errorMessage }} + @@ -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, diff --git a/src/views/user/PasswordReset.vue b/src/views/user/PasswordReset.vue index 44b99a31..ae17dbc6 100644 --- a/src/views/user/PasswordReset.vue +++ b/src/views/user/PasswordReset.vue @@ -34,6 +34,7 @@ Login + @@ -41,8 +42,12 @@