From 0461c57cf338e56ecd801dd46690b6e0d6c4f2ce Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Sat, 15 Feb 2025 09:50:40 +0100 Subject: [PATCH] usable books page --- cookbook/admin.py | 9 +- vue3/src/components/display/BookEntryCard.vue | 58 ++++++++++++ .../components/display/IngredientsTable.vue | 6 +- vue3/src/pages/BookViewPage.vue | 91 ++++++++++++++----- vue3/src/utils/model_utils.ts | 37 ++++++-- 5 files changed, 170 insertions(+), 31 deletions(-) create mode 100644 vue3/src/components/display/BookEntryCard.vue diff --git a/cookbook/admin.py b/cookbook/admin.py index 32af3e5a2..f6213783e 100644 --- a/cookbook/admin.py +++ b/cookbook/admin.py @@ -10,7 +10,7 @@ from treebeard.forms import movenodeform_factory from cookbook.managers import DICTIONARY -from .models import (BookmarkletImport, Comment, CookLog, Food, ImportLog, Ingredient, InviteLink, +from .models import (BookmarkletImport, Comment, CookLog, CustomFilter, Food, ImportLog, Ingredient, InviteLink, Keyword, MealPlan, MealType, NutritionInformation, Property, PropertyType, Recipe, RecipeBook, RecipeBookEntry, RecipeImport, SearchPreference, ShareLink, ShoppingListEntry, ShoppingListRecipe, Space, Step, Storage, @@ -103,6 +103,13 @@ class ConnectorConfigAdmin(admin.ModelAdmin): admin.site.register(ConnectorConfig, ConnectorConfigAdmin) +class CustomFilterAdmin(admin.ModelAdmin): + list_display = ('id', 'type', 'name') + + +admin.site.register(CustomFilter, CustomFilterAdmin) + + class SyncAdmin(admin.ModelAdmin): list_display = ('storage', 'path', 'active', 'last_checked') search_fields = ('storage__name', 'path') diff --git a/vue3/src/components/display/BookEntryCard.vue b/vue3/src/components/display/BookEntryCard.vue new file mode 100644 index 000000000..d38a6aaa9 --- /dev/null +++ b/vue3/src/components/display/BookEntryCard.vue @@ -0,0 +1,58 @@ + + + + + + \ No newline at end of file diff --git a/vue3/src/components/display/IngredientsTable.vue b/vue3/src/components/display/IngredientsTable.vue index 3ec583c77..944df01b1 100644 --- a/vue3/src/components/display/IngredientsTable.vue +++ b/vue3/src/components/display/IngredientsTable.vue @@ -33,7 +33,7 @@ {{ i.note }}