Skip to content

Commit

Permalink
fixed navigating with global search
Browse files Browse the repository at this point in the history
  • Loading branch information
vabene1111 committed Dec 19, 2024
1 parent ecdb1e9 commit 1c9d19f
Show file tree
Hide file tree
Showing 36 changed files with 145 additions and 9 deletions.
3 changes: 1 addition & 2 deletions cookbook/views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@


def index(request):
if settings.V3_BETA:
return HttpResponseRedirect(reverse('vue3'))
return HttpResponseRedirect(reverse('vue3'))

with scopes_disabled():
if not request.user.is_authenticated:
Expand Down
1 change: 0 additions & 1 deletion vue3/src/components/display/RecipeActivity.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
</p>
</v-list-item>
</v-list>

</v-card-text>
</v-card>

Expand Down
8 changes: 8 additions & 0 deletions vue3/src/components/display/RecipeView.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<template>
<template v-if="props.recipe.name == undefined">
<v-skeleton-loader type="card" class="mt-md-4 rounded-0"></v-skeleton-loader>
<v-skeleton-loader type="article" class="mt-2"></v-skeleton-loader>
<v-skeleton-loader type="article" class="mt-2"></v-skeleton-loader>
<v-skeleton-loader type="list-item-avatar-three-line" class="mt-2"></v-skeleton-loader>
<v-skeleton-loader type="list-item-avatar-two-line"></v-skeleton-loader>
<v-skeleton-loader type="list-item-avatar-three-line"></v-skeleton-loader>
</template>

<template v-if="props.recipe.name != undefined">

Expand Down
11 changes: 6 additions & 5 deletions vue3/src/components/inputs/GlobalSearchDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<slot name="activator">
<v-btn @click="dialog = true" variant="plain" density="default">
<i class="fas fa-search mr-1"></i>
<span class="d-none d-sm-block">Search</span>
<v-chip size="x-small" variant="tonal" class="d-none d-md-flex ml-1" label>Ctrl+K</v-chip>
<span class="d-none d-sm-block">{{$t('Search')}}</span>
<v-chip size="x-small" variant="tonal" class="d-none d-md-flex ml-1" label>{{$t('Ctrl+K')}}</v-chip>
</v-btn>
</slot>

Expand Down Expand Up @@ -42,11 +42,11 @@
<v-card-text class="d-none d-sm-block pt-2">
<v-chip size="x-small" class="mr-1" label><i class="fas fa-arrow-up"></i></v-chip>
<v-chip size="x-small" class="mr-1" label><i class="fas fa-arrow-down"></i></v-chip>
<small class="mr-2">to navigate</small>
<small class="mr-2">{{$t('to_navigate')}}</small>
<v-chip size="x-small" class="mr-1" label><i class="fas fa-level-down-alt fa-rotate-90"></i></v-chip>
<small class="mr-2">to select</small>
<small class="mr-2">{{$t('to_select')}}</small>
<v-chip size="x-small" class="mr-1" label> esc</v-chip>
<small>to close</small>
<small>{{$t('to_close')}}</small>


