Merge branch 'develop' into feature/importer_to_vue

# Conflicts:
#	vue/package.json
This commit is contained in:
vabene1111
2022-04-04 19:16:20 +02:00
19 changed files with 4925 additions and 2098 deletions

View File

@ -79,7 +79,7 @@
:loading="keywords_loading"
@search-change="searchKeywords"
>
<template v-slot:noOptions>{{ $t("empty_list") }}</template>
<template v-slot:noOptions>{{ $t("empty_list") }}</template>
</multiselect>
</div>
</div>
@ -140,6 +140,24 @@
</div>
</b-collapse>
</div>
<b-card-header header-tag="header" class="p-1" role="tab">
<b-button squared block v-b-toggle.additional_collapse class="text-left" variant="outline-primary">{{ $t("additional_options") }}</b-button>
</b-card-header>
<b-collapse id="additional_collapse" class="mt-2" v-model="additional_visible">
<b-form-group>
<b-input-group-append>
<b-input-group-text squared> {{ $t("Create Food") }}</b-input-group-text>
<b-input-group-text squared>
<b-form-checkbox v-model="recipe.create_food"></b-form-checkbox>
</b-input-group-text>
<b-input-group-text squared v-if="recipe.create_food"> {{ $t("Name") }}</b-input-group-text>
<b-form-input squared v-if="recipe.create_food" v-model="recipe.food_name" id="food_name"></b-form-input>
</b-input-group-append>
<em class="small text-muted">
{{ $t("create_food_desc") }}
</em>
</b-form-group>
</b-collapse>
</div>
</div>
@ -260,7 +278,7 @@
style="flex-grow: 1; flex-shrink: 1; flex-basis: 0"
@search-change="searchFiles"
>
<template v-slot:noOptions>{{ $t("empty_list") }}</template>
<template v-slot:noOptions>{{ $t("empty_list") }}</template>
</multiselect>
<b-input-group-append>
<b-button
@ -300,7 +318,7 @@
:loading="recipes_loading"
@search-change="searchRecipes"
>
<template v-slot:noOptions>{{ $t("empty_list") }}</template>
<template v-slot:noOptions>{{ $t("empty_list") }}</template>
</multiselect>
</div>
</div>
@ -364,7 +382,7 @@
:loading="units_loading"
@search-change="searchUnits"
>
<template v-slot:noOptions>{{ $t("empty_list") }}</template>
<template v-slot:noOptions>{{ $t("empty_list") }}</template>
</multiselect>
</div>
<div class="col-lg-4 col-md-6 small-padding" v-if="!ingredient.is_header">
@ -394,7 +412,7 @@
:loading="foods_loading"
@search-change="searchFoods"
>
<template v-slot:noOptions>{{ $t("empty_list") }}</template>
<template v-slot:noOptions>{{ $t("empty_list") }}</template>
</multiselect>
</div>
<div class="small-padding" v-bind:class="{ 'col-lg-4 col-md-6': !ingredient.is_header, 'col-lg-12 col-md-12': ingredient.is_header }">
@ -619,6 +637,8 @@ export default {
paste_step: undefined,
show_file_create: false,
step_for_file_create: undefined,
additional_visible: false,
create_food: undefined,
}
},
computed: {
@ -650,6 +670,12 @@ export default {
this.recipe_changed = this.recipe_changed !== undefined
},
},
"recipe.name": function () {
this.recipe.food_name = this.recipe.name.toLowerCase()
},
"recipe.create_food": function () {
this.create_food = this.recipe.create_food
},
},
methods: {
keyboardListener: function (e) {
@ -736,6 +762,9 @@ export default {
.then((response) => {
StandardToasts.makeStandardToast(StandardToasts.SUCCESS_UPDATE)
this.recipe_changed = false
if (this.create_food) {
apiFactory.createFood({ name: this.recipe.food_name, recipe: { id: this.recipe.id, name: this.recipe.name } })
}
if (view_after) {
location.href = resolveDjangoUrl("view_recipe", this.recipe_id)
}

View File

@ -123,9 +123,9 @@
<div class="collapse" :id="'section-' + sectionID(x, i)" visible role="tabpanel" :class="{ show: x == 'false' }">
<!-- passing an array of values to the table grouped by Food -->
<transition-group name="slide-fade">
<div class="mx-4" v-for="(entries, x) in Object.entries(s)" :key="x">
<div class="ml-4 mr-0" v-for="(entries, x) in Object.entries(s)" :key="x">
<transition name="slide-fade" mode="out-in">
<ShoppingLineItem
<shopping-line-item
:entries="entries[1]"
:groupby="group_by"
:settings="settings"

View File

@ -1,13 +1,13 @@
<template>
<div id="shopping_line_item">
<b-row align-h="start">
<b-col cols="3" md="2" class="justify-content-start align-items-center d-flex d-md-none pr-0" v-if="settings.left_handed">
<b-col cols="2" md="2" class="justify-content-start align-items-center d-flex d-md-none pr-0" v-if="settings.left_handed">
<input type="checkbox" class="form-control form-control-sm checkbox-control-mobile" :checked="formatChecked" @change="updateChecked" :key="entries[0].id" />
<b-button size="sm" @click="showDetails = !showDetails" class="d-inline-block d-md-none p-0" variant="link">
<div class="text-nowrap"><i class="fa fa-chevron-right rotate" :class="showDetails ? 'rotated' : ''"></i></div>
</b-button>
</b-col>
<b-col cols="1" md="1" class="align-items-center d-flex">
<b-col cols="1" class="align-items-center d-flex">
<div class="dropdown b-dropdown position-static inline-block" data-html2canvas-ignore="true" @click.stop="$emit('open-context-menu', $event, entries)">
<button
aria-haspopup="true"
@ -23,7 +23,7 @@
<b-col cols="1" class="px-1 justify-content-center align-items-center d-none d-md-flex">
<input type="checkbox" class="form-control form-control-sm checkbox-control" :checked="formatChecked" @change="updateChecked" :key="entries[0].id" />
</b-col>
<b-col cols="8" md="9">
<b-col cols="8" >
<b-row class="d-flex h-100">
<b-col cols="6" md="3" class="d-flex align-items-center" v-if="Object.entries(formatAmount).length == 1">
<strong class="mr-1">{{ Object.entries(formatAmount)[0][1] }}</strong> {{ Object.entries(formatAmount)[0][0] }}
@ -47,7 +47,7 @@
</b-col>
</b-row>
</b-col>
<b-col cols="3" md="2" class="justify-content-start align-items-center d-flex d-md-none" v-if="!settings.left_handed">
<b-col cols="2" class="justify-content-start align-items-center d-flex d-md-none pl-0 pr-0" v-if="!settings.left_handed">
<b-button size="sm" @click="showDetails = !showDetails" class="d-inline-block d-md-none p-0" variant="link">
<div class="text-nowrap"><i class="fa fa-chevron-right rotate" :class="showDetails ? 'rotated' : ''"></i></div>
</b-button>

View File

@ -381,5 +381,8 @@
"Keyword": "Keyword",
"Advanced": "Advanced",
"Page": "Page",
"Reset": "Reset"
"Reset": "Reset",
"Create Food": "Create Food",
"create_food_desc": "Create a food and link it to this recipe.",
"additional_options": "Additional Options"
}

View File

@ -109,7 +109,7 @@
"Settings": "Asetukset",
"or": "tai",
"and": "ja",
"Information": "Informaatio",
"Information": "Tiedot",
"Download": "Lataa",
"Create": "Luo",
"Advanced Search Settings": "Tarkennetun Haun Asetukset",
@ -122,21 +122,21 @@
"move_confirmation": "Siirrä <i>{child}</i> yläluokkaan <i>{parent}</i>",
"merge_confirmation": "Korvaa <i>{source}</i> esiintymiset <i>{target}:lla</i>",
"create_rule": "ja luo automaatio",
"move_selection": "Valitse yläluokka {type} johon {suorce} siirretään.",
"move_selection": "Valitse yläluokka {type} johon {source} siirretään.",
"merge_selection": "Korvaa kaikki {source} esiintymiset valitulla {type}:llä.",
"Root": "Root",
"Ignore_Shopping": "Ohita Ostokset",
"Shopping_Category": "Ostosluokka",
"Edit_Food": "Muokkaa Ruokaa",
"Move_Food": "Siirrä Ruoka",
"New_Food": "Uusi Ruoka",
"Hide_Food": "Piilota Ruoka",
"Food_Alias": "Ruoan Nimimerkki",
"Unit_Alias": "Yksikkö alias",
"Keyword_Alias": "Avainsana alias",
"Delete_Food": "Poista Ruoka",
"Edit_Food": "Muokkaa ruokaa",
"Move_Food": "Siirrä ruoka",
"New_Food": "Uusi ruoka",
"Hide_Food": "Piilota ruoka",
"Food_Alias": "Ruoan nimimerkki",
"Unit_Alias": "Yksikköalias",
"Keyword_Alias": "Avainsana-alias",
"Delete_Food": "Poista ruoka",
"No_ID": "Poistaminen epäonnistui, ID:tä ei löytynyt.",
"Meal_Plan_Days": "Tulevat Ruokasuunnitelmat",
"Meal_Plan_Days": "Tulevat ruokasuunnitelmat",
"merge_title": "Yhdistä {type}",
"move_title": "Siirrä {type}",
"Food": "Ruoka",
@ -206,5 +206,11 @@
"Auto_Planner": "Automaattinen Suunnittelija",
"New_Cookbook": "Uusi keittokirja",
"Hide_Keyword": "Piilota avainsana",
"Clear": "Pyyhi"
"Clear": "Pyyhi",
"err_moving_resource": "Resurssin siirtämisessä tapahtui virhe!",
"err_merging_resource": "Resurssin yhdistämisessä tapahtui virhe!",
"success_moving_resource": "Resurssin siirto onnistui!",
"success_merging_resource": "Resurssin yhdistäminen onnistui!",
"Search Settings": "Hakuasetukset",
"Shopping_Categories": "Ostoskategoriat"
}

View File

@ -285,5 +285,49 @@
"Create_Meal_Plan_Entry": "Créer une entrée de menu",
"RemoveFoodFromShopping": "Retirer lingrédient {food} de votre liste de courses",
"left_handed": "Mode gaucher",
"left_handed_help": "Optimise linterface utilisateur pour une utilisation avec la main gauche."
"left_handed_help": "Optimise linterface utilisateur pour une utilisation avec la main gauche.",
"Custom Filter": "Filtre personnalisé",
"shared_with": "Partagé avec",
"sort_by": "Trié par",
"desc": "Ordre décroissant",
"date_created": "Créé le",
"make_now": "Cuisiner maintenant",
"copy_to_new": "Copier dans une nouvelle recette",
"recipe_name": "Nom de la recette",
"paste_ingredients_placeholder": "Copier la liste d'ingrédients ici...",
"paste_ingredients": "Copier les ingrédients",
"ingredient_list": "Liste des ingrédients",
"search_no_recipes": "Aucune recettes trouvées !",
"substitute_siblings_help": "Tous les ingrédients qui partagent un parent avec cette ingrédient sont considérés comme des substituts.",
"OnHand_help": "L'ingrédient est dans l'inventaire et ne sera pas automatiquement ajouté à la liste de courses. Le status actuel est partagé avec les utilisateurs de la liste.",
"ignore_shopping_help": "Ne jamais ajouter l'ingrédient à la liste de courses (ex: eau)",
"food_recipe_help": "Ajouter un lien vers la recette ici incluera cette recette dans n'importe qu'elle autre recette qui utilise cet ingrédient",
"shopping_category_help": "Les supermarchés peuvent être triés et filtrés par catégorie d'ingrédients selon la disposition des rayons.",
"Units": "Unités",
"view_recipe": "Voir la recette",
"review_shopping": "Vérifier les éléments de la liste avant de sauvegarder",
"Select": "Sélectionner",
"Supermarkets": "Supermarchés",
"User": "Utilisateur",
"Keyword": "Mot-clé",
"Foods": "Ingrédients",
"enable_expert": "Activer le mode expert",
"show_rating": "Afficher les notes",
"asc": "Ordre croissant",
"book_filter_help": "Inclure les recettes filtrés en plus de celles ajoutées manuellement.",
"search_import_help_text": "Importer une recette depuis un site ou application externe.",
"search_create_help_text": "Créer une nouvelle recette directement dans Tandoor.",
"substitute_help": "Les substituts sont pris en compte lors d'une recherche de recettes pouvant être cuisinées avec les ingrédients disponibles.",
"remember_search": "Enregistrer la recherche",
"expert_mode": "Mode expert",
"simple_mode": "Mode simplifié",
"advanced": "Avancé",
"fields": "Champs",
"show_keywords": "Afficher les mots-clés",
"show_foods": "Afficher les ingrédients",
"show_books": "Afficher les livres",
"show_units": "Afficher les unités",
"show_filters": "Afficher les filtres",
"save_filter": "Sauvegarder le filtre",
"filter_name": "Filtrer par nom"
}

View File

@ -349,8 +349,8 @@
"ChildInheritFields_help": "",
"InheritFields_help": "",
"last_viewed": "",
"created_on": "",
"updatedon": "",
"created_on": "Criado em",
"updatedon": "Atualizado em",
"advanced_search_settings": "",
"nothing_planned_today": "",
"no_pinned_recipes": "",
@ -358,7 +358,7 @@
"Pinned": "",
"Quick actions": "",
"Ratings": "",
"Internal": "",
"Internal": "Interno",
"Units": "",
"Random Recipes": "",
"parameter_count": "",
@ -372,7 +372,7 @@
"empty_list": "",
"Select": "",
"Supermarkets": "",
"User": "",
"User": "Utilizador",
"Keyword": "",
"Advanced": "",
"Page": "",

View File

@ -1,11 +1,11 @@
{
"import_running": "Import pågår, var god vänta!",
"import_running": "Importering pågår, var god vänta!",
"all_fields_optional": "Alla rutor är valfria och kan lämnas tomma.",
"convert_internal": "Konvertera till internt recept",
"Log_Recipe_Cooking": "Logga tillagningen av receptet",
"External_Recipe_Image": "Externt receptbild",
"External_Recipe_Image": "Extern receptbild",
"Add_to_Book": "Lägg till i kokbok",
"Add_to_Shopping": "Lägg till i handelslista",
"Add_to_Shopping": "Lägg till i inköpslista",
"Add_to_Plan": "Lägg till i matsedel",
"Step_start_time": "Steg starttid",
"Select_Book": "Välj kokbok",
@ -17,7 +17,7 @@
"Fats": "Fett",
"Carbohydrates": "Kolhydrater",
"Calories": "Kalorier",
"Energy": "",
"Energy": "Energi",
"Nutrition": "Näringsinnehåll",
"Date": "Datum",
"Share": "Dela",
@ -37,5 +37,185 @@
"Search": "Sök",
"Import": "Importera",
"Print": "Skriv ut",
"Information": "Information"
"Information": "Information",
"Link": "Länk",
"Copy": "Kopiera",
"Key_Ctrl": "Ctrl",
"Sort_by_new": "Sortera efter ny",
"Recipes_per_page": "Recept per sida",
"Table_of_Contents": "Innehållsförteckning",
"Books": "Böcker",
"New_Recipe": "Nytt recept",
"Recently_Viewed": "Nyligen visade",
"create_rule": "och skapa automation",
"Root": "Rot",
"External": "Extern",
"Settings": "Inställningar",
"New": "Ny",
"Meal_Plan": "Måltidsplanering",
"Categories": "Kategorier",
"Category": "Kategori",
"Selected": "Vald",
"Supermarket": "Mataffär",
"Files": "Filer",
"Size": "Storlek",
"err_creating_resource": "Det uppstod ett fel när en resurs skulle skapas!",
"err_updating_resource": "Det uppstod ett fel när en resurs skulle uppdateras!",
"err_fetching_resource": "Det uppstod ett fel när en resurs skulle hämtas!",
"success_fetching_resource": "En resurs har hämtats!",
"err_deleting_resource": "Det uppstod ett fel när en resurs skulle tas bort!",
"success_updating_resource": "En resurs har uppdaterats!",
"Remove_nutrition_recipe": "Ta bort näring från receptet",
"Add_nutrition_recipe": "Lägg till näring till receptet",
"New_Keyword": "Nytt nyckelord",
"Automation": "Automatisering",
"Parameter": "Parameter",
"Download": "Ladda ned",
"and": "och",
"Ok": "Öppna",
"Create": "Skapa",
"Ignore_Shopping": "Ignorera handling",
"or": "eller",
"Create_New_Keyword": "Lägg till nytt nyckelord",
"No_Results": "Inget resultat",
"New_Unit": "Ny enhet",
"create_title": "Ny {type}",
"Drag_Here_To_Delete": "Dra hit för att radera",
"Meal_Type_Required": "Måltidstyp är obligatorisk",
"Clone": "Klona",
"Reset_Search": "Rensa sök",
"Title_or_Recipe_Required": "Val av titel eller recept krävs",
"success_creating_resource": "En resurs har skapats!",
"Time": "Tid",
"Text": "Text",
"Empty": "Tom",
"and_up": "& ned",
"Cancel": "Avbryt",
"Failure": "Misslyckas",
"File": "Fil",
"Delete": "Radera",
"edit_title": "Redigera {type}",
"Description": "Beskrivning",
"Recipe": "Recept",
"Icon": "Ikon",
"Unit": "Enhet",
"Name": "Namn",
"Type": "Typ",
"No_ID": "ID hittades inte, kan inte radera.",
"Create_New_Unit": "Lägg till enhet",
"Export_As_ICal": "Exportera nuvarande period till iCal format",
"Auto_Planner": "Autoplanera",
"Show_as_header": "Visa som rubrik",
"Hide_as_header": "Göm som rubrik",
"Copy_template_reference": "Kopiera mallreferens",
"Save_and_View": "Spara & visa",
"step_time_minutes": "Stegets tid i minuter",
"Url_Import": "Länk import",
"Delete_Keyword": "Ta bort nyckelord",
"Edit_Keyword": "Redigera nyckelord",
"confirm_delete": "Är du säker på att du vill radera detta {object}?",
"Move_Keyword": "Flytta nyckelord",
"Edit_Recipe": "Redigera recept",
"Merge_Keyword": "Slå samman nyckelord",
"Hide_Keywords": "Dölj nyckelord",
"Hide_Recipes": "Dölj recept",
"Move_Up": "Flytta upp",
"Move_Down": "Flytta ned",
"Step_Name": "Stegets namn",
"Step_Type": "Stegets typ",
"Make_Ingredient": "Skapa ingrediens",
"Enable_Amount": "Aktivera belopp",
"Disable_Amount": "Inaktivera belopp",
"move_title": "Flytta {type}",
"merge_title": "Slå samman {type}",
"Food": "Mat",
"Key_Shift": "Shift",
"Instructions": "Instruktioner",
"and_down": "& up",
"Added_by": "Tillagd av",
"Title": "Titel",
"Week": "Vecka",
"Month": "Månad",
"Year": "År",
"Period": "Period",
"Undefined": "Odefinierad",
"Periods": "Perioder",
"Plan_Period_To_Show": "Visa veckor, månader eller år",
"Color": "Färg",
"Plan_Show_How_Many_Periods": "Hur många perioder ska visas",
"Starting_Day": "Startdag i veckan",
"Meal_Types": "Måltidstyper",
"Meal_Type": "Måltidstyp",
"New_Meal_Type": "Ny måltidstyp",
"AddFoodToShopping": "Lägg till {food} på din inköpslista",
"RemoveFoodFromShopping": "Ta bort {mat} från din inköpslista",
"DeleteShoppingConfirm": "Är du säker på att du vill ta bort all {food} från inköpslistan?",
"Week_Numbers": "Veckonummer",
"Show_Week_Numbers": "Visa veckonummer?",
"Export_To_ICal": "Exportera .ics",
"Next_Day": "Nästa dag",
"Previous_Day": "Föregående dag",
"GroupBy": "Gruppera enligt",
"Next_Period": "Nästa period",
"Previous_Period": "Föregående period",
"Current_Period": "Nuvarande period",
"Inherit": "Ärva",
"InheritFields": "Ärv fältvärden",
"NoCategory": "Ingen kategori vald.",
"show_split_screen": "Delad vy",
"Warning": "Varning",
"Reset": "Återställa",
"select_unit": "Välj enhet",
"select_food": "Välj mat",
"remove_selection": "Avmarkera",
"Select": "Välj",
"Supermarkets": "Mataffärer",
"User": "Användare",
"Keyword": "Nyckelord",
"Advanced": "Avancerat",
"Page": "Sida",
"select_keyword": "Välj nyckelord",
"add_keyword": "Lägg till nyckelord",
"select_file": "Välj fil",
"select_recipe": "Välj recept",
"Units": "Enheter",
"last_viewed": "Senast visad",
"empty_list": "Listan är tom.",
"Load_More": "Ladda mer",
"Make_Header": "Skapa rubrik",
"err_moving_resource": "Det uppstod ett fel när en resurs skulle flyttas!",
"err_merging_resource": "Det uppstod ett fel när en resurs skulle slås ihop!",
"success_moving_resource": "En resurs har flyttats!",
"success_merging_resource": "En resurs har slagits samman!",
"Select_File": "Välj fil",
"Add_Step": "Lägg till steg",
"Note": "Anteckning",
"Success": "Lyckas",
"Image": "Bild",
"View": "Visa",
"Recipes": "Recept",
"Merge": "Slå samman",
"delete_confirmation": "Är du säker på att du vill radera {source}?",
"delete_title": "Radera {type}",
"Keyword_Alias": "Nyckelord alias",
"Recipe_Book": "Receptbok",
"Search Settings": "Sökinställningar",
"warning_feature_beta": "Den här funktionen är för närvarande i ett BETA-läge (testning). Vänligen förvänta dig buggar och eventuellt brytande ändringar i framtiden (möjligen att förlora funktionsrelaterad data) när du använder den här funktionen.",
"success_deleting_resource": "En resurs har raderats!",
"file_upload_disabled": "Filuppladdning är inte aktiverat för ditt utrymme.",
"show_only_internal": "Visa endast interna recept",
"Manage_Books": "Hantera böcker",
"Keywords": "Nyckelord",
"Move": "Flytta",
"Parent": "Förälder",
"merge_selection": "Ersätt alla förekomster av {source} med den valda {type}.",
"Shopping_Category": "Shopping kategori",
"move_selection": "Välj en förälder {type} att flytta {source} till.",
"Create_New_Shopping Category": "Skapa ny shoppingkategori",
"Create_New_Meal_Type": "Lägg till ny måltidstyp",
"tree_root": "Roten av trädet",
"Meal_Plan_Days": "Framtida måltidsplaner",
"Automate": "Automatisera",
"Shopping_Categories": "Shopping kategorier",
"Unit_Alias": "Enhetsalias"
}