From 3e63e1c768f9abc5e134e920cb803fa9eb96908a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Mon, 22 Nov 2021 22:19:06 +0100 Subject: [PATCH] =?UTF-8?q?Odli=C5=A1en=C3=AD=20web=C5=AF:=20takhle=20to?= =?UTF-8?q?=20ur=C4=8Dit=C4=9B=20jde,=20ale=20mo=C5=BEn=C3=A1=20to=20jde?= =?UTF-8?q?=20l=C3=A9pe=20(a=20v=20hez=C4=8D=C3=ADch=20barv=C3=A1ch)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mamweb/settings_common.py | 1 + mamweb/settings_local.py | 1 + mamweb/settings_prod.py | 1 + mamweb/settings_test.py | 1 + mamweb/static/css/mamweb.css | 18 ++++++++++++++++++ mamweb/templates/base.html | 2 +- various/context_processors.py | 7 +++++++ 7 files changed, 30 insertions(+), 1 deletion(-) diff --git a/mamweb/settings_common.py b/mamweb/settings_common.py index 58e8c638..ce028bc2 100644 --- a/mamweb/settings_common.py +++ b/mamweb/settings_common.py @@ -79,6 +79,7 @@ TEMPLATES = [ 'django.contrib.messages.context_processors.messages', 'sekizai.context_processors.sekizai', 'header_fotky.context_processors.vzhled', + 'various.context_processors.rozliseni', 'various.context_processors.april', ) }, diff --git a/mamweb/settings_local.py b/mamweb/settings_local.py index 0aadd27e..85058c9f 100644 --- a/mamweb/settings_local.py +++ b/mamweb/settings_local.py @@ -97,3 +97,4 @@ LOGGING = { # E-maily posílat chceme, ale do terminálu :-) EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' SEND_EMAIL_NOTIFICATIONS = True +LOCAL_TEST_PROD = "local" diff --git a/mamweb/settings_prod.py b/mamweb/settings_prod.py index 0374d88b..e674ab05 100644 --- a/mamweb/settings_prod.py +++ b/mamweb/settings_prod.py @@ -67,3 +67,4 @@ LOGGING['handlers']['registration_error_log']['filename'] = '/home/mam-web/logs/ # E-MAIL NOTIFICATIONS POSLI_MAILOVOU_NOTIFIKACI = True +LOCAL_TEST_PROD = "prod" diff --git a/mamweb/settings_test.py b/mamweb/settings_test.py index f8fd844e..365664d2 100644 --- a/mamweb/settings_test.py +++ b/mamweb/settings_test.py @@ -76,3 +76,4 @@ EMAIL_BACKEND = 'various.mail_prefixer.PrefixingMailBackend' # TODO Pouze na otestování testu… Zvolit konferu! # XXX: Je to pole, protože implementační detail backendu. TESTOVACI_EMAILOVA_KONFERENCE = ['betatest@mam.mff.cuni.cz'] +LOCAL_TEST_PROD = "test" diff --git a/mamweb/static/css/mamweb.css b/mamweb/static/css/mamweb.css index 8b19fb80..26baccbd 100644 --- a/mamweb/static/css/mamweb.css +++ b/mamweb/static/css/mamweb.css @@ -1182,3 +1182,21 @@ div.gdpr { label[for=id_skola] { font-weight: bold; } + +.localweb { + border-left: 20px solid greenyellow; + border-right: 20px solid greenyellow; +} + +.localweb .login-bar { + margin-left: -20px; +} + +.testweb { + border-left: 20px solid darkorange; + border-right: 20px solid darkorange; +} + +.testweb .login-bar { + margin-left: -20px; +} diff --git a/mamweb/templates/base.html b/mamweb/templates/base.html index 1d292f95..85cb9e12 100644 --- a/mamweb/templates/base.html +++ b/mamweb/templates/base.html @@ -36,7 +36,7 @@ {% block script %}{% endblock %} - + {% if user.is_staff %}
diff --git a/various/context_processors.py b/various/context_processors.py index c0be2975..b9fbd1c3 100644 --- a/various/context_processors.py +++ b/various/context_processors.py @@ -1,3 +1,6 @@ +from django.conf import settings + + def april(req): if 'X-April' in req.headers: try: @@ -12,3 +15,7 @@ def april(req): return {'april': today.year} return {} + +def rozliseni(request): + return {"LOCAL_TEST_PROD": settings.LOCAL_TEST_PROD} +