From 52c773a98f14927ea04e6715a813953d72c942a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Tue, 23 Nov 2021 00:12:49 +0100 Subject: [PATCH] =?UTF-8?q?Kdy=C5=BE=20u=C5=BE=20rozli=C5=A1en=C3=AD,=20ta?= =?UTF-8?q?k=20i=20se=20superuserem=20na=20produkci,=20trochu=20naprasen?= =?UTF-8?q?=C3=A9=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (Aneb štvalo mě, že zrovna produkční web mě nepraští do očí. Na druhou stranu tohle mě zase praští do očí, i když na ten web jdu něco dělat, ne webit…) --- mamweb/static/css/mamweb.css | 10 ++++++++++ various/context_processors.py | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/mamweb/static/css/mamweb.css b/mamweb/static/css/mamweb.css index 26baccbd..5a879a37 100644 --- a/mamweb/static/css/mamweb.css +++ b/mamweb/static/css/mamweb.css @@ -1200,3 +1200,13 @@ label[for=id_skola] { .testweb .login-bar { margin-left: -20px; } + +/* Produkční web z pohledu superuživatele */ +.suprodweb { + border-left: 20px solid red; + border-right: 20px solid red; +} + +.suprodweb .login-bar { + margin-left: -20px; +} diff --git a/various/context_processors.py b/various/context_processors.py index b9fbd1c3..a1e4478a 100644 --- a/various/context_processors.py +++ b/various/context_processors.py @@ -17,5 +17,8 @@ def april(req): def rozliseni(request): - return {"LOCAL_TEST_PROD": settings.LOCAL_TEST_PROD} + ltp = settings.LOCAL_TEST_PROD + if request.user.is_superuser and ltp == "prod": + ltp = "su" + ltp + return {"LOCAL_TEST_PROD": ltp}