From 556dfbfe538787b0b71a4f84e783fd9eb15464a5 Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Wed, 28 Apr 2021 08:56:04 -0800 Subject: [PATCH 1/7] New Crowdin updates (#361) * New translations en-US.json (Polish) * New translations en-US.json (Polish) * New translations en-US.json (Polish) * New translations en-US.json (German) --- frontend/src/locales/messages/de-DE.json | 4 +- frontend/src/locales/messages/pl-PL.json | 280 +++++++++++------------ 2 files changed, 142 insertions(+), 142 deletions(-) diff --git a/frontend/src/locales/messages/de-DE.json b/frontend/src/locales/messages/de-DE.json index d76054bf3..6117e0e80 100644 --- a/frontend/src/locales/messages/de-DE.json +++ b/frontend/src/locales/messages/de-DE.json @@ -152,7 +152,7 @@ "exclude": "Ausschließen", "include": "Einbeziehen", "or": "Oder", - "and": "and", + "and": "und", "search": "Suchen", "tag-filter": "Schlagwortfilter" }, @@ -221,7 +221,7 @@ }, "toolbox": { "toolbox": "Toolbox", - "new-name": "New Name", + "new-name": "Neuer Name", "recipes-effected": "Recipes Effected", "title-case-all": "Title Case All", "no-unused-items": "No Unused Items", diff --git a/frontend/src/locales/messages/pl-PL.json b/frontend/src/locales/messages/pl-PL.json index 0d9d3db81..338d502ad 100644 --- a/frontend/src/locales/messages/pl-PL.json +++ b/frontend/src/locales/messages/pl-PL.json @@ -4,65 +4,65 @@ "take-me-home": "Powrót na stronę główną" }, "about": { - "about-mealie": "About Mealie", - "api-docs": "API Docs", - "api-port": "API Port", - "application-mode": "Application Mode", - "database-type": "Database Type", - "default-group": "Default Group", + "about-mealie": "O Mealie", + "api-docs": "Dokumentacja API", + "api-port": "Port API", + "application-mode": "Tryb aplikacji", + "database-type": "Rodzaj bazy danych", + "default-group": "Domyślna grupa", "demo": "Demo", - "demo-status": "Demo Status", - "development": "Development", - "not-demo": "Not Demo", - "production": "Production", - "sqlite-file": "SQLite File", - "version": "Version" + "demo-status": "Status demo", + "development": "Wersja testowa", + "not-demo": "Nie demo", + "production": "Produkcyjna", + "sqlite-file": "Plik SQLite'a", + "version": "Wersja" }, "general": { - "apply": "Apply", + "apply": "Zastosuj", "cancel": "Anuluj", "close": "Zamknij", "confirm": "Potwierdź", "create": "Utwórz", - "current-parenthesis": "(Current)", + "current-parenthesis": "(Bieżący)", "delete": "Usuń", - "disabled": "Disabled", + "disabled": "Wyłączone", "download": "Pobierz", "edit": "Edytuj", "enabled": "Włączone", - "field-required": "Field Required", - "filter": "Filter", - "friday": "Friday", - "get": "Get", - "groups": "Groups", + "field-required": "Pole jest wymagane", + "filter": "Filtruj", + "friday": "Piątek", + "get": "Zastosuj", + "groups": "Grupy", "import": "Importuj", - "monday": "Monday", + "monday": "Poniedziałek", "name": "Nazwa", - "no": "No", + "no": "Nie", "ok": "OK", "options": "Opcje", "random": "Losowa", - "recent": "Recent", + "recent": "Najnowsze", "recipes": "Przepisy", - "reset": "Reset", - "saturday": "Saturday", + "reset": "Resetuj", + "saturday": "Sobota", "save": "Zapisz", "settings": "Ustawienia", - "sort": "Sort", + "sort": "Sortuj", "sort-alphabetically": "A-Z", "submit": "Zatwierdź", - "sunday": "Sunday", + "sunday": "Niedziela", "templates": "Szablony", "themes": "Motywy", - "thursday": "Thursday", + "thursday": "Czwartek", "token": "Token", - "tuesday": "Tuesday", + "tuesday": "Wtorek", "update": "Uaktualnij", - "upload": "Wrzuć", + "upload": "Prześlij", "url": "URL", - "users": "Users", - "wednesday": "Wednesday", - "yes": "Yes" + "users": "Użytkownicy", + "wednesday": "Środa", + "yes": "Tak" }, "meal-plan": { "create-a-new-meal-plan": "Utwórz nowy plan posiłku", @@ -70,13 +70,13 @@ "dinner-today": "Obiad dziś", "edit-meal-plan": "Edytuj plan posiłku", "end-date": "Data zakończenia", - "group": "Group (Beta)", - "meal-planner": "Meal Planner", + "group": "Grupa (Beta)", + "meal-planner": "Plan posiłków", "meal-plans": "Plany posiłku", - "only-recipes-with-these-categories-will-be-used-in-meal-plans": "Only recipes with these categories will be used in Meal Plans", + "only-recipes-with-these-categories-will-be-used-in-meal-plans": "Tylko przepisy z tych kategorii będą używane w planach posiłków", "planner": "Planer", - "quick-week": "Quick Week", - "shopping-list": "Shopping List", + "quick-week": "Szybki plan na tydzień", + "shopping-list": "Lista zakupów", "start-date": "Data rozpoczęcia" }, "migration": { @@ -93,73 +93,73 @@ }, "new-recipe": { "bulk-add": "Dodanie zbiorcze", - "error-message": "Wygląda na to, że wystąpił błąd. Sprawdź log i debug/last_recipe.json aby zasięgnąć po więcej informacji.", - "from-url": "Z odnośnika", - "paste-in-your-recipe-data-each-line-will-be-treated-as-an-item-in-a-list": "Przeklej zawartość przepisu. Każda indywidualna linia traktowana będzie jako pozycja na liście", - "recipe-url": "Odnośnik przepisu", - "url-form-hint": "Copy and paste a link from your favorite recipe website" + "error-message": "Wygląda na to, że wystąpił błąd. Sprawdź log i debug/last_recipe.json aby sprawdzić co poszło nie tak.", + "from-url": "Importuj przepis", + "paste-in-your-recipe-data-each-line-will-be-treated-as-an-item-in-a-list": "Wklej zawartość przepisu. Każda indywidualna linia traktowana będzie jako pozycja na liście", + "recipe-url": "Adres URL przepisu", + "url-form-hint": "Skopiuj i wklej link ze swojej ulubionej strony z przepisami" }, "page": { - "all-recipes": "All Recipes", - "home-page": "Home Page", - "recent": "Recent" + "all-recipes": "Wszystkie przepisy", + "home-page": "Strona Główna", + "recent": "Najnowsze" }, "recipe": { "add-key": "Dodaj klucz", "api-extras": "Dodatki API", - "calories": "Calories", - "calories-suffix": "calories", + "calories": "Kalorie", + "calories-suffix": "kalorie", "categories": "Kategorie", "delete-confirmation": "Czy jesteś pewien, że chcesz usunąć ten przepis?", "delete-recipe": "Usuń przepis", "description": "Opis", - "fat-content": "Fat Content", - "fiber-content": "Fiber Content", - "grams": "grams", - "image": "Image", + "fat-content": "Zawartość tłuszczu", + "fiber-content": "Zawartość błonnika", + "grams": "gram", + "image": "Zdjęcie", "ingredient": "Składnik", "ingredients": "Składniki", "instructions": "Instrukcje", "key-name-required": "Nazwa klucza jest wymagana", - "milligrams": "milligrams", + "milligrams": "miligram", "new-key-name": "Nazwa nowego klucza", "no-white-space-allowed": "Znaki niedrukowalne są niedozwolone", "note": "Notatka", "notes": "Notatki", - "nutrition": "Nutrition", + "nutrition": "Wartości odżywcze", "object-key": "Klucz obiektu", "object-value": "Wartość obiektu", - "original-url": "Oryginalny odnośnik", + "original-url": "Oryginalny adres URL", "perform-time": "Czas gotowania", "prep-time": "Czas przyrządzania", - "protein-content": "Protein Content", - "recipe-image": "Recipe Image", + "protein-content": "Zawartość białka", + "recipe-image": "Zdjęcie do przepisu", "recipe-name": "Nazwa przepisu", "servings": "Porcje", - "sodium-content": "Sodium Content", + "sodium-content": "Zawartość sodu", "step-index": "Krok: {step}", - "sugar-content": "Sugar Content", - "tags": "Etykiety", + "sugar-content": "Zawartość cukrów", + "tags": "Tagi", "title": "Tytuł", "total-time": "Czas całkowity", "view-recipe": "Wyświetl przepis" }, "search": { - "search-mealie": "Search Mealie (press /)", - "search-placeholder": "Search...", - "max-results": "Max Results", - "category-filter": "Category Filter", - "exclude": "Exclude", - "include": "Include", - "or": "Or", - "and": "and", - "search": "Search", - "tag-filter": "Tag Filter" + "search-mealie": "Przeszukaj Mealie (naciśnij /)", + "search-placeholder": "Szukaj...", + "max-results": "Maksymalna liczba wyników", + "category-filter": "Filtr kategorii", + "exclude": "Wyklucz", + "include": "Dołącz", + "or": "Lub", + "and": "oraz", + "search": "Szukaj", + "tag-filter": "Filtr tagów" }, "settings": { "add-a-new-theme": "Dodaj nowy motyw", - "admin-settings": "Admin Settings", - "available-backups": "Dostępne kopie zapsowe", + "admin-settings": "Ustawienia administratora", + "available-backups": "Dostępne kopie zapasowe", "backup": { "backup-tag": "Etykieta kopii zapasowej", "create-heading": "Utwórz kopię zapasową", @@ -167,43 +167,43 @@ "partial-backup": "Częściowa kopia zapasowa" }, "backup-and-exports": "Kopie zapasowe", - "backup-info": "Kopie zapasowe zapisywane są w standardowym formacie JSON wraz ze zdjęciami w systemie plików. W katalogu kopii zapasowej znajdziesz plik z rozszerzeniem .zip zawierający wszystkie przepisy i zdjęcia z bazy danych. Jeśli oznaczone zostały pliki markdown, one także znajdą się w pliku .zip. Aby zaimportować kopię, musi ona znajdować się w folderze kopii zapasowych. Kopie automatyczne tworzone są codziennie o godzinie 03:00.", - "change-password": "Change Password", + "backup-info": "Kopie zapasowe zapisywane są w standardowym formacie JSON wraz ze zdjęciami w systemie plików. W katalogu kopii zapasowej znajdziesz plik z rozszerzeniem .zip zawierający wszystkie przepisy i zdjęcia z bazy danych. Jeśli zaznaczone zostały pliki markdown, one także znajdą się w pliku .zip. Aby zaimportować kopię, musi ona znajdować się w folderze kopii zapasowych. Kopie automatyczne tworzone są codziennie o godzinie 03:00.", + "change-password": "Zmień hasło", "current": "Wersja:", - "custom-pages": "Custom Pages", - "edit-page": "Edit Page", - "first-day-of-week": "First day of the week", + "custom-pages": "Niestandardowe strony", + "edit-page": "Edytuj stronę", + "first-day-of-week": "Pierwszy dzień tygodnia", "homepage": { - "all-categories": "All Categories", - "card-per-section": "Card Per Section", - "home-page": "Home Page", - "home-page-sections": "Home Page Sections", - "show-recent": "Show Recent" + "all-categories": "Wszystkie kategorie", + "card-per-section": "Karty na sekcję", + "home-page": "Strona Główna", + "home-page-sections": "Sekcje strony głównej", + "show-recent": "Pokaż najnowsze" }, "language": "Język", "latest": "Najnowsza", "local-api": "Lokalne API", - "locale-settings": "Locale settings", - "manage-users": "Manage Users", - "migrations": "Migrations", - "new-page": "New Page", - "page-name": "Page Name", - "profile": "Profile", - "remove-existing-entries-matching-imported-entries": "Remove existing entries matching imported entries", + "locale-settings": "Ustawienia językowe", + "manage-users": "Zarządzaj użytkownikami", + "migrations": "Migracje", + "new-page": "Nowa Strona", + "page-name": "Nazwa strony", + "profile": "Profil", + "remove-existing-entries-matching-imported-entries": "Usuń istniejące wpisy pasujące do importowanych wpisów", "set-new-time": "Ustaw nowy czas", - "site-settings": "Site Settings", + "site-settings": "Ustawienia strony", "theme": { "accent": "Akcent", "are-you-sure-you-want-to-delete-this-theme": "Czy jesteś pewien, że chcesz usunąć ten motyw?", "choose-how-mealie-looks-to-you-set-your-theme-preference-to-follow-your-system-settings-or-choose-to-use-the-light-or-dark-theme": "Wybierz jak Mealie ma dla Ciebie wyglądać. Dostępne opcje to podążanie za odcieniem systemowym, bądź motyw jasny lub ciemny.", "dark": "Ciemny", "dark-mode": "Ciemny motyw", - "default-to-system": "Domyślny dla systemu", + "default-to-system": "Motyw systemowy", "delete-theme": "Usuń motyw", "error": "Błąd", "info": "Informacja", "light": "Jasny", - "primary": "Pierwszorzędny", + "primary": "Podstawowy", "secondary": "Drugorzędny", "select-a-theme-from-the-dropdown-or-create-a-new-theme-note-that-the-default-theme-will-be-served-to-all-users-who-have-not-set-a-theme-preference": "Wybierz motyw z rozwijanej listy bądź stwórz nowy. Domyślny motyw zostanie użyty dla wszystkich użytkowników którzy nie wybrali własnej preferencji.", "success": "Powodzenie", @@ -217,63 +217,63 @@ "meal-planner-webhooks": "Webhooki planera posiłków", "test-webhooks": "Testuj webhooki", "the-urls-listed-below-will-recieve-webhooks-containing-the-recipe-data-for-the-meal-plan-on-its-scheduled-day-currently-webhooks-will-execute-at": "Odnośniki poniżej otrzymają webhook zawierający dane o przepisie dla danego dnia. Aktualnie webhooki zostanę wykonane o", - "webhook-url": "Odnośnik webhooka" + "webhook-url": "URL webhooka" }, "toolbox": { - "toolbox": "Toolbox", - "new-name": "New Name", - "recipes-effected": "Recipes Effected", + "toolbox": "Przybornik", + "new-name": "Nowa nazwa", + "recipes-effected": "Objęte przepisy", "title-case-all": "Title Case All", - "no-unused-items": "No Unused Items", - "remove-unused": "Remove Unused", - "assign-all": "Assign All", - "bulk-assign": "Bulk Assign" + "no-unused-items": "Brak nieużywanych elementów", + "remove-unused": "Usuń nieużywane", + "assign-all": "Przypisz wszystkie", + "bulk-assign": "Masowe przypisanie" } }, "user": { - "admin": "Admin", - "are-you-sure-you-want-to-delete-the-group": "Are you sure you want to delete {groupName}?", - "are-you-sure-you-want-to-delete-the-link": "Are you sure you want to delete the link {link}?", - "are-you-sure-you-want-to-delete-the-user": "Are you sure you want to delete the user {activeName} ID: {activeId}?", - "confirm-group-deletion": "Confirm Group Deletion", - "confirm-link-deletion": "Confirm Link Deletion", - "confirm-password": "Confirm Password", - "confirm-user-deletion": "Confirm User Deletion", - "could-not-validate-credentials": "Could Not Validate Credentials", - "create-group": "Create Group", - "create-link": "Create Link", - "create-user": "Create User", - "current-password": "Current Password", - "e-mail-must-be-valid": "E-mail must be valid", - "edit-user": "Edit User", + "admin": "Administrator", + "are-you-sure-you-want-to-delete-the-group": "Czy na pewno chcesz usunąć {groupName}?", + "are-you-sure-you-want-to-delete-the-link": "Czy na pewno chcesz usunąć link {link}?", + "are-you-sure-you-want-to-delete-the-user": "Czy na pewno chcesz usunąć użytkownika {activeName} ID: {activeId}?", + "confirm-group-deletion": "Potwierdź usunięcie grupy", + "confirm-link-deletion": "Potwierdź usunięcie linku", + "confirm-password": "Potwierdź hasło", + "confirm-user-deletion": "Potwierdź usunięcie użytkownika", + "could-not-validate-credentials": "Nie można zweryfikować danych logowania", + "create-group": "Utwórz Grupę", + "create-link": "Utwórz link", + "create-user": "Utwórz użytkownika", + "current-password": "Obecne hasło", + "e-mail-must-be-valid": "E-mail musi być poprawny", + "edit-user": "Edytuj użytkownika", "email": "Email", - "full-name": "Full Name", - "group": "Group", - "group-id-with-value": "Group ID: {groupID}", - "group-name": "Group Name", - "groups": "Groups", - "groups-can-only-be-set-by-administrators": "Groups can only be set by administrators", - "link-id": "Link ID", - "link-name": "Link Name", + "full-name": "Imię i nazwisko", + "group": "Grupa", + "group-id-with-value": "ID grupy: {groupID}", + "group-name": "Nazwa grupy", + "groups": "Grupy", + "groups-can-only-be-set-by-administrators": "Grupy mogą być ustawiane tylko przez administratorów", + "link-id": "ID linku", + "link-name": "Nazwa linku", "login": "Login", - "logout": "Logout", - "new-password": "New Password", - "new-user": "New User", + "logout": "Wyloguj się", + "new-password": "Nowe Hasło", + "new-user": "Nowy użytkownik", "password": "Hasło", - "password-must-match": "Password must match", - "reset-password": "Reset Password", + "password-must-match": "Hasła muszą być takie same", + "reset-password": "Zresetuj hasło", "sign-in": "Zaloguj się", - "sign-up-links": "Sign Up Links", - "total-mealplans": "Total MealPlans", - "total-users": "Total Users", - "upload-photo": "Upload Photo", - "use-8-characters-or-more-for-your-password": "Use 8 characters or more for your password", - "user-group": "User Group", - "user-id": "User ID", - "user-id-with-value": "User ID: {id}", - "user-password": "User Password", - "users": "Users", - "webhook-time": "Webhook Time", - "webhooks-enabled": "Webhooks Enabled" + "sign-up-links": "Linki do rejestracji", + "total-mealplans": "Ilość planów posiłków", + "total-users": "Ilość użytkowników", + "upload-photo": "Prześlij zdjęcie", + "use-8-characters-or-more-for-your-password": "Hasło musi składać się z 8 lub więcej znaków", + "user-group": "Grupa użytkownika", + "user-id": "ID użytkownika", + "user-id-with-value": "ID użytkownika: {id}", + "user-password": "Hasło użytkownika", + "users": "Użytkownicy", + "webhook-time": "Czas webhooka", + "webhooks-enabled": "Webhooki włączone" } } \ No newline at end of file From 1b2f7f26758153b604dfdf487ebf201027cfa622 Mon Sep 17 00:00:00 2001 From: sephrat <34862846+sephrat@users.noreply.github.com> Date: Wed, 28 Apr 2021 19:47:33 +0200 Subject: [PATCH 2/7] Remove dead code (#362) * Remove BackupCard.vue Unused - moved to NewBackupCard.vue * Remove unused method --- .../src/pages/Admin/Backup/BackupCard.vue | 85 ------------------- frontend/src/pages/Admin/Backup/index.vue | 11 --- 2 files changed, 96 deletions(-) delete mode 100644 frontend/src/pages/Admin/Backup/BackupCard.vue diff --git a/frontend/src/pages/Admin/Backup/BackupCard.vue b/frontend/src/pages/Admin/Backup/BackupCard.vue deleted file mode 100644 index a4bbf99a9..000000000 --- a/frontend/src/pages/Admin/Backup/BackupCard.vue +++ /dev/null @@ -1,85 +0,0 @@ - - - - - \ No newline at end of file diff --git a/frontend/src/pages/Admin/Backup/index.vue b/frontend/src/pages/Admin/Backup/index.vue index c9a59e7f8..71090c196 100644 --- a/frontend/src/pages/Admin/Backup/index.vue +++ b/frontend/src/pages/Admin/Backup/index.vue @@ -71,17 +71,6 @@ export default { this.availableBackups = response.imports; this.availableTemplates = response.templates; }, - deleteBackup() { - if (this.$refs.form.validate()) { - this.backupLoading = true; - - api.backups.delete(this.selectedBackup); - this.getAvailableBackups(); - - this.selectedBackup = null; - this.backupLoading = false; - } - }, processFinished(data) { this.getAvailableBackups(); this.backupLoading = false; From 9abb6f10fd27c2417045e11f3f84f7de61c80f3c Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Wed, 28 Apr 2021 18:53:11 -0800 Subject: [PATCH 3/7] New Crowdin updates (#363) * New translations en-US.json (French) * New translations en-US.json (Polish) --- frontend/src/locales/messages/fr-FR.json | 16 ++++++++-------- frontend/src/locales/messages/pl-PL.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/frontend/src/locales/messages/fr-FR.json b/frontend/src/locales/messages/fr-FR.json index 90519673f..37c89604b 100644 --- a/frontend/src/locales/messages/fr-FR.json +++ b/frontend/src/locales/messages/fr-FR.json @@ -152,7 +152,7 @@ "exclude": "Exclure", "include": "Inclure", "or": "Ou", - "and": "and", + "and": "et", "search": "Rechercher", "tag-filter": "Filtre par mots-clés" }, @@ -220,14 +220,14 @@ "webhook-url": "Lien du webhook" }, "toolbox": { - "toolbox": "Toolbox", - "new-name": "New Name", + "toolbox": "Boîte à outils", + "new-name": "Nouveau nom", "recipes-effected": "Recipes Effected", - "title-case-all": "Title Case All", - "no-unused-items": "No Unused Items", - "remove-unused": "Remove Unused", - "assign-all": "Assign All", - "bulk-assign": "Bulk Assign" + "title-case-all": "Majuscules partout", + "no-unused-items": "Aucun élément inutilisé", + "remove-unused": "Supprimer orphelins", + "assign-all": "Assigner tout", + "bulk-assign": "Assigner en masse" } }, "user": { diff --git a/frontend/src/locales/messages/pl-PL.json b/frontend/src/locales/messages/pl-PL.json index 338d502ad..d37d32243 100644 --- a/frontend/src/locales/messages/pl-PL.json +++ b/frontend/src/locales/messages/pl-PL.json @@ -223,7 +223,7 @@ "toolbox": "Przybornik", "new-name": "Nowa nazwa", "recipes-effected": "Objęte przepisy", - "title-case-all": "Title Case All", + "title-case-all": "Wszędzie wielkie litery", "no-unused-items": "Brak nieużywanych elementów", "remove-unused": "Usuń nieużywane", "assign-all": "Przypisz wszystkie", From 04255e285f8ede731e90e29080f3415b171004cb Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Wed, 28 Apr 2021 18:59:37 -0800 Subject: [PATCH 4/7] feature/new-recipe-features (#360) * unify button styles * fix drag on mobile * recipe instructions section * add carbs * refactor component location * asset start * consolidate view/edit components * asset api * base dialog event * Remove 'content' * remove console.log * add slug prop * remove console.log * recipe assets first pass * add recipeSettings model * fix hide/show when no tags/categories * fix typo Co-authored-by: hay-kot --- .gitignore | 1 + frontend/src/api/recipe.js | 12 ++ .../Recipe/RecipeEditor/BulkAdd.vue | 64 ------ .../Recipe/RecipeEditor/ExtrasEditor.vue | 104 ---------- .../Recipe/RecipeEditor/ImageUploadBtn.vue | 75 ------- .../Recipe/RecipeEditor/NutritionEditor.vue | 81 -------- .../components/Recipe/RecipeEditor/index.vue | 183 +++--------------- .../Recipe/RecipeViewer/Ingredients.vue | 62 ------ .../components/Recipe/RecipeViewer/Notes.vue | 36 ---- .../components/Recipe/RecipeViewer/Steps.vue | 67 ------- .../components/Recipe/RecipeViewer/index.vue | 55 ++++-- .../src/components/UI/Dialogs/BaseDialog.vue | 7 +- frontend/src/locales/messages/en-US.json | 12 +- .../CategoryTagEditor/RemoveUnused.vue | 1 - frontend/src/pages/Recipe/ViewRecipe.vue | 2 + frontend/src/store/modules/recipes.js | 2 - mealie/app.py | 3 +- mealie/db/models/recipe/assets.py | 22 +++ mealie/db/models/recipe/instruction.py | 1 + mealie/db/models/recipe/nutrition.py | 3 + mealie/db/models/recipe/recipe.py | 91 +++------ mealie/db/models/recipe/settings.py | 18 ++ mealie/routes/recipe/recipe_assets.py | 50 +++++ mealie/routes/recipe/recipe_crud_routes.py | 3 +- mealie/schema/recipe.py | 40 +++- 25 files changed, 246 insertions(+), 749 deletions(-) delete mode 100644 frontend/src/components/Recipe/RecipeEditor/BulkAdd.vue delete mode 100644 frontend/src/components/Recipe/RecipeEditor/ExtrasEditor.vue delete mode 100644 frontend/src/components/Recipe/RecipeEditor/ImageUploadBtn.vue delete mode 100644 frontend/src/components/Recipe/RecipeEditor/NutritionEditor.vue delete mode 100644 frontend/src/components/Recipe/RecipeViewer/Ingredients.vue delete mode 100644 frontend/src/components/Recipe/RecipeViewer/Notes.vue delete mode 100644 frontend/src/components/Recipe/RecipeViewer/Steps.vue create mode 100644 mealie/db/models/recipe/assets.py create mode 100644 mealie/db/models/recipe/settings.py create mode 100644 mealie/routes/recipe/recipe_assets.py diff --git a/.gitignore b/.gitignore index 3b2646bfc..b0c415482 100644 --- a/.gitignore +++ b/.gitignore @@ -159,3 +159,4 @@ scratch.py dev/data/backups/dev_sample_data*.zip dev/data/backups/dev_sample_data*.zip !dev/data/backups/test*.zip +dev/data/recipes/* diff --git a/frontend/src/api/recipe.js b/frontend/src/api/recipe.js index 7ef5489ea..3dd8c1a6f 100644 --- a/frontend/src/api/recipe.js +++ b/frontend/src/api/recipe.js @@ -16,6 +16,7 @@ const recipeURLs = { delete: slug => prefix + slug, recipeImage: slug => `${prefix}${slug}/image`, updateImage: slug => `${prefix}${slug}/image`, + createAsset: slug => `${prefix}${slug}/asset`, }; export const recipeAPI = { @@ -60,12 +61,23 @@ export const recipeAPI = { return response; }, + async createAsset(recipeSlug, fileObject, name, icon) { + const fd = new FormData(); + fd.append("file", fileObject); + fd.append("extension", fileObject.name.split(".").pop()); + fd.append("name", name); + fd.append("icon", icon); + let response = apiReq.post(recipeURLs.createAsset(recipeSlug), fd); + return response; + }, + async updateImagebyURL(slug, url) { const response = apiReq.post(recipeURLs.updateImage(slug), { url: url }); return response; }, async update(data) { + console.log(data) let response = await apiReq.put(recipeURLs.update(data.slug), data); store.dispatch("patchRecipe", response.data); return response.data.slug; // ! Temporary until I rewrite to refresh page without additional request diff --git a/frontend/src/components/Recipe/RecipeEditor/BulkAdd.vue b/frontend/src/components/Recipe/RecipeEditor/BulkAdd.vue deleted file mode 100644 index 72439417f..000000000 --- a/frontend/src/components/Recipe/RecipeEditor/BulkAdd.vue +++ /dev/null @@ -1,64 +0,0 @@ - - - \ No newline at end of file diff --git a/frontend/src/components/Recipe/RecipeEditor/ExtrasEditor.vue b/frontend/src/components/Recipe/RecipeEditor/ExtrasEditor.vue deleted file mode 100644 index 6acf9165b..000000000 --- a/frontend/src/components/Recipe/RecipeEditor/ExtrasEditor.vue +++ /dev/null @@ -1,104 +0,0 @@ - - - - - \ No newline at end of file diff --git a/frontend/src/components/Recipe/RecipeEditor/ImageUploadBtn.vue b/frontend/src/components/Recipe/RecipeEditor/ImageUploadBtn.vue deleted file mode 100644 index b1d543201..000000000 --- a/frontend/src/components/Recipe/RecipeEditor/ImageUploadBtn.vue +++ /dev/null @@ -1,75 +0,0 @@ - - - - - diff --git a/frontend/src/components/Recipe/RecipeEditor/NutritionEditor.vue b/frontend/src/components/Recipe/RecipeEditor/NutritionEditor.vue deleted file mode 100644 index 7050b3250..000000000 --- a/frontend/src/components/Recipe/RecipeEditor/NutritionEditor.vue +++ /dev/null @@ -1,81 +0,0 @@ - - - - - \ No newline at end of file diff --git a/frontend/src/components/Recipe/RecipeEditor/index.vue b/frontend/src/components/Recipe/RecipeEditor/index.vue index 0f9c20f7b..b8b894d78 100644 --- a/frontend/src/components/Recipe/RecipeEditor/index.vue +++ b/frontend/src/components/Recipe/RecipeEditor/index.vue @@ -3,7 +3,7 @@ -

{{ $t("recipe.ingredients") }}

- - -
- - - - mdi-delete - - - -
-
-
- - - mdi-plus - - +

{{ $t("recipe.categories") }}

- -

{{ $t("recipe.notes") }}

- - - - - mdi-delete - - - - - - - - - - mdi-plus - - + +
-

{{ $t("recipe.instructions") }}

-
- - - - - mdi-delete - - {{ $t("recipe.step-index", { step: index + 1 }) }} - - - - - - - + +
+ + + mdi-plus +
- - mdi-plus - - + + const UPLOAD_EVENT = "upload"; -import draggable from "vuedraggable"; -import utils from "@/utils"; -import BulkAdd from "./BulkAdd"; -import ExtrasEditor from "./ExtrasEditor"; +import BulkAdd from "@/components/Recipe/Parts/Helpers/BulkAdd"; +import ExtrasEditor from "@/components/Recipe/Parts/Helpers/ExtrasEditor"; import CategoryTagSelector from "@/components/FormHelpers/CategoryTagSelector"; -import NutritionEditor from "./NutritionEditor"; -import ImageUploadBtn from "./ImageUploadBtn.vue"; +import ImageUploadBtn from "@/components/Recipe/Parts/Helpers/ImageUploadBtn"; import { validators } from "@/mixins/validators"; +import Nutrition from "@/components/Recipe/Parts/Nutrition"; +import Instructions from "@/components/Recipe/Parts/Instructions"; +import Ingredients from "@/components/Recipe/Parts/Ingredients"; +import Assets from "@/components/Recipe/Parts/Assets.vue"; +import Notes from "@/components/Recipe/Parts/Notes.vue"; export default { components: { BulkAdd, ExtrasEditor, - draggable, CategoryTagSelector, - NutritionEditor, + Nutrition, ImageUploadBtn, + Instructions, + Ingredients, + Assets, + Notes, }, props: { value: Object, @@ -242,7 +140,6 @@ export default { mixins: [validators], data() { return { - drag: false, fileObject: null, }; }, @@ -250,30 +147,6 @@ export default { uploadImage(fileObject) { this.$emit(UPLOAD_EVENT, fileObject); }, - toggleDisabled(stepIndex) { - if (this.disabledSteps.includes(stepIndex)) { - const index = this.disabledSteps.indexOf(stepIndex); - if (index !== -1) { - this.disabledSteps.splice(index, 1); - } - } else { - this.disabledSteps.push(stepIndex); - } - }, - isDisabled(stepIndex) { - return this.disabledSteps.includes(stepIndex) ? "disabled-card" : null; - }, - generateKey(item, index) { - return utils.generateUniqueKey(item, index); - }, - addIngredient(ingredients = null) { - if (ingredients) { - this.value.recipeIngredient.push(...ingredients); - } else { - this.value.recipeIngredient.push(""); - } - }, - appendSteps(steps) { this.value.recipeInstructions.push( ...steps.map(x => ({ @@ -284,15 +157,9 @@ export default { addStep() { this.value.recipeInstructions.push({ text: "" }); }, - addNote() { - this.value.notes.push({ text: "" }); - }, saveExtras(extras) { this.value.extras = extras; }, - removeByIndex(list, index) { - list.splice(index, 1); - }, validateRecipe() { return this.$refs.form.validate(); }, diff --git a/frontend/src/components/Recipe/RecipeViewer/Ingredients.vue b/frontend/src/components/Recipe/RecipeViewer/Ingredients.vue deleted file mode 100644 index c3bec8215..000000000 --- a/frontend/src/components/Recipe/RecipeViewer/Ingredients.vue +++ /dev/null @@ -1,62 +0,0 @@ - - - - - \ No newline at end of file diff --git a/frontend/src/components/Recipe/RecipeViewer/Notes.vue b/frontend/src/components/Recipe/RecipeViewer/Notes.vue deleted file mode 100644 index e25701d27..000000000 --- a/frontend/src/components/Recipe/RecipeViewer/Notes.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - - - \ No newline at end of file diff --git a/frontend/src/components/Recipe/RecipeViewer/Steps.vue b/frontend/src/components/Recipe/RecipeViewer/Steps.vue deleted file mode 100644 index 4b674668e..000000000 --- a/frontend/src/components/Recipe/RecipeViewer/Steps.vue +++ /dev/null @@ -1,67 +0,0 @@ - - - - - \ No newline at end of file diff --git a/frontend/src/components/Recipe/RecipeViewer/index.vue b/frontend/src/components/Recipe/RecipeViewer/index.vue index 813a8d5ab..da878c8d9 100644 --- a/frontend/src/components/Recipe/RecipeViewer/index.vue +++ b/frontend/src/components/Recipe/RecipeViewer/index.vue @@ -31,16 +31,30 @@ - +
- - - - + + + {{ $t("recipe.categories") }} + + + + + + + + + {{ $t("recipe.tags") }} + + + + + + + + +
- + +
- - + +
@@ -82,24 +97,27 @@ + + \ No newline at end of file diff --git a/frontend/src/components/Recipe/Parts/Helpers/BulkAdd.vue b/frontend/src/components/Recipe/Parts/Helpers/BulkAdd.vue new file mode 100644 index 000000000..aba3835c5 --- /dev/null +++ b/frontend/src/components/Recipe/Parts/Helpers/BulkAdd.vue @@ -0,0 +1,64 @@ + + + \ No newline at end of file diff --git a/frontend/src/components/Recipe/Parts/Helpers/ExtrasEditor.vue b/frontend/src/components/Recipe/Parts/Helpers/ExtrasEditor.vue new file mode 100644 index 000000000..6acf9165b --- /dev/null +++ b/frontend/src/components/Recipe/Parts/Helpers/ExtrasEditor.vue @@ -0,0 +1,104 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/components/Recipe/Parts/Helpers/ImageUploadBtn.vue b/frontend/src/components/Recipe/Parts/Helpers/ImageUploadBtn.vue new file mode 100644 index 000000000..5f8f5483a --- /dev/null +++ b/frontend/src/components/Recipe/Parts/Helpers/ImageUploadBtn.vue @@ -0,0 +1,83 @@ + + + + + diff --git a/frontend/src/components/Recipe/Parts/Ingredients.vue b/frontend/src/components/Recipe/Parts/Ingredients.vue new file mode 100644 index 000000000..b1a8c8fe1 --- /dev/null +++ b/frontend/src/components/Recipe/Parts/Ingredients.vue @@ -0,0 +1,137 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/components/Recipe/Parts/Instructions.vue b/frontend/src/components/Recipe/Parts/Instructions.vue new file mode 100644 index 000000000..9b222d5bb --- /dev/null +++ b/frontend/src/components/Recipe/Parts/Instructions.vue @@ -0,0 +1,148 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/components/Recipe/Parts/Notes.vue b/frontend/src/components/Recipe/Parts/Notes.vue new file mode 100644 index 000000000..2827f2482 --- /dev/null +++ b/frontend/src/components/Recipe/Parts/Notes.vue @@ -0,0 +1,87 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/components/Recipe/Parts/Nutrition.vue b/frontend/src/components/Recipe/Parts/Nutrition.vue new file mode 100644 index 000000000..9686913a1 --- /dev/null +++ b/frontend/src/components/Recipe/Parts/Nutrition.vue @@ -0,0 +1,101 @@ + + + + + \ No newline at end of file