From 63d358df36eb10618ab6bc0515d5350589302fe2 Mon Sep 17 00:00:00 2001
From: vabene1111
Date: Fri, 29 Aug 2025 13:08:16 +0200
Subject: [PATCH] indicate private reciesp
---
cookbook/serializer.py | 2 +-
.../components/display/PrivateRecipeBadge.vue | 27 +++++++++++++++++++
vue3/src/components/display/RecipeCard.vue | 5 ++++
vue3/src/components/display/RecipeView.vue | 4 +++
vue3/src/openapi/models/RecipeOverview.ts | 8 ++++++
5 files changed, 45 insertions(+), 1 deletion(-)
create mode 100644 vue3/src/components/display/PrivateRecipeBadge.vue
diff --git a/cookbook/serializer.py b/cookbook/serializer.py
index df6d4c117..353f76969 100644
--- a/cookbook/serializer.py
+++ b/cookbook/serializer.py
@@ -1038,7 +1038,7 @@ class RecipeOverviewSerializer(RecipeBaseSerializer):
fields = (
'id', 'name', 'description', 'image', 'keywords', 'working_time',
'waiting_time', 'created_by', 'created_at', 'updated_at',
- 'internal', 'servings', 'servings_text', 'rating', 'last_cooked', 'new', 'recent'
+ 'internal', 'private','servings', 'servings_text', 'rating', 'last_cooked', 'new', 'recent'
)
# TODO having these readonly fields makes "RecipeOverview.ts" (API Client) not generate the RecipeOverviewToJSON second else block which leads to errors when using the api
# TODO find a solution (custom schema?) to have these fields readonly (to save performance) and generate a proper client (two serializers would probably do the trick)
diff --git a/vue3/src/components/display/PrivateRecipeBadge.vue b/vue3/src/components/display/PrivateRecipeBadge.vue
new file mode 100644
index 000000000..2738d1e4c
--- /dev/null
+++ b/vue3/src/components/display/PrivateRecipeBadge.vue
@@ -0,0 +1,27 @@
+
+
+ {{ $t('Private_Recipe') }}
+ {{ u.displayName }}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vue3/src/components/display/RecipeCard.vue b/vue3/src/components/display/RecipeCard.vue
index e1c91df95..ab9229daa 100644
--- a/vue3/src/components/display/RecipeCard.vue
+++ b/vue3/src/components/display/RecipeCard.vue
@@ -19,6 +19,10 @@
+
+
+
+
{{ $t('External') }}
@@ -100,6 +104,7 @@ import {Recipe, RecipeOverview} from "@/openapi";
import RecipeContextMenu from "@/components/inputs/RecipeContextMenu.vue";
import RecipeImage from "@/components/display/RecipeImage.vue";
import {useRouter} from "vue-router";
+import PrivateRecipeBadge from "@/components/display/PrivateRecipeBadge.vue";
const props = defineProps({
recipe: {type: {} as PropType, required: true,},
diff --git a/vue3/src/components/display/RecipeView.vue b/vue3/src/components/display/RecipeView.vue
index 96b9d201a..296dd2511 100644
--- a/vue3/src/components/display/RecipeView.vue
+++ b/vue3/src/components/display/RecipeView.vue
@@ -28,6 +28,7 @@
+
{{ recipe.description }}
@@ -85,6 +86,8 @@
{{ recipe.description }}
+
+
@@ -204,6 +207,7 @@ import PropertyView from "@/components/display/PropertyView.vue";
import {useUserPreferenceStore} from "@/stores/UserPreferenceStore.ts";
import {ErrorMessageType, useMessageStore} from "@/stores/MessageStore.ts";
import {useFileApi} from "@/composables/useFileApi.ts";
+import PrivateRecipeBadge from "@/components/display/PrivateRecipeBadge.vue";
const {request, release} = useWakeLock()
const {doAiImport, fileApiLoading} = useFileApi()
diff --git a/vue3/src/openapi/models/RecipeOverview.ts b/vue3/src/openapi/models/RecipeOverview.ts
index 9fd72cf06..521e24ec5 100644
--- a/vue3/src/openapi/models/RecipeOverview.ts
+++ b/vue3/src/openapi/models/RecipeOverview.ts
@@ -98,6 +98,12 @@ export interface RecipeOverview {
* @memberof RecipeOverview
*/
readonly internal: boolean;
+ /**
+ *
+ * @type {boolean}
+ * @memberof RecipeOverview
+ */
+ _private?: boolean;
/**
*
* @type {number}
@@ -179,6 +185,7 @@ export function RecipeOverviewFromJSONTyped(json: any, ignoreDiscriminator: bool
'createdAt': (new Date(json['created_at'])),
'updatedAt': (new Date(json['updated_at'])),
'internal': json['internal'],
+ '_private': json['private'] == null ? undefined : json['private'],
'servings': json['servings'],
'servingsText': json['servings_text'],
'rating': json['rating'],
@@ -197,6 +204,7 @@ export function RecipeOverviewToJSON(value?: Omit