You've already forked hotpocket
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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user