diff --git a/cookbook/serializer.py b/cookbook/serializer.py
index 03f56c53e5..b348ae473b 100644
--- a/cookbook/serializer.py
+++ b/cookbook/serializer.py
@@ -199,7 +199,7 @@ def get_user_label(self, obj):
class Meta:
list_serializer_class = SpaceFilterSerializer
model = User
- fields = ('id', 'username', 'first_name', 'last_name', 'display_name')
+ fields = ('id', 'username', 'first_name', 'last_name', 'display_name', 'is_staff', 'is_superuser', 'is_active')
read_only_fields = ('username',)
@@ -1294,7 +1294,12 @@ class ViewLogSerializer(serializers.ModelSerializer):
def create(self, validated_data):
validated_data['created_by'] = self.context['request'].user
validated_data['space'] = self.context['request'].space
- return super().create(validated_data)
+
+ view_log = ViewLog.objects.filter(recipe=validated_data['recipe'], created_by=self.context['request'].user, created_at__gt=(timezone.now() - timezone.timedelta(minutes=5)), space=self.context['request'].space).first()
+ if not view_log:
+ view_log = ViewLog.objects.create(recipe=validated_data['recipe'], created_by=self.context['request'].user, space=self.context['request'].space)
+
+ return view_log
class Meta:
model = ViewLog
diff --git a/cookbook/views/api.py b/cookbook/views/api.py
index f991db85e5..e3b8221267 100644
--- a/cookbook/views/api.py
+++ b/cookbook/views/api.py
@@ -1121,6 +1121,8 @@ def get_paginated_response(self, data):
description=_('Returns the results in randomized order. [''true''/''false'']')),
OpenApiParameter(name='new',
description=_('Returns new results first in search results. [''true''/''false'']')),
+ OpenApiParameter(name='num_recent', description=_(
+ 'Returns the given number of recently viewed recipes before search results (if given)'), type=int),
OpenApiParameter(name='timescooked', description=_(
'Filter recipes cooked X times or more. Negative values returns cooked less than X times'), type=int),
OpenApiParameter(
diff --git a/vue3/src/apps/tandoor/Tandoor.vue b/vue3/src/apps/tandoor/Tandoor.vue
index 6ca9214168..0eba137f43 100644
--- a/vue3/src/apps/tandoor/Tandoor.vue
+++ b/vue3/src/apps/tandoor/Tandoor.vue
@@ -62,6 +62,12 @@
{{ $t('Messages') }}
+
+
+
+
+ {{ $t('Admin') }}
+
diff --git a/vue3/src/components/display/HorizontalRecipeWindow.vue b/vue3/src/components/display/HorizontalRecipeWindow.vue
index 0b7a7a1de2..f07a09bd91 100644
--- a/vue3/src/components/display/HorizontalRecipeWindow.vue
+++ b/vue3/src/components/display/HorizontalRecipeWindow.vue
@@ -44,6 +44,7 @@ import {DisplayBreakpoint, useDisplay} from "vuetify";
import {ApiApi, ApiRecipeListRequest, Keyword, Recipe, RecipeOverview} from "@/openapi";
import {homePageCols} from "@/utils/breakpoint_utils";
import {useI18n} from "vue-i18n";
+import {DateTime} from "luxon";
//TODO mode ideas "last year/month/cooked long ago"
const props = defineProps(
@@ -116,7 +117,7 @@ function loadRecipes() {
switch (props.mode) {
case 'recent':
// TODO implement correct parameter
- requestParameters._new = 'true'
+ requestParameters.numRecent = 16
break;
case 'new':
requestParameters._new = 'true'
@@ -147,7 +148,13 @@ function doRecipeRequest(params: ApiRecipeListRequest) {
let api = new ApiApi()
api.apiRecipeList(params).then((r) => {
- recipes.value = r.results
+ if (props.mode == 'new') {
+ recipes.value = r.results.filter(r => r._new)
+ } else if (props.mode == 'recent') {
+ recipes.value = r.results.filter(r => r.recent != "0")
+ } else {
+ recipes.value = r.results
+ }
}).finally(() => {
loading.value = false
})
diff --git a/vue3/src/locales/ar.json b/vue3/src/locales/ar.json
index d9b5c0d673..1ab7ff021c 100644
--- a/vue3/src/locales/ar.json
+++ b/vue3/src/locales/ar.json
@@ -15,6 +15,7 @@
"Added_To_Shopping_List": "",
"Added_by": "",
"Added_on": "",
+ "Admin": "",
"Advanced": "",
"App": "",
"Are_You_Sure": "",
diff --git a/vue3/src/locales/bg.json b/vue3/src/locales/bg.json
index 3ee9511f04..67fa542872 100644
--- a/vue3/src/locales/bg.json
+++ b/vue3/src/locales/bg.json
@@ -15,6 +15,7 @@
"Added_To_Shopping_List": "Добавено към списъка за пазаруване",
"Added_by": "Добавено от",
"Added_on": "Добавено",
+ "Admin": "",
"Advanced": "Разширено",
"App": "Приложение",
"Are_You_Sure": "Сигурен ли си?",
diff --git a/vue3/src/locales/ca.json b/vue3/src/locales/ca.json
index c962163359..798b4e834a 100644
--- a/vue3/src/locales/ca.json
+++ b/vue3/src/locales/ca.json
@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "",
"Added_by": "",
"Added_on": "",
+ "Admin": "",
"Advanced": "",
"Alignment": "",
"Amount": "Quantitat",
diff --git a/vue3/src/locales/cs.json b/vue3/src/locales/cs.json
index 4c27458325..a62450d878 100644
--- a/vue3/src/locales/cs.json
+++ b/vue3/src/locales/cs.json
@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "Přidáno na nákupní seznam",
"Added_by": "Přidáno uživatelem",
"Added_on": "Přidáno v",
+ "Admin": "",
"Advanced": "Rozšířené",
"Alignment": "Zarovnání",
"Amount": "Množství",
diff --git a/vue3/src/locales/da.json b/vue3/src/locales/da.json
index 1d022ec5fc..9741d8b26f 100644
--- a/vue3/src/locales/da.json
+++ b/vue3/src/locales/da.json
@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "Tilføjet til indkøbslisten",
"Added_by": "Tilføjet af",
"Added_on": "Tilføjet den",
+ "Admin": "",
"Advanced": "Avanceret",
"Alignment": "Justering",
"Amount": "Mængde",
diff --git a/vue3/src/locales/de.json b/vue3/src/locales/de.json
index 68ec43420d..a43fb9b016 100644
--- a/vue3/src/locales/de.json
+++ b/vue3/src/locales/de.json
@@ -18,6 +18,7 @@
"Added_To_Shopping_List": "Zur Einkaufsliste hinzugefügt",
"Added_by": "Hinzugefügt durch",
"Added_on": "Hinzugefügt am",
+ "Admin": "Admin",
"Advanced": "Erweitert",
"Alignment": "Ausrichtung",
"Amount": "Menge",
diff --git a/vue3/src/locales/el.json b/vue3/src/locales/el.json
index 1e212f61b4..65ac4d7ede 100644
--- a/vue3/src/locales/el.json
+++ b/vue3/src/locales/el.json
@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "Προστέθηκε στη λίστα αγορών",
"Added_by": "Προστέθηκε από",
"Added_on": "Προστέθηκε στις",
+ "Admin": "",
"Advanced": "Για προχωρημένους",
"Amount": "Ποσότητα",
"App": "Εφαρμογή",
diff --git a/vue3/src/locales/en.json b/vue3/src/locales/en.json
index 0a0764c096..8a8c726eed 100644
--- a/vue3/src/locales/en.json
+++ b/vue3/src/locales/en.json
@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "Added to shopping list",
"Added_by": "Added By",
"Added_on": "Added On",
+ "Admin": "Admin",
"Advanced": "Advanced",
"Alignment": "Alignment",
"Amount": "Amount",
diff --git a/vue3/src/locales/es.json b/vue3/src/locales/es.json
index ed02d6f9f1..fbd3de442d 100644
--- a/vue3/src/locales/es.json
+++ b/vue3/src/locales/es.json
@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "Añadido a la lista de la compra",
"Added_by": "Añadido por",
"Added_on": "Añadido el",
+ "Admin": "",
"Advanced": "Avanzado",
"Alignment": "Alineación",
"Amount": "Cantidad",
diff --git a/vue3/src/locales/fi.json b/vue3/src/locales/fi.json
index 6d070169f7..bfd1a6fae9 100644
--- a/vue3/src/locales/fi.json
+++ b/vue3/src/locales/fi.json
@@ -10,6 +10,7 @@
"Add_to_Plan": "Lisää suunnitelmaan",
"Add_to_Shopping": "Lisää ostoksiin",
"Added_To_Shopping_List": "Lisätty ostoslistaan",
+ "Admin": "",
"Advanced Search Settings": "Tarkennetun Haun Asetukset",
"Auto_Planner": "Automaattinen Suunnittelija",
"Automate": "Automatisoi",
diff --git a/vue3/src/locales/fr.json b/vue3/src/locales/fr.json
index c7c8d8b979..2d8828dfa2 100644
--- a/vue3/src/locales/fr.json
+++ b/vue3/src/locales/fr.json
@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "Ajouté à la liste de courses",
"Added_by": "Ajouté par",
"Added_on": "Ajouté le",
+ "Admin": "",
"Advanced": "Avancé",
"Advanced Search Settings": "Paramètres de recherche avancée",
"Alignment": "Alignement",
diff --git a/vue3/src/locales/he.json b/vue3/src/locales/he.json
index 726dd1f755..d6539e2a42 100644
--- a/vue3/src/locales/he.json
+++ b/vue3/src/locales/he.json
@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "נוסף לרשימת הקניות",
"Added_by": "נוסף ע\"י",
"Added_on": "נוסף ב",
+ "Admin": "",
"Advanced": "מתקדם",
"Alignment": "יישור",
"Amount": "כמות",
diff --git a/vue3/src/locales/hu.json b/vue3/src/locales/hu.json
index d07a6d2323..4346f0fb3d 100644
--- a/vue3/src/locales/hu.json
+++ b/vue3/src/locales/hu.json
@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "Hozzáadva a bevásárlólistához",
"Added_by": "Hozzádta",
"Added_on": "Hozzáadva",
+ "Admin": "",
"Advanced": "Haladó",
"Alignment": "Igazítás",
"Amount": "Összeg",
diff --git a/vue3/src/locales/hy.json b/vue3/src/locales/hy.json
index 50c78b7f4c..907f590252 100644
--- a/vue3/src/locales/hy.json
+++ b/vue3/src/locales/hy.json
@@ -9,6 +9,7 @@
"Add_to_Book": "",
"Add_to_Plan": "Ավելացնել պլանին",
"Add_to_Shopping": "Ավելացնել գնումներին",
+ "Admin": "",
"Advanced Search Settings": "Ընդլայնված փնտրման կարգավորումներ",
"Automate": "Ավտոմատացնել",
"Available": "",
diff --git a/vue3/src/locales/id.json b/vue3/src/locales/id.json
index 5afc5b1742..b10c5a5c79 100644
--- a/vue3/src/locales/id.json
+++ b/vue3/src/locales/id.json
@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "",
"Added_by": "",
"Added_on": "",
+ "Admin": "",
"Advanced": "",
"App": "",
"Are_You_Sure": "",
diff --git a/vue3/src/locales/is.json b/vue3/src/locales/is.json
index 3201733ed1..3d6fcb99ad 100644
--- a/vue3/src/locales/is.json
+++ b/vue3/src/locales/is.json
@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "",
"Added_by": "",
"Added_on": "",
+ "Admin": "",
"Advanced": "",
"Alignment": "",
"Amount": "",
diff --git a/vue3/src/locales/it.json b/vue3/src/locales/it.json
index b5171b18e4..c83326933e 100644
--- a/vue3/src/locales/it.json
+++ b/vue3/src/locales/it.json
@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "Aggiunto alla lista della spesa",
"Added_by": "Aggiunto da",
"Added_on": "Aggiunto il",
+ "Admin": "",
"Advanced": "Avanzate",
"Advanced Search Settings": "Impostazioni avanzate di ricerca",
"Amount": "Quantità",
diff --git a/vue3/src/locales/lt.json b/vue3/src/locales/lt.json
index dacac2a274..5b14869b61 100644
--- a/vue3/src/locales/lt.json
+++ b/vue3/src/locales/lt.json
@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "",
"Added_by": "",
"Added_on": "",
+ "Admin": "",
"Advanced": "",
"Alignment": "",
"Amount": "Suma",
diff --git a/vue3/src/locales/nb_NO.json b/vue3/src/locales/nb_NO.json
index 307e964cba..3439ff899d 100644
--- a/vue3/src/locales/nb_NO.json
+++ b/vue3/src/locales/nb_NO.json
@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "Lagt til i handlelisten",
"Added_by": "Lagt til av",
"Added_on": "Lagt til",
+ "Admin": "",
"Advanced": "Avansert",
"Alignment": "Justering",
"Amount": "Mengde",
diff --git a/vue3/src/locales/nl.json b/vue3/src/locales/nl.json
index 6905ea8183..e49d3a6b8e 100644
--- a/vue3/src/locales/nl.json
+++ b/vue3/src/locales/nl.json
@@ -18,6 +18,7 @@
"Added_To_Shopping_List": "Toegevoegd aan boodschappenlijst",
"Added_by": "Toegevoegd door",
"Added_on": "Toegevoegd op",
+ "Admin": "",
"Advanced": "Geavanceerd",
"Advanced Search Settings": "Geavanceerde zoekinstellingen",
"Amount": "Hoeveelheid",
diff --git a/vue3/src/locales/pl.json b/vue3/src/locales/pl.json
index 7a0b6f6fdc..35a112721c 100644
--- a/vue3/src/locales/pl.json
+++ b/vue3/src/locales/pl.json
@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "Dodano do listy zakupów",
"Added_by": "Dodane przez",
"Added_on": "Dodano dnia",
+ "Admin": "",
"Advanced": "Zaawansowany",
"Advanced Search Settings": "Ustawienia zaawansowanego wyszukiwania",
"Alignment": "Wyrównanie",
diff --git a/vue3/src/locales/pt.json b/vue3/src/locales/pt.json
index 6cea7ea9c9..19d4818c05 100644
--- a/vue3/src/locales/pt.json
+++ b/vue3/src/locales/pt.json
@@ -15,6 +15,7 @@
"Added_To_Shopping_List": "Adicionado à lista de compras",
"Added_by": "Adicionado por",
"Added_on": "Adicionado a",
+ "Admin": "",
"Advanced": "Avançado",
"Amount": "Quantidade",
"Auto_Planner": "",
diff --git a/vue3/src/locales/pt_BR.json b/vue3/src/locales/pt_BR.json
index 91df6002f6..2263acd151 100644
--- a/vue3/src/locales/pt_BR.json
+++ b/vue3/src/locales/pt_BR.json
@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "Incluído na lista de compras",
"Added_by": "Incluído Por",
"Added_on": "Incluído Em",
+ "Admin": "",
"Advanced": "Avançado",
"Alignment": "Alinhamento",
"Amount": "Quantidade",
diff --git a/vue3/src/locales/ro.json b/vue3/src/locales/ro.json
index b38958cb6d..4fd32070bf 100644
--- a/vue3/src/locales/ro.json
+++ b/vue3/src/locales/ro.json
@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "Adăugat la lista de cumpărături",
"Added_by": "Adăugat de",
"Added_on": "Adăugat la",
+ "Admin": "",
"Advanced": "Avansat",
"Advanced Search Settings": "",
"Amount": "Cantitate",
diff --git a/vue3/src/locales/ru.json b/vue3/src/locales/ru.json
index 746956231c..ed7cc03307 100644
--- a/vue3/src/locales/ru.json
+++ b/vue3/src/locales/ru.json
@@ -15,6 +15,7 @@
"Added_To_Shopping_List": "Добавлено в список покупок",
"Added_by": "Добавлено",
"Added_on": "Добавлено на",
+ "Admin": "",
"Advanced": "Расширенный",
"Advanced Search Settings": "",
"Are_You_Sure": "Вы уверены?",
diff --git a/vue3/src/locales/sl.json b/vue3/src/locales/sl.json
index 3d9f49410c..f75eb384ed 100644
--- a/vue3/src/locales/sl.json
+++ b/vue3/src/locales/sl.json
@@ -13,6 +13,7 @@
"Add_to_Shopping": "Dodaj v nakupovalni listek",
"Added_To_Shopping_List": "Dodano v nakupovalni listek",
"Added_by": "Dodano s strani",
+ "Admin": "",
"Advanced Search Settings": "",
"Amount": "Količina",
"Auto_Planner": "Avto-planer",
diff --git a/vue3/src/locales/sv.json b/vue3/src/locales/sv.json
index 148b797108..a948409880 100644
--- a/vue3/src/locales/sv.json
+++ b/vue3/src/locales/sv.json
@@ -18,6 +18,7 @@
"Added_To_Shopping_List": "Lades till i inköpslistan",
"Added_by": "Tillagd av",
"Added_on": "Tillagd på",
+ "Admin": "",
"Advanced": "Avancerat",
"Alignment": "Orientering",
"Amount": "Mängd",
diff --git a/vue3/src/locales/tr.json b/vue3/src/locales/tr.json
index 8f192735ca..eafe98dabc 100644
--- a/vue3/src/locales/tr.json
+++ b/vue3/src/locales/tr.json
@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "Alışveriş listesine eklendi",
"Added_by": "Ekleyen",
"Added_on": "Eklenme Zamanı",
+ "Admin": "",
"Advanced": "Gelişmiş",
"Alignment": "Hizalama",
"Amount": "Miktar",
diff --git a/vue3/src/locales/uk.json b/vue3/src/locales/uk.json
index 0eb3d887a1..0fe5ff0852 100644
--- a/vue3/src/locales/uk.json
+++ b/vue3/src/locales/uk.json
@@ -15,6 +15,7 @@
"Added_To_Shopping_List": "Додано до списку покупок",
"Added_by": "Додано",
"Added_on": "Додано На",
+ "Admin": "",
"Advanced": "",
"Amount": "Кількість",
"App": "",
diff --git a/vue3/src/locales/zh_Hans.json b/vue3/src/locales/zh_Hans.json
index a051260e5a..d523e52c85 100644
--- a/vue3/src/locales/zh_Hans.json
+++ b/vue3/src/locales/zh_Hans.json
@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "添加到购物清单",
"Added_by": "添加者",
"Added_on": "添加到",
+ "Admin": "",
"Advanced": "高级",
"Alignment": "校准",
"Amount": "数量",
diff --git a/vue3/src/locales/zh_Hant.json b/vue3/src/locales/zh_Hant.json
index 77b49d19c0..8e7dc9077d 100644
--- a/vue3/src/locales/zh_Hant.json
+++ b/vue3/src/locales/zh_Hant.json
@@ -8,6 +8,7 @@
"Add_nutrition_recipe": "為食譜添加營養資訊",
"Add_to_Plan": "加入計劃",
"Add_to_Shopping": "加入購物清單",
+ "Admin": "",
"Available": "",
"AvailableCategories": "",
"BaseUnit": "",
diff --git a/vue3/src/openapi/apis/ApiApi.ts b/vue3/src/openapi/apis/ApiApi.ts
index 176b536d41..37ccc57307 100644
--- a/vue3/src/openapi/apis/ApiApi.ts
+++ b/vue3/src/openapi/apis/ApiApi.ts
@@ -1201,6 +1201,7 @@ export interface ApiRecipeListRequest {
keywordsOrNot?: Array;
makenow?: boolean;
_new?: string;
+ numRecent?: number;
page?: number;
pageSize?: number;
query?: string;
@@ -8763,6 +8764,10 @@ export class ApiApi extends runtime.BaseAPI {
queryParameters['new'] = requestParameters['_new'];
}
+ if (requestParameters['numRecent'] != null) {
+ queryParameters['num_recent'] = requestParameters['numRecent'];
+ }
+
if (requestParameters['page'] != null) {
queryParameters['page'] = requestParameters['page'];
}
diff --git a/vue3/src/openapi/models/PatchedUser.ts b/vue3/src/openapi/models/PatchedUser.ts
index f15c386dda..934633e26b 100644
--- a/vue3/src/openapi/models/PatchedUser.ts
+++ b/vue3/src/openapi/models/PatchedUser.ts
@@ -49,6 +49,24 @@ export interface PatchedUser {
* @memberof PatchedUser
*/
readonly displayName?: string;
+ /**
+ * Designates whether the user can log into this admin site.
+ * @type {boolean}
+ * @memberof PatchedUser
+ */
+ isStaff?: boolean;
+ /**
+ * Designates that this user has all permissions without explicitly assigning them.
+ * @type {boolean}
+ * @memberof PatchedUser
+ */
+ isSuperuser?: boolean;
+ /**
+ * Designates whether this user should be treated as active. Unselect this instead of deleting accounts.
+ * @type {boolean}
+ * @memberof PatchedUser
+ */
+ isActive?: boolean;
}
/**
@@ -73,6 +91,9 @@ export function PatchedUserFromJSONTyped(json: any, ignoreDiscriminator: boolean
'firstName': json['first_name'] == null ? undefined : json['first_name'],
'lastName': json['last_name'] == null ? undefined : json['last_name'],
'displayName': json['display_name'] == null ? undefined : json['display_name'],
+ 'isStaff': json['is_staff'] == null ? undefined : json['is_staff'],
+ 'isSuperuser': json['is_superuser'] == null ? undefined : json['is_superuser'],
+ 'isActive': json['is_active'] == null ? undefined : json['is_active'],
};
}
@@ -90,6 +111,9 @@ export function PatchedUserToJSONTyped(value?: Omit |
'id': value['id'],
'first_name': value['firstName'],
'last_name': value['lastName'],
+ 'is_staff': value['isStaff'],
+ 'is_superuser': value['isSuperuser'],
+ 'is_active': value['isActive'],
};
}
diff --git a/vue3/src/pages/RecipeViewPage.vue b/vue3/src/pages/RecipeViewPage.vue
index 6e52bcb98b..399776f981 100644
--- a/vue3/src/pages/RecipeViewPage.vue
+++ b/vue3/src/pages/RecipeViewPage.vue
@@ -7,7 +7,7 @@
diff --git a/vue3/src/pages/SettingsPage.vue b/vue3/src/pages/SettingsPage.vue
index 5c2dbac83e..2bb4f60f43 100644
--- a/vue3/src/pages/SettingsPage.vue
+++ b/vue3/src/pages/SettingsPage.vue
@@ -10,7 +10,7 @@
{{ $t('Cosmetic') }}
{{ $t('Shopping_list') }}
{{ $t('Meal_Plan') }}
-
+ {{ $t('Search') }}
Space
{{ $t('YourSpaces') }}
diff --git a/vue3/src/pages/StartPage.vue b/vue3/src/pages/StartPage.vue
index 9dfe2a6823..c279d446a5 100644
--- a/vue3/src/pages/StartPage.vue
+++ b/vue3/src/pages/StartPage.vue
@@ -12,8 +12,9 @@
-
+
+