</v-card-text>
Expand Down Expand Up @@ -166,6 +166,7 @@ function cardVariant(index: number) {
function goToSelectedRecipe() {
dialog.value = false
let searchResult = searchResults.value[selectedResult.value]
console.log('going to', searchResult.recipe_id)
if (searchResult.recipe_id != null) {
router.push({name: 'view_recipe', params: {'id': searchResult.recipe_id}})
}
Expand Down
4 changes: 4 additions & 0 deletions vue3/src/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"Create_New_Shopping_Category": "",
"Create_New_Unit": "",
"CreatedBy": "",
"Ctrl+K": "",
"Current_Period": "",
"Custom Filter": "",
"Database": "",
Expand Down Expand Up @@ -502,6 +503,9 @@
"success_updating_resource": "",
"theUsernameCannotBeChanged": "",
"times_cooked": "",
"to_close": "",
"to_navigate": "",
"to_select": "",
"today_recipes": "",
"tree_root": "",
"tree_select": "",
Expand Down
4 changes: 4 additions & 0 deletions vue3/src/locales/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"Create_New_Shopping Category": "Създайте нова категория за пазаруване",
"Create_New_Unit": "Добавяне на нова единица",
"CreatedBy": "",
"Ctrl+K": "",
"Current_Period": "Текущ период",
"Custom Filter": "Персонализиран филтър",
"Database": "",
Expand Down Expand Up @@ -489,6 +490,9 @@
"success_updating_resource": "Успешно актуализиран ресурс!",
"theUsernameCannotBeChanged": "",
"times_cooked": "Пъти сготвено",
"to_close": "",
"to_navigate": "",
"to_select": "",
"today_recipes": "Днешните рецепти",
"tree_root": "Корен на дървото",
"tree_select": "Използвайте Избор на дърво",
Expand Down
4 changes: 4 additions & 0 deletions vue3/src/locales/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"Create_New_Unit": "",
"Created": "",
"CreatedBy": "",
"Ctrl+K": "",
"Current_Period": "",
"Custom Filter": "",
"CustomImageHelp": "",
Expand Down Expand Up @@ -634,6 +635,9 @@
"tbsp": "",
"theUsernameCannotBeChanged": "",
"times_cooked": "",
"to_close": "",
"to_navigate": "",
"to_select": "",
"today_recipes": "",
"total": "",
"tree_root": "",
Expand Down
4 changes: 4 additions & 0 deletions vue3/src/locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"Create_New_Shopping_Category": "Přidat novou nákupní kategorii",
"Create_New_Unit": "Přidat novou jednotku",
"CreatedBy": "",
"Ctrl+K": "",
"Current_Period": "Současné období",
"Custom Filter": "Uživatelský filtr",
"CustomImageHelp": "Nahrajte obrázek, který se zobrazí v přehledu prostoru.",
Expand Down Expand Up @@ -627,6 +628,9 @@
"tbsp": "lžíce [tbsp] (US, objem)",
"theUsernameCannotBeChanged": "",
"times_cooked": "Kolkrát vařeno",
"to_close": "",
"to_navigate": "",
"to_select": "",
"today_recipes": "Dnešní recepty",
"total": "celkem",
"tree_root": "Kořen stromu",
Expand Down
4 changes: 4 additions & 0 deletions vue3/src/locales/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"Create_New_Shopping_Category": "Opret ny indkøbskategori",
"Create_New_Unit": "Tilføj ny enhed",
"CreatedBy": "",
"Ctrl+K": "",
"Current_Period": "Nuværende periode",
"Custom Filter": "Tilpasset filter",
"Data_Import_Info": "Udbyg dit Space og gør din opskriftsamling bedre ved at importere en netværkskurateret liste af ingredienser, enheder og mere.",
Expand Down Expand Up @@ -603,6 +604,9 @@
"tbsp": "tablespoon [tbsp] (US, volumen)",
"theUsernameCannotBeChanged": "",
"times_cooked": "Antal gange tilberedt",
"to_close": "",
"to_navigate": "",
"to_select": "",
"today_recipes": "Opskrifter til i dag",
"total": "total",
"tree_root": "Roden af træet",
Expand Down
4 changes: 4 additions & 0 deletions vue3/src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"Create_New_Unit": "Neue Einheit hinzufügen",
"Created": "Erstellt",
"CreatedBy": "Erstellt von",
"Ctrl+K": "Strg+K",
"Current_Period": "Aktueller Zeitraum",
"Custom Filter": "Benutzerdefinierter Filter",
"CustomImageHelp": "Laden Sie ein Bild hoch, das in der Space-Übersicht angezeigt werden soll.",
Expand Down Expand Up @@ -638,6 +639,9 @@
"tbsp": "Esslöffel [tbsp] (US, Volumen)",
"theUsernameCannotBeChanged": "Der Benutzername kann nicht geändert werden.",
"times_cooked": "Wie oft gekocht",
"to_close": "zum schließen",
"to_navigate": "zum navigieren",
"to_select": "zum auswählen",
"today_recipes": "Rezepte des Tages",
"total": "gesamt",
"tree_root": "Ursprung des Baums",
Expand Down
4 changes: 4 additions & 0 deletions vue3/src/locales/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"Create_New_Shopping_Category": "Προσθήκη νέας κατηγορίας αγορών",
"Create_New_Unit": "Προσθήκη νέας μονάδας μέτρησης",
"CreatedBy": "",
"Ctrl+K": "",
"Current_Period": "Τρέχουσα περίοδος",
"Custom Filter": "Προσαρμοσμένο φίλτρο",
"Data_Import_Info": "Βελτιώστε τον χώρο και τη συλλογή συνταγών σας κάνοντας εισαγωγή μιας λίστας από φαγητά, μονάδες μέτρησης κ.α., επιμελημένη από την κοινότητα.",
Expand Down Expand Up @@ -586,6 +587,9 @@
"tbsp": "κουτάλι της σούπας [tbsp] (ΗΠΑ, όγκος)",
"theUsernameCannotBeChanged": "",
"times_cooked": "Φορές που έχει μαγειρευτεί",
"to_close": "",
"to_navigate": "",
"to_select": "",
"today_recipes": "Συνταγές της ημέρας",
"total": "σύνολο",
"tree_root": "Ρίζα του δέντρου",
Expand Down
4 changes: 4 additions & 0 deletions vue3/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"Create_New_Unit": "Add New Unit",
"Created": "Created",
"CreatedBy": "Created by",
"Ctrl+K": "Ctrl+K",
"Current_Period": "Current Period",
"Custom Filter": "Custom Filter",
"CustomImageHelp": "Upload an image to show in the space overview.",
Expand Down Expand Up @@ -636,6 +637,9 @@
"tbsp": "tablespoon [tbsp] (US, volume)",
"theUsernameCannotBeChanged": "The username cannot be changed.",
"times_cooked": "Times Cooked",
"to_close": "to close",
"to_navigate": "to navigate",
"to_select": "to select",
"today_recipes": "Today's Recipes",
"total": "total",
"tree_root": "Root of Tree",
Expand Down
4 changes: 4 additions & 0 deletions vue3/src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"Create_New_Unit": "Añadir nueva unidad",
"Created": "Creada",
"CreatedBy": "",
"Ctrl+K": "",
"Current_Period": "Período Actual",
"Custom Filter": "Filtro Personalizado",
"CustomImageHelp": "Subir una imagen para mostrar en la vista general del espacio.",
Expand Down Expand Up @@ -633,6 +634,9 @@
"tbsp": "cucharada sopera [tbsp] (US, volumen)",
"theUsernameCannotBeChanged": "",
"times_cooked": "Veces Cocinada",
"to_close": "",
"to_navigate": "",
"to_select": "",
"today_recipes": "Recetas del día",
"total": "total",
"tree_root": "Raíz del Árbol",
Expand Down
4 changes: 4 additions & 0 deletions vue3/src/locales/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"Create_New_Shopping Category": "Luo Uusi Ostoskategoria",
"Create_New_Unit": "Lisää Uusi Yksikkö",
"CreatedBy": "",
"Ctrl+K": "",
"Current_Period": "Nykyinen Jakso",
"Database": "",
"Date": "Päivämäärä",
Expand Down Expand Up @@ -297,6 +298,9 @@
"success_moving_resource": "Resurssin siirto onnistui!",
"success_updating_resource": "Resurssin päivitys onnistui!",
"theUsernameCannotBeChanged": "",
"to_close": "",
"to_navigate": "",
"to_select": "",
"tree_root": "Root of Tree",
"warning_feature_beta": "Tämä ominaisuus on BETA (testaus) vaiheessa. Bugeja ja hajottavia muutoksia saattaa ilmaantua tulevaisuudessa tätä ominaisuutta (mahdollisesti menettää ominaisuuksiin liittyvää tietoa) käytettäessä."
}
4 changes: 4 additions & 0 deletions vue3/src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"Create_New_Unit": "Ajouter une nouvelle unité",
"Created": "Créé",
"CreatedBy": "",
"Ctrl+K": "",
"Current_Period": "Période actuelle",
"Custom Filter": "Filtre personnalisé",
"CustomImageHelp": "Téléchargez une image à afficher dans l'aperçu de l'espace.",
Expand Down Expand Up @@ -621,6 +622,9 @@
"tbsp": "",
"theUsernameCannotBeChanged": "",
"times_cooked": "Nombre de fois cuisiné",
"to_close": "",
"to_navigate": "",
"to_select": "",
"today_recipes": "Recettes du jour",
"total": "total",
"tree_root": "Racine de l’arbre",
Expand Down
4 changes: 4 additions & 0 deletions vue3/src/locales/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"Create_New_Unit": "הוסף יחידה",
"Created": "נוצר",
"CreatedBy": "",
"Ctrl+K": "",
"Current_Period": "תקופה נוכחית",
"Custom Filter": "פילטר מותאם",
"CustomImageHelp": "העלאת תמונה שתראה באזור הסקירה.",
Expand Down Expand Up @@ -635,6 +636,9 @@
"tbsp": "כף",
"theUsernameCannotBeChanged": "",
"times_cooked": "מספר הפעמים שבושל",
"to_close": "",
"to_navigate": "",
"to_select": "",
"today_recipes": "מתכון היום",
"total": "סך הכל",
"tree_root": "מקור העץ",
Expand Down
4 changes: 4 additions & 0 deletions vue3/src/locales/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"Create_New_Shopping_Category": "Új vásárlási kategória hozzáadása",
"Create_New_Unit": "Új mértékegység hozzáadása",
"CreatedBy": "",
"Ctrl+K": "",
"Current_Period": "Jelenlegi periódus",
"Custom Filter": "Egyéni szűrő",
"Data_Import_Info": "Bővítse Terét alapanyagok, mértékegységek és egyebek közösség által összeállított listájának importálásával, hogy ezzel is javítsa a receptgyűjteményét.",
Expand Down Expand Up @@ -590,6 +591,9 @@
"tbsp": "evőkanál [tbsp] (USA, térfogat)",
"theUsernameCannotBeChanged": "",
"times_cooked": "szor elkészítve",
"to_close": "",
"to_navigate": "",
"to_select": "",
"today_recipes": "Mai receptek",
"total": "összesen",
"tree_root": "",
Expand Down
4 changes: 4 additions & 0 deletions vue3/src/locales/hy.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"Create_New_Keyword": "Ավելացնել նոր բանալի բառ",
"Create_New_Shopping Category": "Ստեղծել գնումների նոր կատեգորիա",
"CreatedBy": "",
"Ctrl+K": "",
"Database": "",
"Date": "",
"Default": "",
Expand Down Expand Up @@ -208,5 +209,8 @@
"success_fetching_resource": "Ռեսուրսը հաջողությամբ կցվել է։",
"success_updating_resource": "Ռեսուրսը հաջողությամբ թարմացվել է։",
"theUsernameCannotBeChanged": "",
"to_close": "",
"to_navigate": "",
"to_select": "",
"warning_feature_beta": "Այս հատկությունը ԲԵՏԱ տարբերակում է։ Ակնկալեք սխալներ և անգամ խափանող թարմացումներ ապագայում։"
}
4 changes: 4 additions & 0 deletions vue3/src/locales/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"Create_New_Shopping_Category": "",
"Create_New_Unit": "",
"CreatedBy": "",
"Ctrl+K": "",
"Current_Period": "",
"Custom Filter": "",
"Database": "",
Expand Down Expand Up @@ -528,6 +529,9 @@
"success_updating_resource": "Berhasil memperbarui sumber daya!",
"theUsernameCannotBeChanged": "",
"times_cooked": "",
"to_close": "",
"to_navigate": "",
"to_select": "",
"today_recipes": "",
"tree_root": "",
"tree_select": "",
Expand Down
4 changes: 4 additions & 0 deletions vue3/src/locales/is.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"Create_New_Unit": "",
"Created": "",
"CreatedBy": "",
"Ctrl+K": "",
"Current_Period": "",
"Custom Filter": "",
"CustomImageHelp": "",
Expand Down Expand Up @@ -633,6 +634,9 @@
"tbsp": "",
"theUsernameCannotBeChanged": "",
"times_cooked": "",
"to_close": "",
"to_navigate": "",
"to_select": "",
"today_recipes": "",
"total": "",
"tree_root": "",
Expand Down
4 changes: 4 additions & 0 deletions vue3/src/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"Create_New_Shopping_Category": "Aggiungi nuova categoria di spesa",
"Create_New_Unit": "Aggiungi nuova unità",
"CreatedBy": "",
"Ctrl+K": "",
"Current_Period": "Periodo attuale",
"Custom Filter": "Filtro personalizzato",
"Database": "",
Expand Down Expand Up @@ -544,6 +545,9 @@
"success_updating_resource": "Risorsa aggiornata con successo!",
"theUsernameCannotBeChanged": "",
"times_cooked": "Cucinato N volte",
"to_close": "",
"to_navigate": "",
"to_select": "",
"today_recipes": "Ricette di oggi",
"tree_root": "Radice dell'albero",
"tree_select": "Usa selezione ad albero",
Expand Down
4 changes: 4 additions & 0 deletions vue3/src/locales/lt.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"Create_New_Shopping_Category": "",
"Create_New_Unit": "",
"CreatedBy": "",
"Ctrl+K": "",
"Current_Period": "",
"Custom Filter": "",
"Data_Import_Info": "",
Expand Down Expand Up @@ -601,6 +602,9 @@
"tbsp": "",
"theUsernameCannotBeChanged": "",
"times_cooked": "",
"to_close": "",
"to_navigate": "",
"to_select": "",
"today_recipes": "",
"total": "",
"tree_root": "",
Expand Down
Loading

0 comments on commit 1c9d19f

Please sign in to comment.