From 180a078a0de370cf16e15cb4dcd77f7092c37c51 Mon Sep 17 00:00:00 2001 From: Alice Date: Thu, 11 Apr 2019 16:20:58 +0200 Subject: [PATCH] Add support chat settings --- ccvpn/context_processors.py | 1 + ccvpn/settings.py | 3 +++ templates/layout.html | 22 ++++++++++++++-------- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/ccvpn/context_processors.py b/ccvpn/context_processors.py index 1f7b2f9..5d012be 100644 --- a/ccvpn/context_processors.py +++ b/ccvpn/context_processors.py @@ -10,5 +10,6 @@ def some_settings(request): 'CLIENT_ON_VPN': is_vpn_gateway(client_ip), 'ROOT_URL': settings.ROOT_URL, 'ADDITIONAL_HTML': settings.ADDITIONAL_HTML, + 'SUPPORT_HTML': settings.SUPPORT_HTML, 'ADDITIONAL_HEADER_HTML': settings.ADDITIONAL_HEADER_HTML, } diff --git a/ccvpn/settings.py b/ccvpn/settings.py index e9cbe71..6c86532 100644 --- a/ccvpn/settings.py +++ b/ccvpn/settings.py @@ -173,6 +173,9 @@ ADDITIONAL_HEADER_HTML = '' # HTML added before ADDITIONAL_HTML = '' +# Will replace the default contact us thing when not empty +SUPPORT_HTML = '' + # Custom per cluster message displayed config page # 'cluster_name': "No P2P" LAMBDAINST_CLUSTER_MESSAGES = {} diff --git a/templates/layout.html b/templates/layout.html index d34e2c3..5108a5b 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -94,16 +94,22 @@

+ {{ADDITIONAL_HTML | safe}} + {% block livechat_thing %} -
- - - {% blocktrans %}Any question? Chat with us{% endblocktrans %} - -
+ {% if not request.user.is_staff %} + {% if SUPPORT_HTML %} + {{SUPPORT_HTML | safe}} + {% else %} +
+ + + {% blocktrans %}Any question? Chat with us{% endblocktrans %} + +
+ {% endif %} + {% endif %} {% endblock %} - - {{ADDITIONAL_HTML | safe}}