Skip to content

Commit

Permalink
recipe editor in model editor system basics
Browse files Browse the repository at this point in the history
  • Loading branch information
vabene1111 committed Dec 1, 2024
1 parent ab9f970 commit 49c8a5a
Show file tree
Hide file tree
Showing 35 changed files with 275 additions and 8 deletions.
2 changes: 1 addition & 1 deletion vue3/src/components/display/ShoppingListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
v-model="useUserPreferenceStore().deviceSettings.shopping_show_selected_supermarket_only"></v-switch>
</v-list-item>
<v-list-item>
<model-select model="Supermarket" v-model="useUserPreferenceStore().deviceSettings.shopping_selected_supermarket"></model-select>
<model-select model="Supermarket" append-to-body v-model="useUserPreferenceStore().deviceSettings.shopping_selected_supermarket"></model-select>
</v-list-item>

<v-list-item>
Expand Down
3 changes: 2 additions & 1 deletion vue3/src/components/inputs/ModelSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
:noResultsText="$t('No_Results')"
:loading="loading"
@open="multiselect.refreshOptions()"
append-to-body
:append-to-body="appendToBody"
:classes="{
dropdown: 'multiselect-dropdown z-3000',
}"
Expand Down Expand Up @@ -63,6 +63,7 @@ const props = defineProps({
canClear: {type: Boolean, default: true},
mode: {type: String as PropType<'single' | 'multiple' | 'tags'>, default: 'single'},
appendToBody: {type: Boolean, default: false},
allowCreate: {type: Boolean, default: false},
Expand Down
94 changes: 94 additions & 0 deletions vue3/src/components/model_editors/RecipeEditor.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<template>
<model-editor-base
:loading="loading"
:dialog="dialog"
@save="saveObject"
@delete="deleteObject"
@close="emit('close')"
:is-update="isUpdate()"
:model-class="modelClass"
:object-name="editingObjName()">

<v-tabs v-model="tab" :disabled="loading" grow>
<v-tab value="recipe">{{ $t('Recipe') }}</v-tab>
<v-tab value="steps">{{ $t('Steps') }}</v-tab>
<v-tab value="settings">{{ $t('Settings') }}</v-tab>

</v-tabs>

<v-card-text>
<v-tabs-window v-model="tab">
<v-tabs-window-item value="recipe">
<v-form :disabled="loading">
<v-text-field :label="$t('Name')" v-model="editingObj.name"></v-text-field>
<v-textarea :label="$t('Description')" v-model="editingObj.description" clearable counter="512"></v-textarea>

<v-label>{{ $t('Keywords') }}</v-label>
<ModelSelect mode="tags" v-model="editingObj.keywords" model="Keyword"></ModelSelect>
<v-row>
<v-col cols="12" md="6">
<v-text-field :label="$t('WaitingTime')" v-model="editingObj.waitingTime"></v-text-field>
</v-col>
<v-col cols="12" md="6">
<v-text-field :label="$t('WorkingTime')" v-model="editingObj.workingTime"></v-text-field>
</v-col>
<v-col cols="12" md="6">
<v-text-field :label="$t('Servings')" v-model="editingObj.servings"></v-text-field>
</v-col>
<v-col cols="12" md="6">
<v-text-field :label="$t('ServingsText')" v-model="editingObj.servingsText"></v-text-field>
</v-col>
</v-row>

</v-form>
</v-tabs-window-item>
<v-tabs-window-item value="steps">
<v-form :disabled="loading">


</v-form>
</v-tabs-window-item>
<v-tabs-window-item value="settings">
<v-form :disabled="loading">


</v-form>
</v-tabs-window-item>
</v-tabs-window>
</v-card-text>
</model-editor-base>

</template>

<script setup lang="ts">
import {onMounted, PropType, ref} from "vue";
import {Recipe} from "@/openapi";
import ModelEditorBase from "@/components/model_editors/ModelEditorBase.vue";
import {useModelEditorFunctions} from "@/composables/useModelEditorFunctions";
import {useI18n} from "vue-i18n";
import ModelSelect from "@/components/inputs/ModelSelect.vue";
const {t} = useI18n()
const props = defineProps({
item: {type: {} as PropType<Recipe>, required: false, default: null},
itemId: {type: [Number, String], required: false, default: undefined},
dialog: {type: Boolean, default: false}
})
const emit = defineEmits(['create', 'save', 'delete', 'close'])
const {setupState, deleteObject, saveObject, isUpdate, editingObjName, loading, editingObj, modelClass} = useModelEditorFunctions<Recipe>('Recipe', emit)
// object specific data (for selects/display)
const tab = ref("recipe")
onMounted(() => {
setupState(props.item, props.itemId)
})
</script>

<style scoped>
</style>
4 changes: 4 additions & 0 deletions vue3/src/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@
"Selected": "",
"SelectedCategories": "",
"Servings": "",
"ServingsText": "",
"Settings": "",
"Share": "",
"ShopLater": "",
Expand All @@ -284,6 +285,7 @@
"Step_Name": "",
"Step_Type": "",
"Step_start_time": "",
"Steps": "",
"SubstituteOnHand": "",
"Substitutes": "",
"Success": "",
Expand Down Expand Up @@ -324,12 +326,14 @@
"View": "",
"View_Recipes": "",
"Waiting": "",
"WaitingTime": "",
"Warning": "",
"Warning_Delete_Supermarket_Category": "",
"Website": "",
"Wednesday": "",
"Week": "",
"Week_Numbers": "",
"WorkingTime": "",
"Year": "",
"YourSpaces": "",
"active": "",
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 @@ -253,6 +253,7 @@
"Selected": "Избрано",
"SelectedCategories": "",
"Servings": "Порции",
"ServingsText": "",
"Settings": "Настройки",
"Share": "Споделяне",
"ShopLater": "",
Expand All @@ -277,6 +278,7 @@
"Step_Name": "Стъпка Име",
"Step_Type": "Стъпка Тип",
"Step_start_time": "Стъпка Начално време",
"Steps": "",
"SubstituteOnHand": "Имате заместител под ръка.",
"Substitutes": "",
"Success": "Успешно",
Expand Down Expand Up @@ -315,12 +317,14 @@
"View": "Изглед",
"View_Recipes": "Вижте рецепти",
"Waiting": "Очакване",
"WaitingTime": "",
"Warning": "Внимание",
"Warning_Delete_Supermarket_Category": "Изтриването на категория супермаркет ще изтрие и всички връзки с храни. Сигурен ли си?",
"Website": "уебсайт",
"Wednesday": "",
"Week": "Седмица",
"Week_Numbers": "Номера на седмиците",
"WorkingTime": "",
"Year": "Година",
"YourSpaces": "",
"active": "",
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 @@ -332,6 +332,7 @@
"Selected": "",
"SelectedCategories": "",
"Servings": "",
"ServingsText": "",
"Settings": "",
"Share": "",
"ShopLater": "",
Expand Down Expand Up @@ -365,6 +366,7 @@
"Step_Name": "Nom del pas",
"Step_Type": "Tipus de pas",
"Step_start_time": "Hora d'inici",
"Steps": "",
"Sticky_Nav": "",
"Sticky_Nav_Help": "",
"SubstituteOnHand": "",
Expand Down Expand Up @@ -421,13 +423,15 @@
"View": "",
"View_Recipes": "Mostreu les receptes",
"Waiting": "",
"WaitingTime": "",
"Warning": "",
"Warning_Delete_Supermarket_Category": "",
"Website": "",
"Wednesday": "",
"Week": "",
"Week_Numbers": "",
"Welcome": "",
"WorkingTime": "",
"Year": "",
"YourSpaces": "",
"active": "",
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 @@ -330,6 +330,7 @@
"Selected": "Vybrané",
"SelectedCategories": "",
"Servings": "Porce",
"ServingsText": "",
"Settings": "Nastavení",
"Share": "Sdílet",
"ShopLater": "",
Expand Down Expand Up @@ -361,6 +362,7 @@
"Step_Name": "Název kroku",
"Step_Type": "Druh kroku",
"Step_start_time": "Nastav počáteční čas",
"Steps": "",
"Sticky_Nav": "Připnout navigační panel",
"Sticky_Nav_Help": "Vždy zobrazit navigační panel na vrchu stránky.",
"SubstituteOnHand": "Máte k dispozici náhradu.",
Expand Down Expand Up @@ -414,13 +416,15 @@
"View": "Zobrazit",
"View_Recipes": "Zobrazit recepty",
"Waiting": "Čekající",
"WaitingTime": "",
"Warning": "Varování",
"Warning_Delete_Supermarket_Category": "Vymazáním kategorie obchodu dojde k odstranění všech vazeb na potraviny. Jste si jistí?",
"Website": "Web",
"Wednesday": "",
"Week": "Týden",
"Week_Numbers": "Číslo týdne",
"Welcome": "Vítejte",
"WorkingTime": "",
"Year": "Rok",
"YourSpaces": "",
"active": "",
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 @@ -312,6 +312,7 @@
"Selected": "Valgt",
"SelectedCategories": "",
"Servings": "Serveringer",
"ServingsText": "",
"Settings": "Indstillinger",
"Share": "Del",
"ShopLater": "",
Expand Down Expand Up @@ -339,6 +340,7 @@
"Step_Name": "Trin navn",
"Step_Type": "Trin type",
"Step_start_time": "Trin starttid",
"Steps": "",
"Sticky_Nav": "Fastlåst navigation",
"Sticky_Nav_Help": "Vis altid navigationsmenuen øverst på skærmen.",
"SubstituteOnHand": "Du har erstatninger tilgængeligt.",
Expand Down Expand Up @@ -392,13 +394,15 @@
"View": "Vis",
"View_Recipes": "Vis opskrifter",
"Waiting": "Vente",
"WaitingTime": "",
"Warning": "Advarsel",
"Warning_Delete_Supermarket_Category": "At slette en supermarkedskategori vil også slette alle relationer til mad. Er du sikker?",
"Website": "Hjemmeside",
"Wednesday": "",
"Week": "Uge",
"Week_Numbers": "Ugenumre",
"Welcome": "Velkommen",
"WorkingTime": "",
"Year": "År",
"YourSpaces": "",
"active": "",
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 @@ -335,6 +335,7 @@
"Selected": "Ausgewählt",
"SelectedCategories": "Ausgewählte Kategorien",
"Servings": "Portionen",
"ServingsText": "Portionstext",
"Settings": "Einstellungen",
"Share": "Teilen",
"ShopLater": "Später kaufen",
Expand Down Expand Up @@ -368,6 +369,7 @@
"Step_Name": "Schritt Name",
"Step_Type": "Schritt Typ",
"Step_start_time": "Schritt Startzeit",
"Steps": "Schritte",
"Sticky_Nav": "Navigationsleiste immer sichtbar (sticky navigation)",
"Sticky_Nav_Help": "Navigationsleiste immer im Seitenkopf anzeigen.",
"SubstituteOnHand": "Du hast eine Alternative vorrätig.",
Expand Down Expand Up @@ -424,13 +426,15 @@
"View": "Ansicht",
"View_Recipes": "Rezepte Ansehen",
"Waiting": "Wartezeit",
"WaitingTime": "Wartezeit (min)",
"Warning": "Warnung",
"Warning_Delete_Supermarket_Category": "Die Löschung einer Supermarktkategorie werden auch alle Beziehungen zu Lebensmitteln gelöscht. Bist du dir sicher?",
"Website": "Webseite",
"Wednesday": "Mittwoch",
"Week": "Woche",
"Week_Numbers": "Kalenderwochen",
"Welcome": "Willkommen",
"WorkingTime": "Arbeitszeit (min)",
"Year": "Jahr",
"YourSpaces": "Deine Spaces",
"active": "aktiv",
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 @@ -304,6 +304,7 @@
"Selected": "Επιλεγμένο",
"SelectedCategories": "",
"Servings": "Μερίδες",
"ServingsText": "",
"Settings": "Ρυθμίσεις",
"Share": "Κοινοποίηση",
"ShopLater": "",
Expand All @@ -330,6 +331,7 @@
"Step_Name": "Όνομα βήματος",
"Step_Type": "Είδος βήματος",
"Step_start_time": "Χρόνος αρχής βήματος",
"Steps": "",
"Sticky_Nav": "Κολλητική πλοήγηση",
"Sticky_Nav_Help": "Μόνιμη εμφάνιση του μενού πλοήγησης στο πάνω μέρος της οθόνης.",
"SubstituteOnHand": "Έχετε διαθέσιμο ένα υποκατάστατο.",
Expand Down Expand Up @@ -381,13 +383,15 @@
"View": "Προβολή",
"View_Recipes": "Προβολή συνταγών",
"Waiting": "Αναμονή",
"WaitingTime": "",
"Warning": "Προειδοποίηση",
"Warning_Delete_Supermarket_Category": "Η διαγραφή μιας κατηγορίας supermarket θα διαγράψει και όλες τις σχέσεις της με φαγητά. Είστε σίγουροι;",
"Website": "Ιστοσελίδα",
"Wednesday": "",
"Week": "Εβδομάδα",
"Week_Numbers": "Αριθμοί εδομάδων",
"Welcome": "Καλώς ήρθατε",
"WorkingTime": "",
"Year": "Έτος",
"YourSpaces": "",
"active": "",
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 @@ -334,6 +334,7 @@
"Selected": "Selected",
"SelectedCategories": "Selected Categories",
"Servings": "Servings",
"ServingsText": "Servings Text",
"Settings": "Settings",
"Share": "Share",
"ShopLater": "Shop later",
Expand Down Expand Up @@ -367,6 +368,7 @@
"Step_Name": "Step Name",
"Step_Type": "Step Type",
"Step_start_time": "Step start time",
"Steps": "Steps",
"Sticky_Nav": "Sticky Navigation",
"Sticky_Nav_Help": "Always show the navigation menu at the top of the screen.",
"SubstituteOnHand": "You have a substitute on hand.",
Expand Down Expand Up @@ -423,13 +425,15 @@
"View": "View",
"View_Recipes": "View Recipes",
"Waiting": "Waiting",
"WaitingTime": "Waiting Time (min)",
"Warning": "Warning",
"Warning_Delete_Supermarket_Category": "Deleting a supermarket category will also delete all relations to foods. Are you sure?",
"Website": "Website",
"Wednesday": "Wednesday",
"Week": "Week",
"Week_Numbers": "Week numbers",
"Welcome": "Welcome",
"WorkingTime": "Working time (min)",
"Year": "Year",
"YourSpaces": "Your Spaces",
"active": "active",
Expand Down
Loading

0 comments on commit 49c8a5a

Please sign in to comment.