improved startpage

This commit is contained in:
vabene1111
2025-01-03 22:14:38 +01:00
parent 9eca4673cd
commit dc58b42f68
41 changed files with 118 additions and 7 deletions

View File

@@ -199,7 +199,7 @@ class UserSerializer(WritableNestedModelSerializer):
class Meta: class Meta:
list_serializer_class = SpaceFilterSerializer list_serializer_class = SpaceFilterSerializer
model = User 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',) read_only_fields = ('username',)
@@ -1294,7 +1294,12 @@ class ViewLogSerializer(serializers.ModelSerializer):
def create(self, validated_data): def create(self, validated_data):
validated_data['created_by'] = self.context['request'].user validated_data['created_by'] = self.context['request'].user
validated_data['space'] = self.context['request'].space 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: class Meta:
model = ViewLog model = ViewLog

View File

@@ -1121,6 +1121,8 @@ class RecipePagination(PageNumberPagination):
description=_('Returns the results in randomized order. [''true''/''<b>false</b>'']')), description=_('Returns the results in randomized order. [''true''/''<b>false</b>'']')),
OpenApiParameter(name='new', OpenApiParameter(name='new',
description=_('Returns new results first in search results. [''true''/''<b>false</b>'']')), description=_('Returns new results first in search results. [''true''/''<b>false</b>'']')),
OpenApiParameter(name='num_recent', description=_(
'Returns the given number of recently viewed recipes before search results (if given)'), type=int),
OpenApiParameter(name='timescooked', description=_( OpenApiParameter(name='timescooked', description=_(
'Filter recipes cooked X times or more. Negative values returns cooked less than X times'), type=int), 'Filter recipes cooked X times or more. Negative values returns cooked less than X times'), type=int),
OpenApiParameter( OpenApiParameter(

View File

@@ -62,6 +62,12 @@
{{ $t('Messages') }} {{ $t('Messages') }}
<message-list-dialog></message-list-dialog> <message-list-dialog></message-list-dialog>
</v-list-item> </v-list-item>
<v-list-item :href="getDjangoUrl('admin')" target="_blank" v-if="useUserPreferenceStore().userSettings.user.isSuperuser">
<template #prepend>
<v-icon icon="fa-solid fa-shield"></v-icon>
</template>
{{ $t('Admin') }}
</v-list-item>
<v-list-item :href="getDjangoUrl('accounts/logout')" link> <v-list-item :href="getDjangoUrl('accounts/logout')" link>
<template #prepend> <template #prepend>
<v-icon icon="fa-solid fa-arrow-right-from-bracket"></v-icon> <v-icon icon="fa-solid fa-arrow-right-from-bracket"></v-icon>

View File

@@ -44,6 +44,7 @@ import {DisplayBreakpoint, useDisplay} from "vuetify";
import {ApiApi, ApiRecipeListRequest, Keyword, Recipe, RecipeOverview} from "@/openapi"; import {ApiApi, ApiRecipeListRequest, Keyword, Recipe, RecipeOverview} from "@/openapi";
import {homePageCols} from "@/utils/breakpoint_utils"; import {homePageCols} from "@/utils/breakpoint_utils";
import {useI18n} from "vue-i18n"; import {useI18n} from "vue-i18n";
import {DateTime} from "luxon";
//TODO mode ideas "last year/month/cooked long ago" //TODO mode ideas "last year/month/cooked long ago"
const props = defineProps( const props = defineProps(
@@ -116,7 +117,7 @@ function loadRecipes() {
switch (props.mode) { switch (props.mode) {
case 'recent': case 'recent':
// TODO implement correct parameter // TODO implement correct parameter
requestParameters._new = 'true' requestParameters.numRecent = 16
break; break;
case 'new': case 'new':
requestParameters._new = 'true' requestParameters._new = 'true'
@@ -147,7 +148,13 @@ function doRecipeRequest(params: ApiRecipeListRequest) {
let api = new ApiApi() let api = new ApiApi()
api.apiRecipeList(params).then((r) => { 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(() => { }).finally(() => {
loading.value = false loading.value = false
}) })

View File

@@ -15,6 +15,7 @@
"Added_To_Shopping_List": "", "Added_To_Shopping_List": "",
"Added_by": "", "Added_by": "",
"Added_on": "", "Added_on": "",
"Admin": "",
"Advanced": "", "Advanced": "",
"App": "", "App": "",
"Are_You_Sure": "", "Are_You_Sure": "",

View File

@@ -15,6 +15,7 @@
"Added_To_Shopping_List": "Добавено към списъка за пазаруване", "Added_To_Shopping_List": "Добавено към списъка за пазаруване",
"Added_by": "Добавено от", "Added_by": "Добавено от",
"Added_on": "Добавено", "Added_on": "Добавено",
"Admin": "",
"Advanced": "Разширено", "Advanced": "Разширено",
"App": "Приложение", "App": "Приложение",
"Are_You_Sure": "Сигурен ли си?", "Are_You_Sure": "Сигурен ли си?",

View File

@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "", "Added_To_Shopping_List": "",
"Added_by": "", "Added_by": "",
"Added_on": "", "Added_on": "",
"Admin": "",
"Advanced": "", "Advanced": "",
"Alignment": "", "Alignment": "",
"Amount": "Quantitat", "Amount": "Quantitat",

View File

@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "Přidáno na nákupní seznam", "Added_To_Shopping_List": "Přidáno na nákupní seznam",
"Added_by": "Přidáno uživatelem", "Added_by": "Přidáno uživatelem",
"Added_on": "Přidáno v", "Added_on": "Přidáno v",
"Admin": "",
"Advanced": "Rozšířené", "Advanced": "Rozšířené",
"Alignment": "Zarovnání", "Alignment": "Zarovnání",
"Amount": "Množství", "Amount": "Množství",

View File

@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "Tilføjet til indkøbslisten", "Added_To_Shopping_List": "Tilføjet til indkøbslisten",
"Added_by": "Tilføjet af", "Added_by": "Tilføjet af",
"Added_on": "Tilføjet den", "Added_on": "Tilføjet den",
"Admin": "",
"Advanced": "Avanceret", "Advanced": "Avanceret",
"Alignment": "Justering", "Alignment": "Justering",
"Amount": "Mængde", "Amount": "Mængde",

View File

@@ -18,6 +18,7 @@
"Added_To_Shopping_List": "Zur Einkaufsliste hinzugefügt", "Added_To_Shopping_List": "Zur Einkaufsliste hinzugefügt",
"Added_by": "Hinzugefügt durch", "Added_by": "Hinzugefügt durch",
"Added_on": "Hinzugefügt am", "Added_on": "Hinzugefügt am",
"Admin": "Admin",
"Advanced": "Erweitert", "Advanced": "Erweitert",
"Alignment": "Ausrichtung", "Alignment": "Ausrichtung",
"Amount": "Menge", "Amount": "Menge",

View File

@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "Προστέθηκε στη λίστα αγορών", "Added_To_Shopping_List": "Προστέθηκε στη λίστα αγορών",
"Added_by": "Προστέθηκε από", "Added_by": "Προστέθηκε από",
"Added_on": "Προστέθηκε στις", "Added_on": "Προστέθηκε στις",
"Admin": "",
"Advanced": "Για προχωρημένους", "Advanced": "Για προχωρημένους",
"Amount": "Ποσότητα", "Amount": "Ποσότητα",
"App": "Εφαρμογή", "App": "Εφαρμογή",

View File

@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "Added to shopping list", "Added_To_Shopping_List": "Added to shopping list",
"Added_by": "Added By", "Added_by": "Added By",
"Added_on": "Added On", "Added_on": "Added On",
"Admin": "Admin",
"Advanced": "Advanced", "Advanced": "Advanced",
"Alignment": "Alignment", "Alignment": "Alignment",
"Amount": "Amount", "Amount": "Amount",

View File

@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "Añadido a la lista de la compra", "Added_To_Shopping_List": "Añadido a la lista de la compra",
"Added_by": "Añadido por", "Added_by": "Añadido por",
"Added_on": "Añadido el", "Added_on": "Añadido el",
"Admin": "",
"Advanced": "Avanzado", "Advanced": "Avanzado",
"Alignment": "Alineación", "Alignment": "Alineación",
"Amount": "Cantidad", "Amount": "Cantidad",

View File

@@ -10,6 +10,7 @@
"Add_to_Plan": "Lisää suunnitelmaan", "Add_to_Plan": "Lisää suunnitelmaan",
"Add_to_Shopping": "Lisää ostoksiin", "Add_to_Shopping": "Lisää ostoksiin",
"Added_To_Shopping_List": "Lisätty ostoslistaan", "Added_To_Shopping_List": "Lisätty ostoslistaan",
"Admin": "",
"Advanced Search Settings": "Tarkennetun Haun Asetukset", "Advanced Search Settings": "Tarkennetun Haun Asetukset",
"Auto_Planner": "Automaattinen Suunnittelija", "Auto_Planner": "Automaattinen Suunnittelija",
"Automate": "Automatisoi", "Automate": "Automatisoi",

View File

@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "Ajouté à la liste de courses", "Added_To_Shopping_List": "Ajouté à la liste de courses",
"Added_by": "Ajouté par", "Added_by": "Ajouté par",
"Added_on": "Ajouté le", "Added_on": "Ajouté le",
"Admin": "",
"Advanced": "Avancé", "Advanced": "Avancé",
"Advanced Search Settings": "Paramètres de recherche avancée", "Advanced Search Settings": "Paramètres de recherche avancée",
"Alignment": "Alignement", "Alignment": "Alignement",

View File

@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "נוסף לרשימת הקניות", "Added_To_Shopping_List": "נוסף לרשימת הקניות",
"Added_by": "נוסף ע\"י", "Added_by": "נוסף ע\"י",
"Added_on": "נוסף ב", "Added_on": "נוסף ב",
"Admin": "",
"Advanced": "מתקדם", "Advanced": "מתקדם",
"Alignment": "יישור", "Alignment": "יישור",
"Amount": "כמות", "Amount": "כמות",

View File

@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "Hozzáadva a bevásárlólistához", "Added_To_Shopping_List": "Hozzáadva a bevásárlólistához",
"Added_by": "Hozzádta", "Added_by": "Hozzádta",
"Added_on": "Hozzáadva", "Added_on": "Hozzáadva",
"Admin": "",
"Advanced": "Haladó", "Advanced": "Haladó",
"Alignment": "Igazítás", "Alignment": "Igazítás",
"Amount": "Összeg", "Amount": "Összeg",

View File

@@ -9,6 +9,7 @@
"Add_to_Book": "", "Add_to_Book": "",
"Add_to_Plan": "Ավելացնել պլանին", "Add_to_Plan": "Ավելացնել պլանին",
"Add_to_Shopping": "Ավելացնել գնումներին", "Add_to_Shopping": "Ավելացնել գնումներին",
"Admin": "",
"Advanced Search Settings": "Ընդլայնված փնտրման կարգավորումներ", "Advanced Search Settings": "Ընդլայնված փնտրման կարգավորումներ",
"Automate": "Ավտոմատացնել", "Automate": "Ավտոմատացնել",
"Available": "", "Available": "",

View File

@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "", "Added_To_Shopping_List": "",
"Added_by": "", "Added_by": "",
"Added_on": "", "Added_on": "",
"Admin": "",
"Advanced": "", "Advanced": "",
"App": "", "App": "",
"Are_You_Sure": "", "Are_You_Sure": "",

View File

@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "", "Added_To_Shopping_List": "",
"Added_by": "", "Added_by": "",
"Added_on": "", "Added_on": "",
"Admin": "",
"Advanced": "", "Advanced": "",
"Alignment": "", "Alignment": "",
"Amount": "", "Amount": "",

View File

@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "Aggiunto alla lista della spesa", "Added_To_Shopping_List": "Aggiunto alla lista della spesa",
"Added_by": "Aggiunto da", "Added_by": "Aggiunto da",
"Added_on": "Aggiunto il", "Added_on": "Aggiunto il",
"Admin": "",
"Advanced": "Avanzate", "Advanced": "Avanzate",
"Advanced Search Settings": "Impostazioni avanzate di ricerca", "Advanced Search Settings": "Impostazioni avanzate di ricerca",
"Amount": "Quantità", "Amount": "Quantità",

View File

@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "", "Added_To_Shopping_List": "",
"Added_by": "", "Added_by": "",
"Added_on": "", "Added_on": "",
"Admin": "",
"Advanced": "", "Advanced": "",
"Alignment": "", "Alignment": "",
"Amount": "Suma", "Amount": "Suma",

View File

@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "Lagt til i handlelisten", "Added_To_Shopping_List": "Lagt til i handlelisten",
"Added_by": "Lagt til av", "Added_by": "Lagt til av",
"Added_on": "Lagt til", "Added_on": "Lagt til",
"Admin": "",
"Advanced": "Avansert", "Advanced": "Avansert",
"Alignment": "Justering", "Alignment": "Justering",
"Amount": "Mengde", "Amount": "Mengde",

View File

@@ -18,6 +18,7 @@
"Added_To_Shopping_List": "Toegevoegd aan boodschappenlijst", "Added_To_Shopping_List": "Toegevoegd aan boodschappenlijst",
"Added_by": "Toegevoegd door", "Added_by": "Toegevoegd door",
"Added_on": "Toegevoegd op", "Added_on": "Toegevoegd op",
"Admin": "",
"Advanced": "Geavanceerd", "Advanced": "Geavanceerd",
"Advanced Search Settings": "Geavanceerde zoekinstellingen", "Advanced Search Settings": "Geavanceerde zoekinstellingen",
"Amount": "Hoeveelheid", "Amount": "Hoeveelheid",

View File

@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "Dodano do listy zakupów", "Added_To_Shopping_List": "Dodano do listy zakupów",
"Added_by": "Dodane przez", "Added_by": "Dodane przez",
"Added_on": "Dodano dnia", "Added_on": "Dodano dnia",
"Admin": "",
"Advanced": "Zaawansowany", "Advanced": "Zaawansowany",
"Advanced Search Settings": "Ustawienia zaawansowanego wyszukiwania", "Advanced Search Settings": "Ustawienia zaawansowanego wyszukiwania",
"Alignment": "Wyrównanie", "Alignment": "Wyrównanie",

View File

@@ -15,6 +15,7 @@
"Added_To_Shopping_List": "Adicionado à lista de compras", "Added_To_Shopping_List": "Adicionado à lista de compras",
"Added_by": "Adicionado por", "Added_by": "Adicionado por",
"Added_on": "Adicionado a", "Added_on": "Adicionado a",
"Admin": "",
"Advanced": "Avançado", "Advanced": "Avançado",
"Amount": "Quantidade", "Amount": "Quantidade",
"Auto_Planner": "", "Auto_Planner": "",

View File

@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "Incluído na lista de compras", "Added_To_Shopping_List": "Incluído na lista de compras",
"Added_by": "Incluído Por", "Added_by": "Incluído Por",
"Added_on": "Incluído Em", "Added_on": "Incluído Em",
"Admin": "",
"Advanced": "Avançado", "Advanced": "Avançado",
"Alignment": "Alinhamento", "Alignment": "Alinhamento",
"Amount": "Quantidade", "Amount": "Quantidade",

View File

@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "Adăugat la lista de cumpărături", "Added_To_Shopping_List": "Adăugat la lista de cumpărături",
"Added_by": "Adăugat de", "Added_by": "Adăugat de",
"Added_on": "Adăugat la", "Added_on": "Adăugat la",
"Admin": "",
"Advanced": "Avansat", "Advanced": "Avansat",
"Advanced Search Settings": "", "Advanced Search Settings": "",
"Amount": "Cantitate", "Amount": "Cantitate",

View File

@@ -15,6 +15,7 @@
"Added_To_Shopping_List": "Добавлено в список покупок", "Added_To_Shopping_List": "Добавлено в список покупок",
"Added_by": "Добавлено", "Added_by": "Добавлено",
"Added_on": "Добавлено на", "Added_on": "Добавлено на",
"Admin": "",
"Advanced": "Расширенный", "Advanced": "Расширенный",
"Advanced Search Settings": "", "Advanced Search Settings": "",
"Are_You_Sure": "Вы уверены?", "Are_You_Sure": "Вы уверены?",

View File

@@ -13,6 +13,7 @@
"Add_to_Shopping": "Dodaj v nakupovalni listek", "Add_to_Shopping": "Dodaj v nakupovalni listek",
"Added_To_Shopping_List": "Dodano v nakupovalni listek", "Added_To_Shopping_List": "Dodano v nakupovalni listek",
"Added_by": "Dodano s strani", "Added_by": "Dodano s strani",
"Admin": "",
"Advanced Search Settings": "", "Advanced Search Settings": "",
"Amount": "Količina", "Amount": "Količina",
"Auto_Planner": "Avto-planer", "Auto_Planner": "Avto-planer",

View File

@@ -18,6 +18,7 @@
"Added_To_Shopping_List": "Lades till i inköpslistan", "Added_To_Shopping_List": "Lades till i inköpslistan",
"Added_by": "Tillagd av", "Added_by": "Tillagd av",
"Added_on": "Tillagd på", "Added_on": "Tillagd på",
"Admin": "",
"Advanced": "Avancerat", "Advanced": "Avancerat",
"Alignment": "Orientering", "Alignment": "Orientering",
"Amount": "Mängd", "Amount": "Mängd",

View File

@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "Alışveriş listesine eklendi", "Added_To_Shopping_List": "Alışveriş listesine eklendi",
"Added_by": "Ekleyen", "Added_by": "Ekleyen",
"Added_on": "Eklenme Zamanı", "Added_on": "Eklenme Zamanı",
"Admin": "",
"Advanced": "Gelişmiş", "Advanced": "Gelişmiş",
"Alignment": "Hizalama", "Alignment": "Hizalama",
"Amount": "Miktar", "Amount": "Miktar",

View File

@@ -15,6 +15,7 @@
"Added_To_Shopping_List": "Додано до списку покупок", "Added_To_Shopping_List": "Додано до списку покупок",
"Added_by": "Додано", "Added_by": "Додано",
"Added_on": "Додано На", "Added_on": "Додано На",
"Admin": "",
"Advanced": "", "Advanced": "",
"Amount": "Кількість", "Amount": "Кількість",
"App": "", "App": "",

View File

@@ -17,6 +17,7 @@
"Added_To_Shopping_List": "添加到购物清单", "Added_To_Shopping_List": "添加到购物清单",
"Added_by": "添加者", "Added_by": "添加者",
"Added_on": "添加到", "Added_on": "添加到",
"Admin": "",
"Advanced": "高级", "Advanced": "高级",
"Alignment": "校准", "Alignment": "校准",
"Amount": "数量", "Amount": "数量",

View File

@@ -8,6 +8,7 @@
"Add_nutrition_recipe": "為食譜添加營養資訊", "Add_nutrition_recipe": "為食譜添加營養資訊",
"Add_to_Plan": "加入計劃", "Add_to_Plan": "加入計劃",
"Add_to_Shopping": "加入購物清單", "Add_to_Shopping": "加入購物清單",
"Admin": "",
"Available": "", "Available": "",
"AvailableCategories": "", "AvailableCategories": "",
"BaseUnit": "", "BaseUnit": "",

View File

@@ -1201,6 +1201,7 @@ export interface ApiRecipeListRequest {
keywordsOrNot?: Array<number>; keywordsOrNot?: Array<number>;
makenow?: boolean; makenow?: boolean;
_new?: string; _new?: string;
numRecent?: number;
page?: number; page?: number;
pageSize?: number; pageSize?: number;
query?: string; query?: string;
@@ -8763,6 +8764,10 @@ export class ApiApi extends runtime.BaseAPI {
queryParameters['new'] = requestParameters['_new']; queryParameters['new'] = requestParameters['_new'];
} }
if (requestParameters['numRecent'] != null) {
queryParameters['num_recent'] = requestParameters['numRecent'];
}
if (requestParameters['page'] != null) { if (requestParameters['page'] != null) {
queryParameters['page'] = requestParameters['page']; queryParameters['page'] = requestParameters['page'];
} }

View File

@@ -49,6 +49,24 @@ export interface PatchedUser {
* @memberof PatchedUser * @memberof PatchedUser
*/ */
readonly displayName?: string; 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'], 'firstName': json['first_name'] == null ? undefined : json['first_name'],
'lastName': json['last_name'] == null ? undefined : json['last_name'], 'lastName': json['last_name'] == null ? undefined : json['last_name'],
'displayName': json['display_name'] == null ? undefined : json['display_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<PatchedUser, 'username'|'dis
'id': value['id'], 'id': value['id'],
'first_name': value['firstName'], 'first_name': value['firstName'],
'last_name': value['lastName'], 'last_name': value['lastName'],
'is_staff': value['isStaff'],
'is_superuser': value['isSuperuser'],
'is_active': value['isActive'],
}; };
} }

View File

@@ -49,6 +49,24 @@ export interface User {
* @memberof User * @memberof User
*/ */
readonly displayName: string; readonly displayName: string;
/**
* Designates whether the user can log into this admin site.
* @type {boolean}
* @memberof User
*/
isStaff?: boolean;
/**
* Designates that this user has all permissions without explicitly assigning them.
* @type {boolean}
* @memberof User
*/
isSuperuser?: boolean;
/**
* Designates whether this user should be treated as active. Unselect this instead of deleting accounts.
* @type {boolean}
* @memberof User
*/
isActive?: boolean;
} }
/** /**
@@ -75,6 +93,9 @@ export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User
'firstName': json['first_name'] == null ? undefined : json['first_name'], 'firstName': json['first_name'] == null ? undefined : json['first_name'],
'lastName': json['last_name'] == null ? undefined : json['last_name'], 'lastName': json['last_name'] == null ? undefined : json['last_name'],
'displayName': json['display_name'], 'displayName': 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'],
}; };
} }
@@ -92,6 +113,9 @@ export function UserToJSONTyped(value?: Omit<User, 'username'|'display_name'> |
'id': value['id'], 'id': value['id'],
'first_name': value['firstName'], 'first_name': value['firstName'],
'last_name': value['lastName'], 'last_name': value['lastName'],
'is_staff': value['isStaff'],
'is_superuser': value['isSuperuser'],
'is_active': value['isActive'],
}; };
} }

View File

@@ -7,7 +7,7 @@
<script setup lang="ts"> <script setup lang="ts">
import {defineComponent, onMounted, ref, watch} from 'vue' import {defineComponent, onMounted, ref, watch} from 'vue'
import {ApiApi, Recipe} from "@/openapi"; import {ApiApi, Recipe, ViewLog} from "@/openapi";
import RecipeView from "@/components/display/RecipeView.vue"; import RecipeView from "@/components/display/RecipeView.vue";
import {useDisplay} from "vuetify"; import {useDisplay} from "vuetify";
@@ -33,6 +33,12 @@ function refreshData(recipeId: string) {
api.apiRecipeRetrieve({id: Number(recipeId)}).then(r => { api.apiRecipeRetrieve({id: Number(recipeId)}).then(r => {
recipe.value = r recipe.value = r
}) })
api.apiViewLogCreate({
viewLog: {
recipe: Number(recipeId)
} as ViewLog
})
} }
</script> </script>

View File

@@ -10,7 +10,7 @@
<v-list-item :to="{name: 'view_settings_cosmetic'}" prepend-icon="fa-solid fa-palette">{{ $t('Cosmetic') }}</v-list-item> <v-list-item :to="{name: 'view_settings_cosmetic'}" prepend-icon="fa-solid fa-palette">{{ $t('Cosmetic') }}</v-list-item>
<v-list-item :to="{name: 'view_settings_shopping'}" prepend-icon="$shopping">{{ $t('Shopping_list') }}</v-list-item> <v-list-item :to="{name: 'view_settings_shopping'}" prepend-icon="$shopping">{{ $t('Shopping_list') }}</v-list-item>
<v-list-item :to="{name: 'view_settings_mealplan'}" prepend-icon="$mealplan">{{ $t('Meal_Plan') }}</v-list-item> <v-list-item :to="{name: 'view_settings_mealplan'}" prepend-icon="$mealplan">{{ $t('Meal_Plan') }}</v-list-item>
<!-- <v-list-item prepend-icon="$search">{{ $t('Search') }}</v-list-item>--> <v-list-item :href="getDjangoUrl('settings-shopping/')" target="_blank" prepend-icon="$search">{{ $t('Search') }}</v-list-item>
<v-divider></v-divider> <v-divider></v-divider>
<v-list-subheader>Space</v-list-subheader> <v-list-subheader>Space</v-list-subheader>
<v-list-item :to="{name: 'view_settings_user_space'}" prepend-icon="$spaces">{{ $t('YourSpaces') }}</v-list-item> <v-list-item :to="{name: 'view_settings_user_space'}" prepend-icon="$spaces">{{ $t('YourSpaces') }}</v-list-item>

View File

@@ -12,8 +12,9 @@
</v-card-text> </v-card-text>
</v-card> </v-card>
<!-- <horizontal-recipe-scroller :skeletons="4" mode="recent"></horizontal-recipe-scroller>--> <horizontal-recipe-scroller :skeletons="4" mode="recent"></horizontal-recipe-scroller>
<horizontal-recipe-scroller :skeletons="4" mode="new"></horizontal-recipe-scroller> <horizontal-recipe-scroller :skeletons="4" mode="new"></horizontal-recipe-scroller>
<horizontal-recipe-scroller :skeletons="4" mode="keyword"></horizontal-recipe-scroller>
<horizontal-recipe-scroller :skeletons="2" mode="rating"></horizontal-recipe-scroller> <horizontal-recipe-scroller :skeletons="2" mode="rating"></horizontal-recipe-scroller>
<horizontal-recipe-scroller :skeletons="4" mode="keyword"></horizontal-recipe-scroller> <horizontal-recipe-scroller :skeletons="4" mode="keyword"></horizontal-recipe-scroller>