From 9e80113089d051b1d06ec820fbf854ca85c00f28 Mon Sep 17 00:00:00 2001 From: gluap Date: Sat, 11 Mar 2023 16:49:42 +0100 Subject: [PATCH] Add an optionally-displayable "Terms and Conditions" link. --- api/config.dev.py | 1 + api/config.py.example | 1 + frontend/src/App.tsx | 7 +++++++ frontend/src/config.ts | 1 + frontend/src/translations/de.yaml | 1 + frontend/src/translations/en.yaml | 1 + frontend/src/translations/fr.yaml | 9 +++++---- 7 files changed, 17 insertions(+), 4 deletions(-) diff --git a/api/config.dev.py b/api/config.dev.py index 5685cf5..e146973 100644 --- a/api/config.dev.py +++ b/api/config.dev.py @@ -19,6 +19,7 @@ FRONTEND_DIR = None FRONTEND_CONFIG = { "imprintUrl": "https://example.com/imprint", "privacyPolicyUrl": "https://example.com/privacy", + # "termsUrl": "https://example.com/terms", # Link is only shown when set "mapHome": {"zoom": 6, "longitude": 10.2, "latitude": 51.3}, # "banner": {"text": "This is a development installation.", "style": "info"}, } diff --git a/api/config.py.example b/api/config.py.example index 1aac6e2..2310250 100644 --- a/api/config.py.example +++ b/api/config.py.example @@ -44,6 +44,7 @@ FRONTEND_DIR = "../frontend/build/" FRONTEND_CONFIG = { "imprintUrl": "https://example.com/imprint", "privacyPolicyUrl": "https://example.com/privacy", + # "termsUrl": "https://example.com/user_terms_and_conditions", # Link is only shown when set "mapHome": {"zoom": 6, "longitude": 10.2, "latitude": 51.3}, "banner": {"text": "This is a test installation.", "style": "warning"}, } diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 1025982..9c66e8e 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -219,6 +219,13 @@ const App = connect((state) => ({login: state.login}))(function App({login}) { {t('App.footer.imprint')} + { config?.termsUrl && + + + {t('App.footer.terms')} + + + }