From 954aa0f17eb2c27d569fca23bb3c4d9677a3e20e Mon Sep 17 00:00:00 2001 From: Petr Date: Wed, 11 Mar 2026 00:42:10 +0100 Subject: [PATCH] Add theme color support via instance.yaml Allow instances to override primary CSS color variables through theme section in instance.yaml config. --- webapp/config.py | 5 +++++ webapp/templates/base.html | 9 +++++++++ webapp/templates/base_login.html | 9 +++++++++ 3 files changed, 23 insertions(+) diff --git a/webapp/config.py b/webapp/config.py index 86e92db..5f0076c 100644 --- a/webapp/config.py +++ b/webapp/config.py @@ -107,6 +107,11 @@ class Config: INSTANCE_SUBTITLE = _get(_instance, "instance", "subtitle", default="") INSTANCE_COPYRIGHT = _get(_instance, "instance", "copyright", default="") + # Theme colors (optional overrides from instance config) + THEME_PRIMARY = _get(_instance, "theme", "primary", default="") + THEME_PRIMARY_DARK = _get(_instance, "theme", "primary_dark", default="") + THEME_PRIMARY_LIGHT = _get(_instance, "theme", "primary_light", default="") + # Telegram bot TELEGRAM_BOT_USERNAME = _get(_instance, "telegram", "bot_username", default="") diff --git a/webapp/templates/base.html b/webapp/templates/base.html index 9704828..5fca2f1 100644 --- a/webapp/templates/base.html +++ b/webapp/templates/base.html @@ -6,6 +6,15 @@ {% block title %}Data Analyst Portal{% endblock %} + {% if config.THEME_PRIMARY %} + + {% endif %}
diff --git a/webapp/templates/base_login.html b/webapp/templates/base_login.html index 21e88e7..7eeae1f 100644 --- a/webapp/templates/base_login.html +++ b/webapp/templates/base_login.html @@ -6,6 +6,15 @@ {% block title %}Data Analyst Portal{% endblock %} + {% if config.THEME_PRIMARY %} + + {% endif %} {% with messages = get_flashed_messages(with_categories=true) %}