BTHLABS-60: Appearance settings

Co-authored-by: Tomek Wójcik <labs@tomekwojcik.pl>
Co-committed-by: Tomek Wójcik <labs@tomekwojcik.pl>
This commit is contained in:
2025-10-07 04:42:58 +00:00
committed by Tomek Wójcik
parent b4d5375954
commit 2e8b8d7330
11 changed files with 102 additions and 9 deletions

View File

@@ -9,6 +9,10 @@ from hotpocket_backend.apps.core.conf import settings
def manifest_json(request: HttpRequest) -> JsonResponse:
light_theme = False
if request.user.is_anonymous is False:
light_theme = request.user.settings.get('light_theme', None) or False
result = {
'name': settings.SITE_TITLE,
'short_name': settings.SITE_SHORT_TITLE,
@@ -16,8 +20,17 @@ def manifest_json(request: HttpRequest) -> JsonResponse:
reverse('ui.associations.browse'),
),
'display': 'standalone',
'background_color': '#212529',
'theme_color': '#2b3035',
'background_color': (
'#212529'
if light_theme is False
else '#ffffff'
),
'theme_color': (
'#2b3035'
if light_theme is False
else
'#f8f9fa'
),
'icons': [
{
'src': request.build_absolute_uri(