fixed default page setting and made PWA respect that setting

This commit is contained in:
vabene1111
2024-03-09 07:44:32 +01:00
parent aebc4a45ff
commit 37fb0418ac
5 changed files with 33 additions and 3 deletions

View File

@@ -38,7 +38,7 @@ def index(request):
return HttpResponseRedirect(reverse_lazy('view_search'))
try:
page_map = {UserPreference.SEARCH: reverse_lazy('view_search'), UserPreference.PLAN: reverse_lazy('view_plan'), UserPreference.BOOKS: reverse_lazy('view_books'), }
page_map = {UserPreference.SEARCH: reverse_lazy('view_search'), UserPreference.PLAN: reverse_lazy('view_plan'), UserPreference.BOOKS: reverse_lazy('view_books'), UserPreference.SHOPPING: reverse_lazy('view_shopping'),}
return HttpResponseRedirect(page_map.get(request.user.userpreference.default_page))
except UserPreference.DoesNotExist:
@@ -446,7 +446,7 @@ def web_manifest(request):
theme_values['app_name'], "description":
_("Manage recipes, shopping list, meal plans and more."), "icons":
icons, "start_url":
"./search", "background_color":
"./", "background_color":
theme_values['nav_bg_color'], "display":
"standalone", "scope":
".", "theme_color":
@@ -454,7 +454,7 @@ def web_manifest(request):
[{"name": _("Plan"), "short_name": _("Plan"), "description": _("View your meal Plan"), "url":
"./plan"}, {"name": _("Books"), "short_name": _("Books"), "description": _("View your cookbooks"), "url": "./books"},
{"name": _("Shopping"), "short_name": _("Shopping"), "description": _("View your shopping lists"), "url":
"./list/shopping-list/"}], "share_target": {"action": "/data/import/url", "method": "GET", "params": {"title": "title", "url": "url", "text": "text"}}
"./shopping/"}], "share_target": {"action": "/data/import/url", "method": "GET", "params": {"title": "title", "url": "url", "text": "text"}}
}
return JsonResponse(manifest_info, json_dumps_params={'indent': 4})