From 3e3780028b950ce16291118b85ef9fae01411b7e Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Thu, 19 Dec 2024 21:16:15 +0100 Subject: [PATCH] improved code quality of start page scrollers --- cookbook/templates/base.html | 326 ------------------ cookbook/views/views.py | 15 +- vue3/src/apps/tandoor/Tandoor.vue | 9 + .../display/HorizontalRecipeWindow.vue | 182 +++++++--- vue3/src/locales/ar.json | 1 + vue3/src/locales/bg.json | 1 + vue3/src/locales/ca.json | 1 + vue3/src/locales/cs.json | 1 + vue3/src/locales/da.json | 1 + vue3/src/locales/de.json | 1 + vue3/src/locales/el.json | 1 + vue3/src/locales/en.json | 1 + vue3/src/locales/es.json | 1 + vue3/src/locales/fi.json | 1 + vue3/src/locales/fr.json | 1 + vue3/src/locales/he.json | 1 + vue3/src/locales/hu.json | 1 + vue3/src/locales/hy.json | 1 + vue3/src/locales/id.json | 1 + vue3/src/locales/is.json | 1 + vue3/src/locales/it.json | 1 + vue3/src/locales/lt.json | 1 + vue3/src/locales/nb_NO.json | 1 + vue3/src/locales/nl.json | 1 + vue3/src/locales/pl.json | 1 + vue3/src/locales/pt.json | 1 + vue3/src/locales/pt_BR.json | 1 + vue3/src/locales/ro.json | 1 + vue3/src/locales/ru.json | 1 + vue3/src/locales/sl.json | 1 + vue3/src/locales/sv.json | 1 + vue3/src/locales/tr.json | 1 + vue3/src/locales/uk.json | 1 + vue3/src/locales/zh_Hans.json | 1 + vue3/src/locales/zh_Hant.json | 1 + vue3/src/pages/RecipeImportPage.vue | 2 +- vue3/src/pages/StartPage.vue | 84 ++--- 37 files changed, 201 insertions(+), 448 deletions(-) diff --git a/cookbook/templates/base.html b/cookbook/templates/base.html index 599a9c3380..b183365b19 100644 --- a/cookbook/templates/base.html +++ b/cookbook/templates/base.html @@ -50,29 +50,12 @@ - - {% block extra_head %} {% endblock %} - - @@ -93,317 +76,8 @@ aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation"> - - {% if request.user.userpreference.left_handed %} - {% if not request.user.is_authenticated or request.user.userpreference.nav_show_logo %} - - Logo - - {% endif %} - {% endif %} - - - -{% message_of_the_day request as message_of_the_day %} -{% if message_of_the_day %} -
- {{ message_of_the_day | markdown |safe }} -
-{% endif %} - -{% if HOSTED and request.space.max_recipes == 10 %} -
- {% trans 'You are using the free version of Tandoor' %} {% trans 'Upgrade Now' %} -
-{% endif %} -
diff --git a/cookbook/views/views.py b/cookbook/views/views.py index fbd9fbdc2b..f52d331fb6 100644 --- a/cookbook/views/views.py +++ b/cookbook/views/views.py @@ -34,25 +34,12 @@ def index(request): - return HttpResponseRedirect(reverse('vue3')) - with scopes_disabled(): if not request.user.is_authenticated: if User.objects.count() < 1 and 'django.contrib.auth.backends.RemoteUserBackend' not in settings.AUTHENTICATION_BACKENDS: return HttpResponseRedirect(reverse_lazy('view_setup')) - 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'), - UserPreference.SHOPPING: reverse_lazy('view_shopping'), - } - return HttpResponseRedirect(page_map.get(request.user.userpreference.default_page)) - except UserPreference.DoesNotExist: - return HttpResponseRedirect(reverse('view_search')) + return HttpResponseRedirect(reverse('vue3')) def search(request): diff --git a/vue3/src/apps/tandoor/Tandoor.vue b/vue3/src/apps/tandoor/Tandoor.vue index 90d1ee50d6..ccb93a05c7 100644 --- a/vue3/src/apps/tandoor/Tandoor.vue +++ b/vue3/src/apps/tandoor/Tandoor.vue @@ -6,6 +6,15 @@ + + + + + {{ $t('Create Recipe') }} + {{ $t('Import Recipe') }} + + + {{ useUserPreferenceStore().userSettings.user.displayName.charAt(0) }} diff --git a/vue3/src/components/display/HorizontalRecipeWindow.vue b/vue3/src/components/display/HorizontalRecipeWindow.vue index 612aa12335..6fbfa98e44 100644 --- a/vue3/src/components/display/HorizontalRecipeWindow.vue +++ b/vue3/src/components/display/HorizontalRecipeWindow.vue @@ -1,71 +1,159 @@