From 7456295cb6d863d090672c5b2557a3305a995331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sch=C3=A4fer?= Date: Wed, 3 Feb 2021 18:50:36 +0100 Subject: [PATCH] Make title red if running in debug This (a) helps developers to not accidentally their production server and (b) deters user from letting it run that way for long. --- snikket_web/__init__.py | 1 + snikket_web/scss/app.scss | 4 ++++ snikket_web/templates/base.html | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/snikket_web/__init__.py b/snikket_web/__init__.py index c5d01b4..5aeeda3 100644 --- a/snikket_web/__init__.py +++ b/snikket_web/__init__.py @@ -48,6 +48,7 @@ async def proc() -> typing.Dict[str, typing.Any]: "text_to_css": colour.text_to_css, "lang": infra.selected_locale(), "user_info": user_info, + "is_in_debug_mode": current_app.debug, } diff --git a/snikket_web/scss/app.scss b/snikket_web/scss/app.scss index c01ab7c..45e4c32 100644 --- a/snikket_web/scss/app.scss +++ b/snikket_web/scss/app.scss @@ -67,6 +67,10 @@ div#topbar { font-size: $_top-h-size; line-height: 1.5; + body.debug & { + color: red; + } + @media screen and (max-width: $small-screen-threshold) { font-size: $_top-h-small-size; } diff --git a/snikket_web/templates/base.html b/snikket_web/templates/base.html index d906bce..c42b42f 100644 --- a/snikket_web/templates/base.html +++ b/snikket_web/templates/base.html @@ -16,5 +16,5 @@ - {% block body %}{% endblock %} + {% block body %}{% endblock %}