Compare commits

...

261 Commits

Author SHA1 Message Date
vabene1111
b5681a0255 Merge branch 'develop' 2023-05-18 14:29:31 +02:00
vabene1111
ddd2f96b85 updated translations 2023-05-18 14:29:19 +02:00
vabene1111
b56b778573 Merge pull request #2458 from ambroisie/fix-multiple-files-field
Fix multiple file field
2023-05-18 14:26:41 +02:00
vabene1111
cf7fc906bb Merge pull request #2463 from TandoorRecipes/dependabot/pip/django-4.1.9
Bump django from 4.1.7 to 4.1.9
2023-05-18 14:26:25 +02:00
dependabot[bot]
c5c37296e9 Bump django from 4.1.7 to 4.1.9
Bumps [django](https://github.com/django/django) from 4.1.7 to 4.1.9.
- [Commits](https://github.com/django/django/compare/4.1.7...4.1.9)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-09 22:47:01 +00:00
Bruno BELANYI
6b04c92297 Fix multiple file field
Due to [1], the previous solution does not work on recent Django releases.

See [2] for the documented work-around, as applied in this commit.

Closes #2457.

[1]: https://docs.djangoproject.com/en/4.2/releases/4.2.1/
[2]: https://docs.djangoproject.com/en/4.2/topics/http/file-uploads/#uploading-multiple-files
2023-05-04 22:41:19 +01:00
vabene1111
135640dd58 Merge pull request #2454 from smilerz/pytest_fixes
reload food objects to resolve inconsistent behavior
2023-05-03 19:24:46 +02:00
smilerz
d8ddf66921 reload food objects to resolve inconsistent behavior 2023-05-03 10:17:59 -05:00
axeron2036
ea4c16cc2a Translated using Weblate (Russian)
Currently translated at 9.6% (48 of 496 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/ru/
2023-05-01 07:55:47 +00:00
Oliver Cervera
e7239c7c68 Translated using Weblate (Italian)
Currently translated at 91.4% (448 of 490 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/it/
2023-04-29 07:55:49 +00:00
vabene1111
f7ef2ed4f5 Merge pull request #2437 from gabe565/ci-fix-stable-notify
Fix stable release Discord notification
2023-04-27 13:18:59 +02:00
noxonad
56f6de3510 Translated using Weblate (Romanian)
Currently translated at 100.0% (480 of 480 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/ro/
2023-04-27 08:55:57 +00:00
noxonad
cf86af7a23 Translated using Weblate (Romanian)
Currently translated at 100.0% (509 of 509 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/ro/
2023-04-27 08:55:57 +00:00
Mike Miller
fe32a743db Translated using Weblate (German)
Currently translated at 100.0% (480 of 480 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/de/
2023-04-27 08:55:57 +00:00
Sebastian Krug
93b750dbf1 Translated using Weblate (German)
Currently translated at 100.0% (480 of 480 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/de/
2023-04-27 08:55:57 +00:00
Sebastian Krug
4337f594f6 Translated using Weblate (German)
Currently translated at 100.0% (489 of 489 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/de/
2023-04-27 08:55:57 +00:00
Gabe Cook
17fc24fc1b Fix stable release Discord notification 2023-04-26 11:19:38 -05:00
vabene1111
018e9ef88f Merge branch 'develop' 2023-04-26 09:04:16 +02:00
vabene1111
7d99a9a9c3 updated translation files 2023-04-26 07:46:48 +02:00
vabene1111
c4078800e3 Merge pull request #2434 from ssams/ldap-auth-starttls
ldap auth: allow connecting using StartTLS
2023-04-26 07:43:44 +02:00
ssams
d87f0f3c15 ldap auth: allow connecting using StartTLS 2023-04-25 21:30:47 +02:00
vabene1111
6e9b504a9d Merge pull request #2407 from TandoorRecipes/dependabot/pip/django-allauth-0.54.0
Bump django-allauth from 0.52.0 to 0.54.0
2023-04-25 16:03:14 +02:00
dependabot[bot]
7397210729 Bump django-allauth from 0.52.0 to 0.54.0
Bumps [django-allauth](https://github.com/pennersr/django-allauth) from 0.52.0 to 0.54.0.
- [Release notes](https://github.com/pennersr/django-allauth/releases)
- [Changelog](https://github.com/pennersr/django-allauth/blob/master/ChangeLog.rst)
- [Commits](https://github.com/pennersr/django-allauth/compare/0.52.0...0.54.0)

---
updated-dependencies:
- dependency-name: django-allauth
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-25 13:59:53 +00:00
vabene1111
7830ddd4e9 Merge pull request #2431 from smilerz/pytest_fixes
Pytest fixes
2023-04-25 15:59:15 +02:00
smilerz
b711ee5257 update User factory to make username unique 2023-04-24 07:33:47 -05:00
smilerz
c7b6253e04 fixed food tree search filter tests 2023-04-24 07:01:28 -05:00
Michael
85dcb6c61f Translated using Weblate (German)
Currently translated at 99.5% (478 of 480 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/de/
2023-04-23 15:55:48 +00:00
smilerz
323ded1814 fix touchable 2023-04-22 17:57:15 -05:00
smilerz
595de0c5a1 fixed pytests 2023-04-22 17:56:01 -05:00
smilerz
8c3195937b fix food tests 2023-04-21 13:14:23 -05:00
Espen Sellevåg
8a8be7fb2d Translated using Weblate (Norwegian Bokmål)
Currently translated at 16.6% (80 of 480 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/nb_NO/
2023-04-17 20:55:48 +00:00
axeron2036
ec68da051d Translated using Weblate (Russian)
Currently translated at 71.6% (344 of 480 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/ru/
2023-04-17 20:55:48 +00:00
Espen Sellevåg
29f13d687c Translated using Weblate (Norwegian Bokmål)
Currently translated at 52.8% (196 of 371 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/nb_NO/
2023-04-17 20:55:47 +00:00
Espen Sellevåg
980e83b23c Translated using Weblate (Norwegian Bokmål)
Currently translated at 7.9% (38 of 480 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/nb_NO/
2023-04-15 22:55:48 +00:00
Espen Sellevåg
668ccf89fd Translated using Weblate (Norwegian Bokmål)
Currently translated at 28.8% (107 of 371 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/nb_NO/
2023-04-15 22:55:47 +00:00
Espen Sellevåg
93f7da3ed9 Added translation using Weblate (Norwegian Bokmål) 2023-04-14 21:41:01 +00:00
vabene1111
3f88778013 Merge pull request #2421 from noxonad/patch-2
Fixed another typo
2023-04-13 13:44:22 +02:00
vabene1111
499d026b5c Merge pull request #2422 from noxonad/patch-3
Fixed typo in json
2023-04-13 13:43:56 +02:00
noxonad
e0a1189430 Translated using Weblate (Ukrainian)
Currently translated at 0.3% (2 of 528 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/uk/
2023-04-12 11:55:59 +00:00
noxonad
e2905eb999 Translated using Weblate (Bulgarian)
Currently translated at 100.0% (528 of 528 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/bg/
2023-04-12 11:55:59 +00:00
noxonad
8b6f2c1e70 Translated using Weblate (Danish)
Currently translated at 100.0% (528 of 528 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/da/
2023-04-12 11:55:59 +00:00
noxonad
b7e4e53519 Translated using Weblate (Portuguese (Brazil))
Currently translated at 5.8% (33 of 562 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/pt_BR/
2023-04-12 11:55:59 +00:00
noxonad
80eee255f7 Translated using Weblate (Slovenian)
Currently translated at 15.5% (79 of 509 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/sl/
2023-04-12 11:55:59 +00:00
noxonad
60a4a63f56 Translated using Weblate (Romanian)
Currently translated at 100.0% (480 of 480 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/ro/
2023-04-12 11:55:59 +00:00
noxonad
82b80e60e6 Translated using Weblate (Romanian)
Currently translated at 100.0% (509 of 509 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/ro/
2023-04-12 11:55:59 +00:00
noxonad
915d0359bf Translated using Weblate (Russian)
Currently translated at 9.4% (47 of 496 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/ru/
2023-04-12 11:55:59 +00:00
noxonad
10f1a77c1c Translated using Weblate (Russian)
Currently translated at 71.0% (341 of 480 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/ru/
2023-04-12 11:55:59 +00:00
noxonad
ea141577d0 Translated using Weblate (Italian)
Currently translated at 92.1% (444 of 482 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/it/
2023-04-12 11:55:59 +00:00
noxonad
d0a1151a33 Translated using Weblate (Hungarian)
Currently translated at 87.5% (422 of 482 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/hu/
2023-04-12 11:55:59 +00:00
noxonad
bc461997f8 Translated using Weblate (French)
Currently translated at 91.9% (443 of 482 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/fr/
2023-04-12 11:55:59 +00:00
noxonad
d8051203c1 Translated using Weblate (German)
Currently translated at 99.5% (487 of 489 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/de/
2023-04-12 11:55:59 +00:00
noxonad
af71407ca6 Translated using Weblate (Catalan)
Currently translated at 86.3% (416 of 482 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/ca/
2023-04-12 11:55:58 +00:00
noxonad
cb9a90d1e7 Fixed typo in json 2023-04-11 16:40:16 +03:00
noxonad
4a4e4719b3 Fixed another typo 2023-04-11 14:25:29 +03:00
vabene1111
a0ff489be0 Merge pull request #2415 from smilerz/import_automation
added keyword automation to url import
2023-04-08 12:01:08 +02:00
vabene1111
147aae318a Merge pull request #2416 from dnlmlr/patch-1
Small fix for german language
2023-04-08 11:59:40 +02:00
dnlmlr
d8e61a485e Small fix for german language 2023-04-06 17:43:02 +02:00
vabene1111
c2be329495 Merge branch 'develop' of https://github.com/vabene1111/recipes into develop 2023-04-06 17:22:06 +02:00
vabene1111
2552d27f6f added plugin architecture 2023-04-06 17:22:02 +02:00
smilerz
9db5e45c26 added keyword automation to url import 2023-04-05 15:46:10 -05:00
vabene1111
74f88eb952 Merge pull request #2414 from TandoorRecipes/dependabot/npm_and_yarn/vue/vue-cli-plugin-i18n-2.3.2
Bump vue-cli-plugin-i18n from 2.3.1 to 2.3.2 in /vue
2023-04-03 02:09:34 +02:00
vabene1111
9a0a99a21f Merge pull request #2413 from TandoorRecipes/dependabot/npm_and_yarn/vue/typescript-eslint/parser-5.57.0
Bump @typescript-eslint/parser from 5.56.0 to 5.57.0 in /vue
2023-04-03 02:09:18 +02:00
vabene1111
b35b731b6d Merge pull request #2412 from TandoorRecipes/dependabot/npm_and_yarn/vue/popperjs/core-2.11.7
Bump @popperjs/core from 2.11.6 to 2.11.7 in /vue
2023-04-03 02:09:06 +02:00
vabene1111
e8d2b95aaa Merge pull request #2409 from TandoorRecipes/dependabot/pip/markdown-3.4.3
Bump markdown from 3.4.1 to 3.4.3
2023-04-03 02:08:43 +02:00
vabene1111
6be1ddfe87 Merge pull request #2406 from TandoorRecipes/dependabot/pip/django-auth-ldap-4.2.0
Bump django-auth-ldap from 4.1.0 to 4.2.0
2023-04-03 02:08:14 +02:00
vabene1111
5b518d4a4c Merge pull request #2408 from TandoorRecipes/dependabot/pip/recipe-scrapers-14.35.0
Bump recipe-scrapers from 14.30.0 to 14.35.0
2023-04-03 02:07:42 +02:00
vabene1111
1c6db468e1 Merge pull request #2410 from TandoorRecipes/dependabot/npm_and_yarn/vue/vue-cookies-1.8.3
Bump vue-cookies from 1.8.2 to 1.8.3 in /vue
2023-04-03 02:07:11 +02:00
dependabot[bot]
519e36379b Bump vue-cli-plugin-i18n from 2.3.1 to 2.3.2 in /vue
Bumps [vue-cli-plugin-i18n](https://github.com/intlify/vue-cli-plugin-i18n) from 2.3.1 to 2.3.2.
- [Release notes](https://github.com/intlify/vue-cli-plugin-i18n/releases)
- [Changelog](https://github.com/intlify/vue-cli-plugin-i18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/intlify/vue-cli-plugin-i18n/compare/v2.3.1...v2.3.2)

---
updated-dependencies:
- dependency-name: vue-cli-plugin-i18n
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-01 00:59:18 +00:00
dependabot[bot]
4726598deb Bump @typescript-eslint/parser from 5.56.0 to 5.57.0 in /vue
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.56.0 to 5.57.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.57.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-01 00:58:57 +00:00
dependabot[bot]
1e57e7e70b Bump @popperjs/core from 2.11.6 to 2.11.7 in /vue
Bumps [@popperjs/core](https://github.com/popperjs/popper-core) from 2.11.6 to 2.11.7.
- [Release notes](https://github.com/popperjs/popper-core/releases)
- [Commits](https://github.com/popperjs/popper-core/compare/v2.11.6...v2.11.7)

---
updated-dependencies:
- dependency-name: "@popperjs/core"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-01 00:58:33 +00:00
dependabot[bot]
6f1777d37d Bump vue-cookies from 1.8.2 to 1.8.3 in /vue
Bumps [vue-cookies](https://github.com/cmp-cc/vue-cookies) from 1.8.2 to 1.8.3.
- [Release notes](https://github.com/cmp-cc/vue-cookies/releases)
- [Commits](https://github.com/cmp-cc/vue-cookies/compare/v1.8.2...v1.8.3)

---
updated-dependencies:
- dependency-name: vue-cookies
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-01 00:57:53 +00:00
dependabot[bot]
d6d9066eea Bump markdown from 3.4.1 to 3.4.3
Bumps [markdown](https://github.com/Python-Markdown/markdown) from 3.4.1 to 3.4.3.
- [Release notes](https://github.com/Python-Markdown/markdown/releases)
- [Changelog](https://github.com/Python-Markdown/markdown/blob/master/docs/change_log/release-2.6.md)
- [Commits](https://github.com/Python-Markdown/markdown/compare/3.4.1...3.4.3)

---
updated-dependencies:
- dependency-name: markdown
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-01 00:57:13 +00:00
dependabot[bot]
2c7e7f859b Bump recipe-scrapers from 14.30.0 to 14.35.0
Bumps [recipe-scrapers](https://github.com/hhursev/recipe-scrapers) from 14.30.0 to 14.35.0.
- [Release notes](https://github.com/hhursev/recipe-scrapers/releases)
- [Commits](https://github.com/hhursev/recipe-scrapers/compare/14.30.0...14.35.0)

---
updated-dependencies:
- dependency-name: recipe-scrapers
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-01 00:57:06 +00:00
dependabot[bot]
97e5d23d98 Bump django-auth-ldap from 4.1.0 to 4.2.0
Bumps [django-auth-ldap](https://github.com/django-auth-ldap/django-auth-ldap) from 4.1.0 to 4.2.0.
- [Release notes](https://github.com/django-auth-ldap/django-auth-ldap/releases)
- [Changelog](https://github.com/django-auth-ldap/django-auth-ldap/blob/master/docs/changes.rst)
- [Commits](https://github.com/django-auth-ldap/django-auth-ldap/compare/4.1.0...4.2.0)

---
updated-dependencies:
- dependency-name: django-auth-ldap
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-01 00:56:58 +00:00
vabene1111
a8cbef7bd4 Merge pull request #2403 from smilerz/debug_toolbar
enable toolbar seperate from debug logging
2023-03-30 07:37:56 +02:00
smilerz
569143a7ee enable toolbar seperate from debug logging 2023-03-29 15:52:46 -05:00
vabene1111
3e8f0c3aae Merge pull request #2379 from thomaspreece/develop
Improve parsing of OpenEats imports
2023-03-29 16:04:07 +02:00
vabene1111
11620ba2b6 Update openeats.py 2023-03-29 16:03:33 +02:00
vabene1111
073ee7e963 Update openeats.py 2023-03-29 16:03:08 +02:00
vabene1111
9620689bd0 disable space creation for demo user on hosted instance 2023-03-28 23:22:14 +02:00
Thomas Preece
5a145d7f8e PR feedback changes 2023-03-28 17:30:58 +01:00
vabene1111
0ba2fa296a added token auth for share link endpoint 2023-03-28 15:42:34 +02:00
Matěj Kubla
2a5fc22dd7 Translated using Weblate (Czech)
Currently translated at 100.0% (362 of 362 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/cs/
2023-03-25 11:32:52 +00:00
Matěj Kubla
e739c4d627 Added translation using Weblate (Czech) 2023-03-25 11:32:51 +00:00
vabene1111
87066c5d93 Merge pull request #2397 from gabe565/ci-skip-push-dependabot
Skip Docker push for Dependabot PRs
2023-03-25 07:22:43 +01:00
Gabe Cook
39ab2eb10f Skip Docker push for Dependabot PRs 2023-03-25 01:02:28 -05:00
vabene1111
048f12948d added WSL docs to docs nav 2023-03-25 06:23:48 +01:00
vabene1111
ed4a46d585 Merge pull request #2372 from nco34/patch-1
Create WSL-Docker-Installation.md
2023-03-25 05:56:16 +01:00
vabene1111
4857a853b3 Merge pull request #2351 from ocnattie/develop
added a couple of typo corrections
2023-03-25 05:54:27 +01:00
vabene1111
cfda0a17b1 Merge pull request #2326 from alexbarcelo/k8s_update
Updating/improving kubernetes deployment and its documentation
2023-03-25 05:52:13 +01:00
vabene1111
84a1c560cc Merge pull request #2270 from MarcusWolschon/features/upstream/1552_Import_Recipes_from_Cookidoo
#1552 import recipes from cookidoo
2023-03-25 05:51:18 +01:00
vabene1111
cf8e130bb8 Merge pull request #2394 from TandoorRecipes/dependabot/npm_and_yarn/vue/typescript-eslint/parser-5.56.0
Bump @typescript-eslint/parser from 5.51.0 to 5.56.0 in /vue
2023-03-25 05:50:38 +01:00
vabene1111
33070e3c51 Merge pull request #2297 from TandoorRecipes/dependabot/npm_and_yarn/vue/vue-template-compiler-2.7.14
Bump vue-template-compiler from 2.6.14 to 2.7.14 in /vue
2023-03-25 05:50:30 +01:00
dependabot[bot]
d4a646c973 Bump @typescript-eslint/parser from 5.51.0 to 5.56.0 in /vue
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.51.0 to 5.56.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.56.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-25 04:49:53 +00:00
vabene1111
38ad546634 Merge pull request #2340 from TandoorRecipes/dependabot/pip/django-cleanup-7.0.0
Bump django-cleanup from 6.0.0 to 7.0.0
2023-03-25 05:49:32 +01:00
vabene1111
001094afa5 Merge pull request #2341 from TandoorRecipes/dependabot/pip/requests-2.28.2
Bump requests from 2.28.1 to 2.28.2
2023-03-25 05:49:26 +01:00
vabene1111
dd4e170fb0 Merge pull request #2342 from TandoorRecipes/dependabot/pip/django-webpack-loader-1.8.1
Bump django-webpack-loader from 1.8.0 to 1.8.1
2023-03-25 05:49:15 +01:00
vabene1111
10b3b6fe1e Merge pull request #2347 from TandoorRecipes/dependabot/npm_and_yarn/vue/webpack-bundle-tracker-1.8.1
Bump webpack-bundle-tracker from 1.8.0 to 1.8.1 in /vue
2023-03-25 05:49:09 +01:00
vabene1111
c15e88a3d3 Merge pull request #2395 from TandoorRecipes/dependabot/npm_and_yarn/vue/babel/eslint-parser-7.21.3
Bump @babel/eslint-parser from 7.19.1 to 7.21.3 in /vue
2023-03-25 05:48:44 +01:00
vabene1111
673ccb5024 Merge pull request #2393 from TandoorRecipes/dependabot/npm_and_yarn/vue/typescript-eslint/eslint-plugin-5.56.0
Bump @typescript-eslint/eslint-plugin from 4.33.0 to 5.56.0 in /vue
2023-03-25 05:48:35 +01:00
vabene1111
7297cb5c3f Merge pull request #2388 from TandoorRecipes/dependabot/github_actions/actions/setup-python-4
Bump actions/setup-python from 2 to 4
2023-03-25 05:48:28 +01:00
dependabot[bot]
f995c44d0b Bump django-cleanup from 6.0.0 to 7.0.0
Bumps [django-cleanup](https://github.com/un1t/django-cleanup) from 6.0.0 to 7.0.0.
- [Release notes](https://github.com/un1t/django-cleanup/releases)
- [Changelog](https://github.com/un1t/django-cleanup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/un1t/django-cleanup/compare/6.0.0...7.0.0)

---
updated-dependencies:
- dependency-name: django-cleanup
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-24 07:04:18 +00:00
dependabot[bot]
f81a7479c7 Bump @babel/eslint-parser from 7.19.1 to 7.21.3 in /vue
Bumps [@babel/eslint-parser](https://github.com/babel/babel/tree/HEAD/eslint/babel-eslint-parser) from 7.19.1 to 7.21.3.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.21.3/eslint/babel-eslint-parser)

---
updated-dependencies:
- dependency-name: "@babel/eslint-parser"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-24 07:00:46 +00:00
dependabot[bot]
f5ab723ac2 Bump actions/setup-python from 2 to 4
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 4.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-24 06:59:24 +00:00
dependabot[bot]
2dddc79a47 Bump @typescript-eslint/eslint-plugin from 4.33.0 to 5.56.0 in /vue
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.33.0 to 5.56.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.56.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-24 06:59:04 +00:00
vabene1111
b28cd881de Merge pull request #2392 from TandoorRecipes/dependabot/npm_and_yarn/vue/core-js-3.29.1
Bump core-js from 3.27.2 to 3.29.1 in /vue
2023-03-24 07:58:51 +01:00
vabene1111
b013efadda Merge pull request #2391 from TandoorRecipes/dependabot/pip/pytest-7.2.2
Bump pytest from 7.2.0 to 7.2.2
2023-03-24 07:58:42 +01:00
vabene1111
a61566063b Merge pull request #2390 from TandoorRecipes/dependabot/github_actions/github/codeql-action-2
Bump github/codeql-action from 1 to 2
2023-03-24 07:58:26 +01:00
vabene1111
9f6ec38ac5 Merge pull request #2389 from TandoorRecipes/dependabot/pip/django-tables2-2.5.3
Bump django-tables2 from 2.4.1 to 2.5.3
2023-03-24 07:58:18 +01:00
vabene1111
5110b975e9 Merge pull request #2387 from TandoorRecipes/dependabot/github_actions/actions/checkout-3
Bump actions/checkout from 1 to 3
2023-03-24 07:58:09 +01:00
dependabot[bot]
56ad93cdb3 Bump core-js from 3.27.2 to 3.29.1 in /vue
Bumps [core-js](https://github.com/zloirock/core-js/tree/HEAD/packages/core-js) from 3.27.2 to 3.29.1.
- [Release notes](https://github.com/zloirock/core-js/releases)
- [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zloirock/core-js/commits/v3.29.1/packages/core-js)

---
updated-dependencies:
- dependency-name: core-js
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-24 06:56:02 +00:00
dependabot[bot]
fb7d1d94ab Bump pytest from 7.2.0 to 7.2.2
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.2.0 to 7.2.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.2.0...7.2.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-24 06:55:06 +00:00
dependabot[bot]
78de1c2bc2 Bump github/codeql-action from 1 to 2
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1 to 2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-24 06:54:44 +00:00
dependabot[bot]
8ad21b68ef Bump django-tables2 from 2.4.1 to 2.5.3
Bumps [django-tables2](https://github.com/jieter/django-tables2) from 2.4.1 to 2.5.3.
- [Release notes](https://github.com/jieter/django-tables2/releases)
- [Changelog](https://github.com/jieter/django-tables2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jieter/django-tables2/compare/v2.4.1...v2.5.3)

---
updated-dependencies:
- dependency-name: django-tables2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-24 06:54:40 +00:00
dependabot[bot]
58f7d02460 Bump actions/checkout from 1 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 1 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v1...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-24 06:54:35 +00:00
vabene1111
7c641af280 Merge pull request #2377 from gabe565/enable-dependabot-gha
Enable Dependabot updates for GitHub Actions
2023-03-24 07:54:12 +01:00
vabene1111
8ebb62188b Merge pull request #2376 from gabe565/refactor-ci
Refactor Docker CI: Consolidate, add cache, GHCR Repository, major/minor tags
2023-03-24 07:53:38 +01:00
Thomas Preece
a1b8f736c2 Improve parsing of OpenEats imports 2023-03-20 18:18:43 +00:00
Gabe Cook
0347ff5304 Enable Dependabot updates for GitHub Actions 2023-03-17 17:15:06 -05:00
Gabe Cook
037f38ac6b Add GHCR repository 2023-03-17 16:12:23 -05:00
Gabe Cook
5370e67444 Consolidate Docker build CI workflows 2023-03-17 14:02:45 -05:00
Diogo Cardoso
87db9124d0 Translated using Weblate (Portuguese)
Currently translated at 63.5% (305 of 480 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/pt/
2023-03-16 11:55:48 +00:00
vabene1111
8476b5e01f added Hungarian langauge to language switcher 2023-03-15 14:59:30 +01:00
nco34
f1eb553487 Create WSL-Docker-Installation.md 2023-03-15 01:25:53 -04:00
vabene1111
4378a6b0c7 Merge branch 'develop' 2023-03-14 23:10:37 +01:00
vabene1111
d5ca8e9c96 add FAQ manual setup 2023-03-14 23:05:09 +01:00
vabene1111
bbcf7ba8a7 fixed mealie import no steps but ingredients 2023-03-14 22:58:35 +01:00
vabene1111
f29f77a1d5 fixed ingredient to string plural 2023-03-14 22:50:33 +01:00
vabene1111
a3f8b2272c added notes, yields, times and source url to mealie import 2023-03-14 22:46:50 +01:00
vabene1111
008a61823d added origianl image import to paprika 2023-03-14 22:34:09 +01:00
vabene1111
a60f1a3e92 added section headers to bottom nav create 2023-03-14 22:12:39 +01:00
Amara Ude
ebb6e669e2 Translated using Weblate (Spanish)
Currently translated at 74.1% (356 of 480 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/es/
2023-03-13 06:55:47 +00:00
Amara Ude
fdd61d3caf Translated using Weblate (French)
Currently translated at 95.6% (459 of 480 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/fr/
2023-03-13 06:55:47 +00:00
Jin Zhang
72ac272962 Translated using Weblate (French)
Currently translated at 91.9% (443 of 482 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/fr/
2023-03-13 06:55:47 +00:00
Amara Ude
4395737cc5 Translated using Weblate (French)
Currently translated at 91.9% (443 of 482 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/fr/
2023-03-13 06:55:47 +00:00
Amara Ude
f3aef2c10b Translated using Weblate (Spanish)
Currently translated at 56.8% (274 of 482 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/es/
2023-03-13 06:55:47 +00:00
Jin Zhang
df1b75d88a Translated using Weblate (French)
Currently translated at 95.0% (456 of 480 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/fr/
2023-03-12 02:55:53 +00:00
Feng Zhong
0b5fb69664 Translated using Weblate (Chinese (Traditional))
Currently translated at 17.1% (81 of 471 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/zh_Hant/
2023-03-12 02:55:47 +00:00
Jin Zhang
ff2a75476b Translated using Weblate (French)
Currently translated at 89.8% (433 of 482 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/fr/
2023-03-12 02:55:47 +00:00
Tomasz Klimczak
ea515c199c Translated using Weblate (Polish)
Currently translated at 100.0% (480 of 480 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/pl/
2023-03-09 20:55:47 +00:00
Feng Zhong
12f0cdb484 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (480 of 480 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/zh_Hans/
2023-03-08 04:55:47 +00:00
Feng Zhong
f2cd220e22 Translated using Weblate (Chinese (Traditional))
Currently translated at 5.7% (27 of 471 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/zh_Hant/
2023-03-08 04:55:47 +00:00
liimee
a0a3629e4c Translated using Weblate (Indonesian)
Currently translated at 30.0% (144 of 480 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/id/
2023-03-06 10:55:48 +00:00
Anders Obro
8263c6b725 Translated using Weblate (Danish)
Currently translated at 100.0% (480 of 480 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/da/
2023-03-06 10:55:48 +00:00
Anders Obro
b8b3620ade Translated using Weblate (Danish)
Currently translated at 100.0% (528 of 528 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/da/
2023-03-06 10:55:48 +00:00
vabene1111
e55faa02d5 recipe view padding without comments 2023-03-02 16:59:45 +01:00
Ohaneje Natalie
99fc0d1f81 added a couple of typo corrections 2023-03-02 11:39:04 +01:00
dependabot[bot]
19fe7ce214 Bump webpack-bundle-tracker from 1.8.0 to 1.8.1 in /vue
Bumps [webpack-bundle-tracker](https://github.com/django-webpack/webpack-bundle-tracker) from 1.8.0 to 1.8.1.
- [Release notes](https://github.com/django-webpack/webpack-bundle-tracker/releases)
- [Commits](https://github.com/django-webpack/webpack-bundle-tracker/compare/1.8.0...1.8.1)

---
updated-dependencies:
- dependency-name: webpack-bundle-tracker
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-01 01:04:03 +00:00
dependabot[bot]
ca26588c32 Bump django-webpack-loader from 1.8.0 to 1.8.1
Bumps [django-webpack-loader](https://github.com/django-webpack/django-webpack-loader) from 1.8.0 to 1.8.1.
- [Release notes](https://github.com/django-webpack/django-webpack-loader/releases)
- [Changelog](https://github.com/django-webpack/django-webpack-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/django-webpack/django-webpack-loader/compare/1.8.0...1.8.1)

---
updated-dependencies:
- dependency-name: django-webpack-loader
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-01 00:57:46 +00:00
dependabot[bot]
e2c807e303 Bump requests from 2.28.1 to 2.28.2
Bumps [requests](https://github.com/psf/requests) from 2.28.1 to 2.28.2.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.28.1...v2.28.2)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-01 00:57:39 +00:00
vabene1111
64efadfc81 added bottom padding for recipe view 2023-02-27 16:43:37 +01:00
vabene1111
fb90eede52 fixed blank meal plan when nothing planned on mobile 2023-02-27 16:41:33 +01:00
Jesse
48fda987fb Translated using Weblate (Dutch)
Currently translated at 100.0% (482 of 482 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/nl/
2023-02-27 13:55:47 +00:00
bebur
8e85fd57b6 Translated using Weblate (Dutch)
Currently translated at 100.0% (478 of 478 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/nl/
2023-02-26 13:15:31 +00:00
bebur
3f475aed03 Translated using Weblate (Dutch)
Currently translated at 100.0% (478 of 478 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/nl/
2023-02-26 13:15:31 +00:00
Jesse
12a11766d9 Translated using Weblate (Dutch)
Currently translated at 100.0% (478 of 478 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/nl/
2023-02-26 13:15:31 +00:00
吕楪
0e90700ce9 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (482 of 482 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/zh_Hans/
2023-02-26 13:15:31 +00:00
vabene1111
b7f202d645 working on dedicated food view 2023-02-25 11:41:25 +01:00
vabene1111
f0f12ca83f removed use_plural space setting
remove because i dont see the need and it was causing issues
2023-02-24 23:32:30 +01:00
vabene1111
b14d8f0051 fixed plural showing in lists where it does not make sense 2023-02-24 23:27:20 +01:00
vabene1111
5fd8c56324 Merge branch 'develop' of https://github.com/TandoorRecipes/recipes into develop 2023-02-24 20:36:06 +01:00
vabene1111
8abef1d8cc improved style 2023-02-24 20:35:54 +01:00
vabene1111
0c8c74c0ac context menu working for mobile mealplan view 2023-02-24 20:24:28 +01:00
vabene1111
0b40414d23 basic context menu for meal plan working 2023-02-24 16:10:16 +01:00
vabene1111
d4b8190f55 increased right/left padding in bottom nav 2023-02-24 11:16:12 +01:00
JFL
0ce7ea0b61 Translated using Weblate (French)
Currently translated at 93.5% (447 of 478 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/fr/
2023-02-24 02:55:47 +00:00
JFL
817c4cb9d6 Translated using Weblate (French)
Currently translated at 87.7% (423 of 482 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/fr/
2023-02-24 02:55:46 +00:00
Alex Barcelo
d05b894d69 Updating/improving kubernetes deployment and its documentation 2023-02-20 14:14:53 +01:00
Oliver Cervera
9962c849ed Translated using Weblate (Italian)
Currently translated at 97.4% (466 of 478 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/it/
2023-02-20 12:55:48 +00:00
vabene1111
8313dc8abe added padding in recipe search view 2023-02-19 22:15:54 +01:00
vabene1111
2781730778 fixed mess 2023-02-19 21:09:06 +01:00
vabene1111
985e98c699 fixed shopping list meal plan logic 2023-02-19 17:05:39 +01:00
vabene1111
d244af28e3 Merge pull request #2290 from TandoorRecipes/dependabot/pip/pillow-9.4.0
Bump pillow from 9.3.0 to 9.4.0
2023-02-19 16:49:56 +01:00
vabene1111
488ac3b94a Merge pull request #2307 from TandoorRecipes/dependabot/pip/cryptography-39.0.1
Bump cryptography from 38.0.4 to 39.0.1
2023-02-19 16:49:41 +01:00
vabene1111
b49426e35c more styling tweaks 2023-02-19 16:42:00 +01:00
vabene1111
a81bac1193 styling and fixes for mealplan and search plan 2023-02-19 16:37:32 +01:00
vabene1111
7fe80b7a5f more styling of mobile meal plan 2023-02-19 16:05:49 +01:00
vabene1111
a6e3ab2dbe mostly working and somewhat styled mobile plan ui 2023-02-19 15:58:39 +01:00
vabene1111
a4f0f38300 meal plan simple mobile layout 2023-02-19 15:24:51 +01:00
vabene1111
1a5b7244dd improved paddings in search view 2023-02-19 14:46:50 +01:00
vabene1111
dff9f91d4c properly integrated bottom nav 2023-02-19 13:54:16 +01:00
vabene1111
59d1c1dcdc improved bottom nav with slots and more 2023-02-19 10:02:31 +01:00
vabene1111
2cff936b5b improved showing of meal plan and bottom nav widget 2023-02-19 08:50:40 +01:00
vabene1111
d9dc644cb6 fixed meal plan edit id handling 2023-02-19 08:44:36 +01:00
vabene1111
2280d04fd2 search view meal plan working 2023-02-19 08:42:23 +01:00
vabene1111
1c8cb69cf3 wip integrating mealplan edit into search 2023-02-18 22:27:17 +01:00
vabene1111
e33c3789b7 fixed add to shopping when using ingredient headers 2023-02-18 21:56:21 +01:00
vabene1111
8d85800e2f updated store 2023-02-18 21:55:24 +01:00
vabene1111
c08c1d30ad fixed review shopping before save, improved meal plan edit modal independece 2023-02-18 21:55:17 +01:00
vabene1111
3c00e1ecdb made meal plan edit modal mostely independent 2023-02-18 21:15:08 +01:00
vabene1111
83947e31aa properly reactive meal plan store with dict 2023-02-18 19:13:32 +01:00
Joachim Weber
b4f90fbbb3 Translated using Weblate (Portuguese (Brazil))
Currently translated at 5.6% (32 of 562 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/pt_BR/
2023-02-18 10:55:49 +00:00
Joachim Weber
0f55f91586 Translated using Weblate (Portuguese (Brazil))
Currently translated at 36.1% (173 of 478 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/pt_BR/
2023-02-18 10:55:49 +00:00
Joachim Weber
7d0a9b11a0 Translated using Weblate (German)
Currently translated at 100.0% (478 of 478 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/de/
2023-02-18 10:55:49 +00:00
vabene1111
9167261714 add nav to view 2023-02-17 18:00:43 +01:00
vabene1111
57fae34ff6 playing with bottom nav 2023-02-17 17:02:50 +01:00
dependabot[bot]
1cbc74761a Bump vue-template-compiler from 2.6.14 to 2.7.14 in /vue
Bumps [vue-template-compiler](https://github.com/vuejs/vue) from 2.6.14 to 2.7.14.
- [Release notes](https://github.com/vuejs/vue/releases)
- [Changelog](https://github.com/vuejs/vue/blob/main/CHANGELOG.md)
- [Commits](https://github.com/vuejs/vue/compare/v2.6.14...v2.7.14)

---
updated-dependencies:
- dependency-name: vue-template-compiler
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-16 22:44:06 +00:00
vabene1111
961578385d new meal plan widget 2023-02-16 23:38:14 +01:00
vabene1111
0dc6bed7ad prevent user preference store from spamming API requests 2023-02-16 23:21:39 +01:00
vabene1111
c78c615372 Merge branch 'develop' into feature/card_ui_2 2023-02-16 22:51:30 +01:00
vabene1111
04bdec3889 Merge branch 'feature/improved-offline' into develop 2023-02-16 22:51:21 +01:00
vabene1111
6af3d7c98f playing around with better meal plan view 2023-02-16 22:50:48 +01:00
vabene1111
73be817c10 moved context menu and re added descripotion to detailed view 2023-02-16 21:30:30 +01:00
vabene1111
faf78fc254 larger pagination 2023-02-16 20:54:30 +01:00
vabene1111
2c85c370e6 description fade 2023-02-16 20:52:11 +01:00
vabene1111
3a38a095d8 nicer card working 2023-02-16 20:38:40 +01:00
vabene1111
e754b13340 quite nice 2023-02-16 20:23:46 +01:00
vabene1111
900c28caba playing around with the recipe card 2023-02-16 19:10:19 +01:00
vabene1111
c5ce197ed7 test setup done for real 2023-02-16 18:28:50 +01:00
vabene1111
9573ff0932 setup test view 2023-02-16 18:26:26 +01:00
vabene1111
f554963ae7 ugly but working import to my tandoor instance button 2023-02-16 18:16:01 +01:00
dependabot[bot]
961619c156 Bump cryptography from 38.0.4 to 39.0.1
Bumps [cryptography](https://github.com/pyca/cryptography) from 38.0.4 to 39.0.1.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/38.0.4...39.0.1)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-16 17:11:41 +00:00
vabene1111
4ecadab53c Merge branch 'develop' of https://github.com/vabene1111/recipes into develop 2023-02-16 18:00:52 +01:00
vabene1111
744501a65d pass url parmeter to import page 2023-02-16 18:00:48 +01:00
vabene1111
44cc66888b Merge pull request #2293 from TandoorRecipes/dependabot/pip/django-debug-toolbar-3.8.1
Bump django-debug-toolbar from 3.7.0 to 3.8.1
2023-02-16 17:53:42 +01:00
vabene1111
0695909b6c Merge pull request #2291 from TandoorRecipes/dependabot/pip/recipe-scrapers-14.30.0
Bump recipe-scrapers from 14.24.0 to 14.30.0
2023-02-16 17:53:01 +01:00
vabene1111
7a4fa38725 Merge pull request #2319 from TandoorRecipes/dependabot/pip/django-4.1.7
Bump django from 4.1.4 to 4.1.7
2023-02-16 17:52:48 +01:00
vabene1111
9f360d8af6 improve cross instance import 2023-02-16 17:47:03 +01:00
vabene1111
5dad6b8b17 enable cross tandoor importing 2023-02-16 17:32:43 +01:00
dependabot[bot]
5b6df6ed2e Bump django from 4.1.4 to 4.1.7
Bumps [django](https://github.com/django/django) from 4.1.4 to 4.1.7.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/4.1.4...4.1.7)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-15 20:18:53 +00:00
vabene1111
82d1a75d80 Merge branch 'develop' 2023-02-12 23:10:08 +01:00
vabene1111
50429207c5 import between tandoor instances WIP 2023-02-12 23:09:30 +01:00
vabene1111
589bc1f1aa fixed open graph tags when attributes are missing 2023-02-12 20:52:52 +01:00
vabene1111
824dcefc1a fixed space delete data 2023-02-12 20:52:30 +01:00
vabene1111
3f8c952237 added open graph meta tags 2023-02-12 18:17:05 +01:00
vabene1111
077db58de0 allow markdown in message of the day 2023-02-12 18:16:58 +01:00
vabene1111
3c527fd112 allow infiinit sharing as space setting 2023-02-12 18:16:43 +01:00
vabene1111
cd1f6ad7b0 added pinia to all app entrypoints 2023-02-12 16:14:15 +01:00
vabene1111
3af7e98216 basic pinia store 2023-02-12 16:06:00 +01:00
vabene1111
cb363d6321 added background sync to shopping list entry checking 2023-02-12 12:56:29 +01:00
vabene1111
39656152d3 fixed disabling shopping auto sync not working 2023-02-12 12:55:26 +01:00
vabene1111
22c88e5269 prevent double loading on import 2023-02-12 08:28:26 +01:00
vabene1111
89550e8345 fixed ingredient editor breaking import 2023-02-12 08:28:16 +01:00
vabene1111
9846c4df18 added support for rezeptsuite.de imports 2023-02-11 17:51:44 +01:00
vabene1111
924d1cb71b improved search food api performance 2023-02-11 16:27:41 +01:00
vabene1111
44236f611e removed unnecessary api calles in MealPlanEditModal 2023-02-11 15:56:11 +01:00
vabene1111
012dea5a0c fixed and improved import ingredient edit 2023-02-11 11:57:52 +01:00
vabene1111
820c9b704f improved servings parser 2023-02-11 09:04:05 +01:00
vabene1111
ed92926ec4 fixed plural import 2023-02-11 09:01:10 +01:00
vertilo
bc560ee76d Translated using Weblate (Ukrainian)
Currently translated at 52.9% (253 of 478 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/uk/
2023-02-10 14:55:46 +00:00
vertilo
b6c4130e4b Translated using Weblate (Ukrainian)
Currently translated at 52.7% (252 of 478 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/uk/
2023-02-09 13:55:15 +00:00
vertilo
b0ca391bb4 Translated using Weblate (Ukrainian)
Currently translated at 0.1% (1 of 528 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/uk/
2023-02-09 13:55:15 +00:00
Marion Kämpfer
45a6b1d386 Translated using Weblate (French)
Currently translated at 93.5% (447 of 478 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/fr/
2023-02-09 13:55:15 +00:00
Laura
4626ffcbc5 Translated using Weblate (French)
Currently translated at 93.5% (447 of 478 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/fr/
2023-02-09 13:55:14 +00:00
Andreas Ljungberg
c3a9cc94fa Translated using Weblate (Swedish)
Currently translated at 100.0% (478 of 478 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/sv/
2023-02-09 13:55:14 +00:00
Marion Kämpfer
a8eb8bb8d7 Translated using Weblate (German)
Currently translated at 99.7% (477 of 478 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/de/
2023-02-09 13:55:14 +00:00
Marion Kämpfer
b14c9aa68c Translated using Weblate (French)
Currently translated at 87.5% (422 of 482 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/fr/
2023-02-09 13:55:14 +00:00
Marion Kämpfer
b03db7ad36 Translated using Weblate (German)
Currently translated at 99.5% (480 of 482 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/de/
2023-02-09 13:55:14 +00:00
Adri
cc706a1195 Translated using Weblate (Italian)
Currently translated at 92.1% (444 of 482 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/it/
2023-02-05 03:55:47 +00:00
dependabot[bot]
c352bf82dd Bump django-debug-toolbar from 3.7.0 to 3.8.1
Bumps [django-debug-toolbar](https://github.com/jazzband/django-debug-toolbar) from 3.7.0 to 3.8.1.
- [Release notes](https://github.com/jazzband/django-debug-toolbar/releases)
- [Changelog](https://github.com/jazzband/django-debug-toolbar/blob/main/docs/changes.rst)
- [Commits](https://github.com/jazzband/django-debug-toolbar/compare/3.7...3.8.1)

---
updated-dependencies:
- dependency-name: django-debug-toolbar
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-01 00:02:03 +00:00
dependabot[bot]
a305527ba2 Bump recipe-scrapers from 14.24.0 to 14.30.0
Bumps [recipe-scrapers](https://github.com/hhursev/recipe-scrapers) from 14.24.0 to 14.30.0.
- [Release notes](https://github.com/hhursev/recipe-scrapers/releases)
- [Commits](https://github.com/hhursev/recipe-scrapers/compare/14.24.0...14.30.0)

---
updated-dependencies:
- dependency-name: recipe-scrapers
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-01 00:01:46 +00:00
dependabot[bot]
c0e35e89e9 Bump pillow from 9.3.0 to 9.4.0
Bumps [pillow](https://github.com/python-pillow/Pillow) from 9.3.0 to 9.4.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/9.3.0...9.4.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-01 00:01:39 +00:00
Marcus Wolschon
bce44866c2 add translations, go back to using scraper.instructions() 2023-01-30 16:49:38 +01:00
Marcus Wolschon
f43ef3ad59 another typo 2023-01-15 13:04:29 +01:00
Marcus Wolschon
4c71c5b088 fix typo 2023-01-15 13:03:51 +01:00
Marcus Wolschon
54d0b70f01 #1552 use instructions_list() instead of instructions() and move Thermomix-Handling to clean_instruction_string() 2023-01-15 12:55:03 +01:00
Marcus Wolschon
5a0f07a6b2 handle steps 2023-01-13 22:21:31 +01:00
Marcus Wolschon
a4bf967f65 #1552 Import Recipes from Cookidoo 2023-01-13 21:33:01 +01:00
Marcus Wolschon
77feb0db3a #1552 Import Recipes from Cookidoo 2023-01-13 21:31:49 +01:00
Marcus Wolschon
33c634c0e2 #1552 Import Recipes from Cookidoo 2023-01-13 21:22:17 +01:00
Marcus Wolschon
be24e25ae4 #1552 Import Recipes from Cookidoo 2023-01-13 21:19:49 +01:00
178 changed files with 9849 additions and 6020 deletions

View File

@@ -2,6 +2,7 @@
# when unset: 1 (true) - dont unset this, just for development
DEBUG=0
SQL_DEBUG=0
DEBUG_TOOLBAR=0
# HTTP port to bind to
# TANDOOR_PORT=8080
@@ -157,6 +158,7 @@ REVERSE_PROXY_AUTH=0
#AUTH_LDAP_BIND_PASSWORD=
#AUTH_LDAP_USER_SEARCH_BASE_DN=
#AUTH_LDAP_TLS_CACERTFILE=
#AUTH_LDAP_START_TLS=
# Enables exporting PDF (see export docs)
# Disabled by default, uncomment to enable

View File

@@ -14,3 +14,8 @@ updates:
directory: "/vue/"
schedule:
interval: "monthly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"

142
.github/workflows/build-docker.yml vendored Normal file
View File

@@ -0,0 +1,142 @@
name: Build Docker Container
on: push
jobs:
build-container:
name: Build ${{ matrix.name }} Container
runs-on: ubuntu-latest
if: github.repository_owner == 'TandoorRecipes'
continue-on-error: ${{ matrix.continue-on-error }}
permissions:
contents: read
packages: write
strategy:
matrix:
include:
# Standard build config
- name: Standard
dockerfile: Dockerfile
platforms: linux/amd64,linux/arm64
suffix: ""
continue-on-error: false
# Raspi build config
- name: Raspi
dockerfile: Dockerfile-raspi
platforms: linux/arm/v7
suffix: "-raspi"
continue-on-error: true
steps:
- uses: actions/checkout@v3
- name: Get version number
id: get_version
run: |
if [[ "$GITHUB_REF" = refs/tags/* ]]; then
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
elif [[ "$GITHUB_REF" = refs/heads/beta ]]; then
echo VERSION=beta >> $GITHUB_OUTPUT
else
echo VERSION=develop >> $GITHUB_OUTPUT
fi
# Update Version number
- name: Update version file
uses: DamianReeves/write-file-action@v1.2
with:
path: recipes/version.py
contents: |
VERSION_NUMBER = '${{ steps.get_version.outputs.VERSION }}'
BUILD_REF = '${{ github.sha }}'
write-mode: overwrite
# Build Vue frontend
- uses: actions/setup-node@v3
with:
node-version: '14'
cache: yarn
cache-dependency-path: vue/yarn.lock
- name: Install dependencies
working-directory: ./vue
run: yarn install --frozen-lockfile
- name: Build dependencies
working-directory: ./vue
run: yarn build
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
if: github.secret_source == 'Actions'
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
if: github.secret_source == 'Actions'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
vabene1111/recipes
ghcr.io/TandoorRecipes/recipes
flavor: |
latest=false
suffix=${{ matrix.suffix }}
tags: |
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=ref,event=branch
- name: Build and Push
uses: docker/build-push-action@v4
with:
context: .
file: ${{ matrix.dockerfile }}
pull: true
push: ${{ github.secret_source == 'Actions' }}
platforms: ${{ matrix.platforms }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
notify-stable:
name: Notify Stable
runs-on: ubuntu-latest
needs: build-container
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Set tag name
run: |
# Strip "refs/tags/" prefix
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
# Send stable discord notification
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_RELEASE_WEBHOOK }}
uses: Ilshidur/action-discord@0.3.2
with:
args: '🚀 Version {{ VERSION }} of tandoor has been released 🥳 Check it out https://github.com/vabene1111/recipes/releases/tag/{{ VERSION }}'
notify-beta:
name: Notify Beta
runs-on: ubuntu-latest
needs: build-container
if: github.ref == 'refs/heads/beta'
steps:
# Send beta discord notification
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_BETA_WEBHOOK }}
uses: Ilshidur/action-discord@0.3.2
with:
args: '🚀 The BETA Image has been updated! 🥳'

View File

@@ -12,7 +12,7 @@ jobs:
python-version: ['3.10']
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:

View File

@@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
@@ -25,7 +25,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
# Override language selection by uncommenting this and choosing your languages
with:
languages: python, javascript
@@ -47,6 +47,6 @@ jobs:
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
with:
languages: javascript, python

View File

@@ -1,48 +0,0 @@
name: publish beta raspi image docker
on:
push:
branches:
- 'beta'
jobs:
build:
if: github.repository_owner == 'TandoorRecipes'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
# Update Version number
- name: Update version file
uses: DamianReeves/write-file-action@v1.0
with:
path: recipes/version.py
contents: |
VERSION_NUMBER = 'beta'
BUILD_REF = '${{ github.sha }}'
write-mode: overwrite
# Build Vue frontend
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies
working-directory: ./vue
run: yarn install
- name: Build dependencies
working-directory: ./vue
run: yarn build
# Build container
- name: Build and publish image
uses: ilteoood/docker_buildx@master
with:
publish: true
imageName: vabene1111/recipes
tag: beta-raspi
dockerFile: Dockerfile-raspi
platform: linux/arm/v7
dockerUser: ${{ secrets.DOCKER_USERNAME }}
dockerPassword: ${{ secrets.DOCKER_PASSWORD }}
# Send discord notification
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_BETA_WEBHOOK }}
uses: Ilshidur/action-discord@0.3.2
with:
args: '🚀 The BETA Image has been updated! 🥳'

View File

@@ -1,47 +0,0 @@
name: publish beta image docker
on:
push:
branches:
- 'beta'
jobs:
build:
if: github.repository_owner == 'TandoorRecipes'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
# Update Version number
- name: Update version file
uses: DamianReeves/write-file-action@v1.0
with:
path: recipes/version.py
contents: |
VERSION_NUMBER = 'beta'
BUILD_REF = '${{ github.sha }}'
write-mode: overwrite
# Build Vue frontend
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies
working-directory: ./vue
run: yarn install
- name: Build dependencies
working-directory: ./vue
run: yarn build
# Build container
- name: Build and publish image
uses: ilteoood/docker_buildx@master
with:
publish: true
imageName: vabene1111/recipes
tag: beta
platform: linux/amd64,linux/arm64
dockerUser: ${{ secrets.DOCKER_USERNAME }}
dockerPassword: ${{ secrets.DOCKER_PASSWORD }}
# Send discord notification
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_BETA_WEBHOOK }}
uses: Ilshidur/action-discord@0.3.2
with:
args: '🚀 The BETA Image has been updated! 🥳'

View File

@@ -1,42 +0,0 @@
name: publish dev image docker
on:
push:
branches:
- '*'
- '*/*'
- '!master'
jobs:
build:
if: github.repository_owner == 'TandoorRecipes'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
# Update Version number
- name: Update version file
uses: DamianReeves/write-file-action@v1.0
with:
path: recipes/version.py
contents: |
VERSION_NUMBER = 'develop'
BUILD_REF = '${{ github.sha }}'
write-mode: overwrite
# Build Vue frontend
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Clear Cache
working-directory: ./vue
run: yarn cache clean --all
- name: Install dependencies
working-directory: ./vue
run: yarn install
- name: Build dependencies
working-directory: ./vue
run: yarn build
# Build container
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@2.13
with:
name: vabene1111/recipes
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

View File

@@ -1,45 +0,0 @@
name: publish latest raspi image docker
on:
push:
tags:
- '*'
jobs:
build:
if: github.repository_owner == 'TandoorRecipes'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Get version number
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}-raspi
# Update Version number
- name: Update version file
uses: DamianReeves/write-file-action@v1.0
with:
path: recipes/version.py
contents: |
VERSION_NUMBER = '${{ steps.get_version.outputs.VERSION }}-raspi'
BUILD_REF = '${{ github.sha }}'
write-mode: overwrite
# Build Vue frontend
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies
working-directory: ./vue
run: yarn install
- name: Build dependencies
working-directory: ./vue
run: yarn build
# Build container
- name: Build and publish image
uses: ilteoood/docker_buildx@master
with:
publish: true
imageName: vabene1111/recipes
dockerFile: Dockerfile-raspi
platform: linux/arm/v7
tag: latest-raspi
dockerUser: ${{ secrets.DOCKER_USERNAME }}
dockerPassword: ${{ secrets.DOCKER_PASSWORD }}

View File

@@ -1,44 +0,0 @@
name: publish latest image docker
on:
push:
tags:
- '*'
jobs:
build:
if: github.repository_owner == 'TandoorRecipes'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Get version number
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
# Update Version number
- name: Update version file
uses: DamianReeves/write-file-action@v1.0
with:
path: recipes/version.py
contents: |
VERSION_NUMBER = '${{ steps.get_version.outputs.VERSION }}'
BUILD_REF = '${{ github.sha }}'
write-mode: overwrite
# Build Vue frontend
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies
working-directory: ./vue
run: yarn install
- name: Build dependencies
working-directory: ./vue
run: yarn build
# Build container
- name: Build and publish image
uses: ilteoood/docker_buildx@master
with:
publish: true
imageName: vabene1111/recipes
platform: linux/amd64,linux/arm64
tag: latest
dockerUser: ${{ secrets.DOCKER_USERNAME }}
dockerPassword: ${{ secrets.DOCKER_PASSWORD }}

View File

@@ -1,47 +0,0 @@
name: publish tagged raspi release docker
on:
release:
types: [published]
jobs:
build:
if: github.repository_owner == 'TandoorRecipes'
runs-on: ubuntu-latest
name: Build image job
steps:
- name: Checkout master
uses: actions/checkout@master
- name: Get version number
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
# Update Version number
- name: Update version file
uses: DamianReeves/write-file-action@v1.0
with:
path: recipes/version.py
contents: |
VERSION_NUMBER = '${{ steps.get_version.outputs.VERSION }}'
BUILD_REF = '${{ github.sha }}'
write-mode: overwrite
# Build Vue frontend
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies
working-directory: ./vue
run: yarn install
- name: Build dependencies
working-directory: ./vue
run: yarn build
# Build container
- name: Build and publish image
uses: ilteoood/docker_buildx@master
with:
publish: true
imageName: vabene1111/recipes
dockerFile: Dockerfile-raspi
platform: linux/arm/v7
tag: ${{ steps.get_version.outputs.VERSION }}-raspi
dockerUser: ${{ secrets.DOCKER_USERNAME }}
dockerPassword: ${{ secrets.DOCKER_PASSWORD }}

View File

@@ -1,53 +0,0 @@
name: publish tagged release docker
on:
release:
types: [published]
jobs:
build:
if: github.repository_owner == 'TandoorRecipes'
runs-on: ubuntu-latest
name: Build image job
steps:
- name: Checkout master
uses: actions/checkout@master
- name: Get version number
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
# Update Version number
- name: Update version file
uses: DamianReeves/write-file-action@v1.0
with:
path: recipes/version.py
contents: |
VERSION_NUMBER = '${{ steps.get_version.outputs.VERSION }}'
BUILD_REF = '${{ github.sha }}'
write-mode: overwrite
# Build Vue frontend
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies
working-directory: ./vue
run: yarn install
- name: Build dependencies
working-directory: ./vue
run: yarn build
# Build container
- name: Build and publish image
uses: ilteoood/docker_buildx@master
with:
publish: true
imageName: vabene1111/recipes
platform: linux/amd64,linux/arm64
tag: ${{ steps.get_version.outputs.VERSION }}
dockerUser: ${{ secrets.DOCKER_USERNAME }}
dockerPassword: ${{ secrets.DOCKER_PASSWORD }}
# Send discord notification
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_RELEASE_WEBHOOK }}
uses: Ilshidur/action-discord@0.3.2
with:
args: '🚀 Version {{ EVENT_PAYLOAD.release.tag_name }} of tandoor has been released 🥳 Check it out https://github.com/vabene1111/recipes/releases/tag/{{ EVENT_PAYLOAD.release.tag_name }}'

View File

@@ -9,8 +9,8 @@ jobs:
if: github.repository_owner == 'TandoorRecipes'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- run: pip install mkdocs-material mkdocs-include-markdown-plugin

1
.gitignore vendored
View File

@@ -78,6 +78,7 @@ postgresql/
/docker-compose.override.yml
vue/node_modules
plugins
.vscode/
vetur.config.js
cookbook/static/vue

8
.idea/dictionaries/vaben.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<component name="ProjectDictionaryState">
<dictionary name="vaben">
<words>
<w>pinia</w>
<w>selfhosted</w>
</words>
</dictionary>
</component>

2
.idea/recipes.iml generated
View File

@@ -18,7 +18,7 @@
<excludeFolder url="file://$MODULE_DIR$/staticfiles" />
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="jdk" jdkName="Python 3.11 (recipes)" jdkType="Python SDK" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TemplatesService">

View File

@@ -32,11 +32,11 @@ admin.site.unregister(Group)
@admin.action(description='Delete all data from a space')
def delete_space_action(modeladmin, request, queryset):
for space in queryset:
space.save()
space.safe_delete()
class SpaceAdmin(admin.ModelAdmin):
list_display = ('name', 'created_by', 'max_recipes', 'max_users', 'max_file_storage_mb', 'allow_sharing', 'use_plural')
list_display = ('name', 'created_by', 'max_recipes', 'max_users', 'max_file_storage_mb', 'allow_sharing')
search_fields = ('name', 'created_by__username')
list_filter = ('max_recipes', 'max_users', 'max_file_storage_mb', 'allow_sharing')
date_hierarchy = 'created_at'

View File

@@ -167,8 +167,25 @@ class ImportExportBase(forms.Form):
))
class MultipleFileInput(forms.ClearableFileInput):
allow_multiple_selected = True
class MultipleFileField(forms.FileField):
def __init__(self, *args, **kwargs):
kwargs.setdefault("widget", MultipleFileInput())
super().__init__(*args, **kwargs)
def clean(self, data, initial=None):
single_file_clean = super().clean
if isinstance(data, (list, tuple)):
result = [single_file_clean(d, initial) for d in data]
else:
result = single_file_clean(data, initial)
return result
class ImportForm(ImportExportBase):
files = forms.FileField(required=True, widget=forms.ClearableFileInput(attrs={'multiple': True}))
files = MultipleFileField(required=True)
duplicates = forms.BooleanField(help_text=_(
'To prevent duplicates recipes with the same name as existing ones are ignored. Check this box to import everything.'),
required=False)

View File

@@ -126,6 +126,8 @@ class IngredientParser:
amount = 0
unit = None
note = ''
if x.strip() == '':
return amount, unit, note
did_check_frac = False
end = 0

View File

@@ -123,7 +123,7 @@ def share_link_valid(recipe, share):
return c
if link := ShareLink.objects.filter(recipe=recipe, uuid=share, abuse_blocked=False).first():
if 0 < settings.SHARING_LIMIT < link.request_count:
if 0 < settings.SHARING_LIMIT < link.request_count and not link.space.no_sharing_limit:
return False
link.request_count += 1
link.save()

View File

@@ -3,9 +3,9 @@ from collections import Counter
from datetime import date, timedelta
from django.contrib.postgres.search import SearchQuery, SearchRank, SearchVector, TrigramSimilarity
from django.core.cache import cache
from django.core.cache import caches
from django.db.models import (Avg, Case, Count, Exists, F, Func, Max, OuterRef, Q, Subquery, Value, When, FilteredRelation)
from django.core.cache import cache, caches
from django.db.models import (Avg, Case, Count, Exists, F, Func, Max, OuterRef, Q, Subquery, Value,
When)
from django.db.models.functions import Coalesce, Lower, Substr
from django.utils import timezone, translation
from django.utils.translation import gettext as _
@@ -20,7 +20,8 @@ from recipes import settings
# TODO create extensive tests to make sure ORs ANDs and various filters, sorting, etc work as expected
# TODO consider creating a simpleListRecipe API that only includes minimum of recipe info and minimal filtering
class RecipeSearch():
_postgres = settings.DATABASES['default']['ENGINE'] in ['django.db.backends.postgresql_psycopg2', 'django.db.backends.postgresql']
_postgres = settings.DATABASES['default']['ENGINE'] in [
'django.db.backends.postgresql_psycopg2', 'django.db.backends.postgresql']
def __init__(self, request, **params):
self._request = request
@@ -45,7 +46,8 @@ class RecipeSearch():
cache.set(CACHE_KEY, self._search_prefs, timeout=10)
else:
self._search_prefs = SearchPreference()
self._string = self._params.get('query').strip() if self._params.get('query', None) else None
self._string = self._params.get('query').strip(
) if self._params.get('query', None) else None
self._rating = self._params.get('rating', None)
self._keywords = {
'or': self._params.get('keywords_or', None) or self._params.get('keywords', None),
@@ -74,7 +76,8 @@ class RecipeSearch():
self._random = str2bool(self._params.get('random', False))
self._new = str2bool(self._params.get('new', False))
self._num_recent = int(self._params.get('num_recent', 0))
self._include_children = str2bool(self._params.get('include_children', None))
self._include_children = str2bool(
self._params.get('include_children', None))
self._timescooked = self._params.get('timescooked', None)
self._cookedon = self._params.get('cookedon', None)
self._createdon = self._params.get('createdon', None)
@@ -95,18 +98,24 @@ class RecipeSearch():
self._search_type = self._search_prefs.search or 'plain'
if self._string:
if self._postgres:
self._unaccent_include = self._search_prefs.unaccent.values_list('field', flat=True)
self._unaccent_include = self._search_prefs.unaccent.values_list(
'field', flat=True)
else:
self._unaccent_include = []
self._icontains_include = [x + '__unaccent' if x in self._unaccent_include else x for x in self._search_prefs.icontains.values_list('field', flat=True)]
self._istartswith_include = [x + '__unaccent' if x in self._unaccent_include else x for x in self._search_prefs.istartswith.values_list('field', flat=True)]
self._icontains_include = [
x + '__unaccent' if x in self._unaccent_include else x for x in self._search_prefs.icontains.values_list('field', flat=True)]
self._istartswith_include = [
x + '__unaccent' if x in self._unaccent_include else x for x in self._search_prefs.istartswith.values_list('field', flat=True)]
self._trigram_include = None
self._fulltext_include = None
self._trigram = False
if self._postgres and self._string:
self._language = DICTIONARY.get(translation.get_language(), 'simple')
self._trigram_include = [x + '__unaccent' if x in self._unaccent_include else x for x in self._search_prefs.trigram.values_list('field', flat=True)]
self._fulltext_include = self._search_prefs.fulltext.values_list('field', flat=True) or None
self._language = DICTIONARY.get(
translation.get_language(), 'simple')
self._trigram_include = [
x + '__unaccent' if x in self._unaccent_include else x for x in self._search_prefs.trigram.values_list('field', flat=True)]
self._fulltext_include = self._search_prefs.fulltext.values_list(
'field', flat=True) or None
if self._search_type not in ['websearch', 'raw'] and self._trigram_include:
self._trigram = True
@@ -182,8 +191,10 @@ class RecipeSearch():
# otherwise sort by the remaining order_by attributes or favorite by default
else:
order += default_order
order[:] = [Lower('name').asc() if x == 'name' else x for x in order]
order[:] = [Lower('name').desc() if x == '-name' else x for x in order]
order[:] = [Lower('name').asc() if x ==
'name' else x for x in order]
order[:] = [Lower('name').desc() if x ==
'-name' else x for x in order]
self.orderby = order
def string_filters(self, string=None):
@@ -200,21 +211,28 @@ class RecipeSearch():
for f in self._filters:
query_filter |= f
self._queryset = self._queryset.filter(query_filter).distinct() # this creates duplicate records which can screw up other aggregates, see makenow for workaround
# this creates duplicate records which can screw up other aggregates, see makenow for workaround
self._queryset = self._queryset.filter(query_filter).distinct()
if self._fulltext_include:
if self._fuzzy_match is None:
self._queryset = self._queryset.annotate(score=Coalesce(Max(self.search_rank), 0.0))
self._queryset = self._queryset.annotate(
score=Coalesce(Max(self.search_rank), 0.0))
else:
self._queryset = self._queryset.annotate(rank=Coalesce(Max(self.search_rank), 0.0))
self._queryset = self._queryset.annotate(
rank=Coalesce(Max(self.search_rank), 0.0))
if self._fuzzy_match is not None:
simularity = self._fuzzy_match.filter(pk=OuterRef('pk')).values('simularity')
simularity = self._fuzzy_match.filter(
pk=OuterRef('pk')).values('simularity')
if not self._fulltext_include:
self._queryset = self._queryset.annotate(score=Coalesce(Subquery(simularity), 0.0))
self._queryset = self._queryset.annotate(
score=Coalesce(Subquery(simularity), 0.0))
else:
self._queryset = self._queryset.annotate(simularity=Coalesce(Subquery(simularity), 0.0))
self._queryset = self._queryset.annotate(
simularity=Coalesce(Subquery(simularity), 0.0))
if self._sort_includes('score') and self._fulltext_include and self._fuzzy_match is not None:
self._queryset = self._queryset.annotate(score=F('rank') + F('simularity'))
self._queryset = self._queryset.annotate(
score=F('rank') + F('simularity'))
else:
query_filter = Q()
for f in [x + '__unaccent__iexact' if x in self._unaccent_include else x + '__iexact' for x in SearchFields.objects.all().values_list('field', flat=True)]:
@@ -223,7 +241,8 @@ class RecipeSearch():
def _cooked_on_filter(self, cooked_date=None):
if self._sort_includes('lastcooked') or cooked_date:
lessthan = self._sort_includes('-lastcooked') or '-' in (cooked_date or [])[:1]
lessthan = self._sort_includes(
'-lastcooked') or '-' in (cooked_date or [])[:1]
if lessthan:
default = timezone.now() - timedelta(days=100000)
else:
@@ -233,32 +252,41 @@ class RecipeSearch():
if cooked_date is None:
return
cooked_date = date(*[int(x) for x in cooked_date.split('-') if x != ''])
cooked_date = date(*[int(x)
for x in cooked_date.split('-') if x != ''])
if lessthan:
self._queryset = self._queryset.filter(lastcooked__date__lte=cooked_date).exclude(lastcooked=default)
self._queryset = self._queryset.filter(
lastcooked__date__lte=cooked_date).exclude(lastcooked=default)
else:
self._queryset = self._queryset.filter(lastcooked__date__gte=cooked_date).exclude(lastcooked=default)
self._queryset = self._queryset.filter(
lastcooked__date__gte=cooked_date).exclude(lastcooked=default)
def _created_on_filter(self, created_date=None):
if created_date is None:
return
lessthan = '-' in created_date[:1]
created_date = date(*[int(x) for x in created_date.split('-') if x != ''])
created_date = date(*[int(x)
for x in created_date.split('-') if x != ''])
if lessthan:
self._queryset = self._queryset.filter(created_at__date__lte=created_date)
self._queryset = self._queryset.filter(
created_at__date__lte=created_date)
else:
self._queryset = self._queryset.filter(created_at__date__gte=created_date)
self._queryset = self._queryset.filter(
created_at__date__gte=created_date)
def _updated_on_filter(self, updated_date=None):
if updated_date is None:
return
lessthan = '-' in updated_date[:1]
updated_date = date(*[int(x) for x in updated_date.split('-') if x != ''])
updated_date = date(*[int(x)
for x in updated_date.split('-') if x != ''])
if lessthan:
self._queryset = self._queryset.filter(updated_at__date__lte=updated_date)
self._queryset = self._queryset.filter(
updated_at__date__lte=updated_date)
else:
self._queryset = self._queryset.filter(updated_at__date__gte=updated_date)
self._queryset = self._queryset.filter(
updated_at__date__gte=updated_date)
def _viewed_on_filter(self, viewed_date=None):
if self._sort_includes('lastviewed') or viewed_date:
@@ -268,12 +296,15 @@ class RecipeSearch():
if viewed_date is None:
return
lessthan = '-' in viewed_date[:1]
viewed_date = date(*[int(x) for x in viewed_date.split('-') if x != ''])
viewed_date = date(*[int(x)
for x in viewed_date.split('-') if x != ''])
if lessthan:
self._queryset = self._queryset.filter(lastviewed__date__lte=viewed_date).exclude(lastviewed=longTimeAgo)
self._queryset = self._queryset.filter(
lastviewed__date__lte=viewed_date).exclude(lastviewed=longTimeAgo)
else:
self._queryset = self._queryset.filter(lastviewed__date__gte=viewed_date).exclude(lastviewed=longTimeAgo)
self._queryset = self._queryset.filter(
lastviewed__date__gte=viewed_date).exclude(lastviewed=longTimeAgo)
def _new_recipes(self, new_days=7):
# TODO make new days a user-setting
@@ -293,27 +324,32 @@ class RecipeSearch():
num_recent_recipes = ViewLog.objects.filter(created_by=self._request.user, space=self._request.space).values(
'recipe').annotate(recent=Max('created_at')).order_by('-recent')[:num_recent]
self._queryset = self._queryset.annotate(recent=Coalesce(Max(Case(When(pk__in=num_recent_recipes.values('recipe'), then='viewlog__pk'))), Value(0)))
self._queryset = self._queryset.annotate(recent=Coalesce(Max(Case(When(
pk__in=num_recent_recipes.values('recipe'), then='viewlog__pk'))), Value(0)))
def _favorite_recipes(self, times_cooked=None):
if self._sort_includes('favorite') or times_cooked:
less_than = '-' in (times_cooked or []) or not self._sort_includes('-favorite')
less_than = '-' in (times_cooked or []
) and not self._sort_includes('-favorite')
if less_than:
default = 1000
else:
default = 0
favorite_recipes = CookLog.objects.filter(created_by=self._request.user, space=self._request.space, recipe=OuterRef('pk')
).values('recipe').annotate(count=Count('pk', distinct=True)).values('count')
self._queryset = self._queryset.annotate(favorite=Coalesce(Subquery(favorite_recipes), default))
self._queryset = self._queryset.annotate(
favorite=Coalesce(Subquery(favorite_recipes), default))
if times_cooked is None:
return
if times_cooked == '0':
self._queryset = self._queryset.filter(favorite=0)
elif less_than:
self._queryset = self._queryset.filter(favorite__lte=int(times_cooked[1:])).exclude(favorite=0)
self._queryset = self._queryset.filter(favorite__lte=int(
times_cooked.replace('-', ''))).exclude(favorite=0)
else:
self._queryset = self._queryset.filter(favorite__gte=int(times_cooked))
self._queryset = self._queryset.filter(
favorite__gte=int(times_cooked))
def keyword_filters(self, **kwargs):
if all([kwargs[x] is None for x in kwargs]):
@@ -346,7 +382,8 @@ class RecipeSearch():
else:
self._queryset = self._queryset.filter(f_and)
if 'not' in kw_filter:
self._queryset = self._queryset.exclude(id__in=recipes.values('id'))
self._queryset = self._queryset.exclude(
id__in=recipes.values('id'))
def food_filters(self, **kwargs):
if all([kwargs[x] is None for x in kwargs]):
@@ -360,7 +397,8 @@ class RecipeSearch():
foods = Food.objects.filter(pk__in=kwargs[fd_filter])
if 'or' in fd_filter:
if self._include_children:
f_or = Q(steps__ingredients__food__in=Food.include_descendants(foods))
f_or = Q(
steps__ingredients__food__in=Food.include_descendants(foods))
else:
f_or = Q(steps__ingredients__food__in=foods)
@@ -372,7 +410,8 @@ class RecipeSearch():
recipes = Recipe.objects.all()
for food in foods:
if self._include_children:
f_and = Q(steps__ingredients__food__in=food.get_descendants_and_self())
f_and = Q(
steps__ingredients__food__in=food.get_descendants_and_self())
else:
f_and = Q(steps__ingredients__food=food)
if 'not' in fd_filter:
@@ -380,7 +419,8 @@ class RecipeSearch():
else:
self._queryset = self._queryset.filter(f_and)
if 'not' in fd_filter:
self._queryset = self._queryset.exclude(id__in=recipes.values('id'))
self._queryset = self._queryset.exclude(
id__in=recipes.values('id'))
def unit_filters(self, units=None, operator=True):
if operator != True:
@@ -389,7 +429,8 @@ class RecipeSearch():
return
if not isinstance(units, list):
units = [units]
self._queryset = self._queryset.filter(steps__ingredients__unit__in=units)
self._queryset = self._queryset.filter(
steps__ingredients__unit__in=units)
def rating_filter(self, rating=None):
if rating or self._sort_includes('rating'):
@@ -399,14 +440,16 @@ class RecipeSearch():
else:
default = 0
# TODO make ratings a settings user-only vs all-users
self._queryset = self._queryset.annotate(rating=Round(Avg(Case(When(cooklog__created_by=self._request.user, then='cooklog__rating'), default=default))))
self._queryset = self._queryset.annotate(rating=Round(Avg(Case(When(
cooklog__created_by=self._request.user, then='cooklog__rating'), default=default))))
if rating is None:
return
if rating == '0':
self._queryset = self._queryset.filter(rating=0)
elif lessthan:
self._queryset = self._queryset.filter(rating__lte=int(rating[1:])).exclude(rating=0)
self._queryset = self._queryset.filter(
rating__lte=int(rating[1:])).exclude(rating=0)
else:
self._queryset = self._queryset.filter(rating__gte=int(rating))
@@ -434,11 +477,14 @@ class RecipeSearch():
recipes = Recipe.objects.all()
for book in kwargs[bk_filter]:
if 'not' in bk_filter:
recipes = recipes.filter(recipebookentry__book__id=book)
recipes = recipes.filter(
recipebookentry__book__id=book)
else:
self._queryset = self._queryset.filter(recipebookentry__book__id=book)
self._queryset = self._queryset.filter(
recipebookentry__book__id=book)
if 'not' in bk_filter:
self._queryset = self._queryset.exclude(id__in=recipes.values('id'))
self._queryset = self._queryset.exclude(
id__in=recipes.values('id'))
def step_filters(self, steps=None, operator=True):
if operator != True:
@@ -446,7 +492,7 @@ class RecipeSearch():
if not steps:
return
if not isinstance(steps, list):
steps = [unistepsts]
steps = [steps]
self._queryset = self._queryset.filter(steps__id__in=steps)
def build_fulltext_filters(self, string=None):
@@ -457,20 +503,25 @@ class RecipeSearch():
rank = []
if 'name' in self._fulltext_include:
vectors.append('name_search_vector')
rank.append(SearchRank('name_search_vector', self.search_query, cover_density=True))
rank.append(SearchRank('name_search_vector',
self.search_query, cover_density=True))
if 'description' in self._fulltext_include:
vectors.append('desc_search_vector')
rank.append(SearchRank('desc_search_vector', self.search_query, cover_density=True))
rank.append(SearchRank('desc_search_vector',
self.search_query, cover_density=True))
if 'steps__instruction' in self._fulltext_include:
vectors.append('steps__search_vector')
rank.append(SearchRank('steps__search_vector', self.search_query, cover_density=True))
rank.append(SearchRank('steps__search_vector',
self.search_query, cover_density=True))
if 'keywords__name' in self._fulltext_include:
# explicitly settings unaccent on keywords and foods so that they behave the same as search_vector fields
vectors.append('keywords__name__unaccent')
rank.append(SearchRank('keywords__name__unaccent', self.search_query, cover_density=True))
rank.append(SearchRank('keywords__name__unaccent',
self.search_query, cover_density=True))
if 'steps__ingredients__food__name' in self._fulltext_include:
vectors.append('steps__ingredients__food__name__unaccent')
rank.append(SearchRank('steps__ingredients__food__name', self.search_query, cover_density=True))
rank.append(SearchRank('steps__ingredients__food__name',
self.search_query, cover_density=True))
for r in rank:
if self.search_rank is None:
@@ -478,7 +529,8 @@ class RecipeSearch():
else:
self.search_rank += r
# modifying queryset will annotation creates duplicate results
self._filters.append(Q(id__in=Recipe.objects.annotate(vector=SearchVector(*vectors)).filter(Q(vector=self.search_query))))
self._filters.append(Q(id__in=Recipe.objects.annotate(
vector=SearchVector(*vectors)).filter(Q(vector=self.search_query))))
def build_text_filters(self, string=None):
if not string:
@@ -510,23 +562,30 @@ class RecipeSearch():
def _makenow_filter(self, missing=None):
if missing is None or (type(missing) == bool and missing == False):
return
shopping_users = [*self._request.user.get_shopping_share(), self._request.user]
shopping_users = [
*self._request.user.get_shopping_share(), self._request.user]
onhand_filter = (
Q(steps__ingredients__food__onhand_users__in=shopping_users) # food onhand
| Q(steps__ingredients__food__substitute__onhand_users__in=shopping_users) # or substitute food onhand
| Q(steps__ingredients__food__in=self.__children_substitute_filter(shopping_users))
| Q(steps__ingredients__food__in=self.__sibling_substitute_filter(shopping_users))
Q(steps__ingredients__food__onhand_users__in=shopping_users) # food onhand
# or substitute food onhand
| Q(steps__ingredients__food__substitute__onhand_users__in=shopping_users)
| Q(steps__ingredients__food__in=self.__children_substitute_filter(shopping_users))
| Q(steps__ingredients__food__in=self.__sibling_substitute_filter(shopping_users))
)
makenow_recipes = Recipe.objects.annotate(
count_food=Count('steps__ingredients__food__pk', filter=Q(steps__ingredients__food__isnull=False), distinct=True),
count_onhand=Count('steps__ingredients__food__pk', filter=onhand_filter, distinct=True),
count_food=Count('steps__ingredients__food__pk', filter=Q(
steps__ingredients__food__isnull=False), distinct=True),
count_onhand=Count('steps__ingredients__food__pk',
filter=onhand_filter, distinct=True),
count_ignore_shopping=Count('steps__ingredients__food__pk', filter=Q(steps__ingredients__food__ignore_shopping=True,
steps__ingredients__food__recipe__isnull=True), distinct=True),
has_child_sub=Case(When(steps__ingredients__food__in=self.__children_substitute_filter(shopping_users), then=Value(1)), default=Value(0)),
has_sibling_sub=Case(When(steps__ingredients__food__in=self.__sibling_substitute_filter(shopping_users), then=Value(1)), default=Value(0))
has_child_sub=Case(When(steps__ingredients__food__in=self.__children_substitute_filter(
shopping_users), then=Value(1)), default=Value(0)),
has_sibling_sub=Case(When(steps__ingredients__food__in=self.__sibling_substitute_filter(
shopping_users), then=Value(1)), default=Value(0))
).annotate(missingfood=F('count_food') - F('count_onhand') - F('count_ignore_shopping')).filter(missingfood=missing)
self._queryset = self._queryset.distinct().filter(id__in=makenow_recipes.values('id'))
self._queryset = self._queryset.distinct().filter(
id__in=makenow_recipes.values('id'))
@staticmethod
def __children_substitute_filter(shopping_users=None):
@@ -547,7 +606,8 @@ class RecipeSearch():
@staticmethod
def __sibling_substitute_filter(shopping_users=None):
sibling_onhand_subquery = Food.objects.filter(
path__startswith=Substr(OuterRef('path'), 1, Food.steplen * (OuterRef('depth') - 1)),
path__startswith=Substr(
OuterRef('path'), 1, Food.steplen * (OuterRef('depth') - 1)),
depth=OuterRef('depth'),
onhand_users__in=shopping_users
)
@@ -586,7 +646,8 @@ class RecipeFacet():
self.Recent = self._cache.get('Recent', None)
if self._queryset is not None:
self._recipe_list = list(self._queryset.values_list('id', flat=True))
self._recipe_list = list(
self._queryset.values_list('id', flat=True))
self._search_params = {
'keyword_list': self._request.query_params.getlist('keywords', []),
'food_list': self._request.query_params.getlist('foods', []),
@@ -618,7 +679,8 @@ class RecipeFacet():
'Books': self.Books
}
caches['default'].set(self._SEARCH_CACHE_KEY, self._cache, self._cache_timeout)
caches['default'].set(self._SEARCH_CACHE_KEY,
self._cache, self._cache_timeout)
def get_facets(self, from_cache=False):
if from_cache:
@@ -655,13 +717,16 @@ class RecipeFacet():
def get_keywords(self):
if self.Keywords is None:
if self._search_params['search_keywords_or']:
keywords = Keyword.objects.filter(space=self._request.space).distinct()
keywords = Keyword.objects.filter(
space=self._request.space).distinct()
else:
keywords = Keyword.objects.filter(Q(recipe__in=self._recipe_list) | Q(depth=1)).filter(space=self._request.space).distinct()
keywords = Keyword.objects.filter(Q(recipe__in=self._recipe_list) | Q(
depth=1)).filter(space=self._request.space).distinct()
# set keywords to root objects only
keywords = self._keyword_queryset(keywords)
self.Keywords = [{**x, 'children': None} if x['numchild'] > 0 else x for x in list(keywords)]
self.Keywords = [{**x, 'children': None}
if x['numchild'] > 0 else x for x in list(keywords)]
self.set_cache('Keywords', self.Keywords)
return self.Keywords
@@ -669,28 +734,28 @@ class RecipeFacet():
if self.Foods is None:
# # if using an OR search, will annotate all keywords, otherwise, just those that appear in results
if self._search_params['search_foods_or']:
foods = Food.objects.filter(space=self._request.space).distinct()
foods = Food.objects.filter(
space=self._request.space).distinct()
else:
foods = Food.objects.filter(Q(ingredient__step__recipe__in=self._recipe_list) | Q(depth=1)).filter(space=self._request.space).distinct()
foods = Food.objects.filter(Q(ingredient__step__recipe__in=self._recipe_list) | Q(
depth=1)).filter(space=self._request.space).distinct()
# set keywords to root objects only
foods = self._food_queryset(foods)
self.Foods = [{**x, 'children': None} if x['numchild'] > 0 else x for x in list(foods)]
self.Foods = [{**x, 'children': None}
if x['numchild'] > 0 else x for x in list(foods)]
self.set_cache('Foods', self.Foods)
return self.Foods
def get_books(self):
if self.Books is None:
self.Books = []
return self.Books
def get_ratings(self):
if self.Ratings is None:
if not self._request.space.demo and self._request.space.show_facet_count:
if self._queryset is None:
self._queryset = Recipe.objects.filter(id__in=self._recipe_list)
rating_qs = self._queryset.annotate(rating=Round(Avg(Case(When(cooklog__created_by=self._request.user, then='cooklog__rating'), default=Value(0)))))
self._queryset = Recipe.objects.filter(
id__in=self._recipe_list)
rating_qs = self._queryset.annotate(rating=Round(Avg(Case(When(
cooklog__created_by=self._request.user, then='cooklog__rating'), default=Value(0)))))
self.Ratings = dict(Counter(r.rating for r in rating_qs))
else:
self.Rating = {}
@@ -715,10 +780,13 @@ class RecipeFacet():
foods = self._food_queryset(food.get_children(), food)
deep_search = self.Foods
for node in nodes:
index = next((i for i, x in enumerate(deep_search) if x["id"] == node.id), None)
index = next((i for i, x in enumerate(
deep_search) if x["id"] == node.id), None)
deep_search = deep_search[index]['children']
index = next((i for i, x in enumerate(deep_search) if x["id"] == food.id), None)
deep_search[index]['children'] = [{**x, 'children': None} if x['numchild'] > 0 else x for x in list(foods)]
index = next((i for i, x in enumerate(
deep_search) if x["id"] == food.id), None)
deep_search[index]['children'] = [
{**x, 'children': None} if x['numchild'] > 0 else x for x in list(foods)]
self.set_cache('Foods', self.Foods)
return self.get_facets()
@@ -731,10 +799,13 @@ class RecipeFacet():
keywords = self._keyword_queryset(keyword.get_children(), keyword)
deep_search = self.Keywords
for node in nodes:
index = next((i for i, x in enumerate(deep_search) if x["id"] == node.id), None)
index = next((i for i, x in enumerate(
deep_search) if x["id"] == node.id), None)
deep_search = deep_search[index]['children']
index = next((i for i, x in enumerate(deep_search) if x["id"] == keyword.id), None)
deep_search[index]['children'] = [{**x, 'children': None} if x['numchild'] > 0 else x for x in list(keywords)]
index = next((i for i, x in enumerate(deep_search)
if x["id"] == keyword.id), None)
deep_search[index]['children'] = [
{**x, 'children': None} if x['numchild'] > 0 else x for x in list(keywords)]
self.set_cache('Keywords', self.Keywords)
return self.get_facets()

View File

@@ -1,8 +1,8 @@
import random
# import random
import re
from html import unescape
from unicodedata import decomposition
from django.core.cache import caches
from django.utils.dateparse import parse_duration
from django.utils.translation import gettext as _
from isodate import parse_duration as iso_parse_duration
@@ -10,9 +10,11 @@ from isodate.isoerror import ISO8601Error
from pytube import YouTube
from recipe_scrapers._utils import get_host_name, get_minutes
from cookbook.helper import recipe_url_import as helper
# from cookbook.helper import recipe_url_import as helper
from cookbook.helper.ingredient_parser import IngredientParser
from cookbook.models import Keyword, Automation
from cookbook.models import Automation, Keyword
# from unicodedata import decomposition
# from recipe_scrapers._utils import get_minutes ## temporary until/unless upstream incorporates get_minutes() PR
@@ -127,7 +129,7 @@ def get_from_scraper(scrape, request):
try:
if scrape.author():
keywords.append(scrape.author())
except:
except Exception:
pass
try:
@@ -247,10 +249,27 @@ def parse_description(description):
def clean_instruction_string(instruction):
normalized_string = normalize_string(instruction)
# handle HTML tags that can be converted to markup
normalized_string = instruction \
.replace("<nobr>", "**") \
.replace("</nobr>", "**") \
.replace("<strong>", "**") \
.replace("</strong>", "**")
normalized_string = normalize_string(normalized_string)
normalized_string = normalized_string.replace('\n', ' \n')
normalized_string = normalized_string.replace(' \n \n', '\n\n')
return normalized_string
# handle unsupported, special UTF8 character in Thermomix-specific instructions,
# that happen in nearly every recipe on Cookidoo, Zaubertopf Club, Rezeptwelt
# and in Thermomix-specific recipes on many other sites
return normalized_string \
.replace("", _('reverse rotation')) \
.replace("", _('careful rotation')) \
.replace("", _('knead')) \
.replace("Andicken ", _('thicken')) \
.replace("Erwärmen ", _('warm up')) \
.replace("Fermentieren ", _('ferment')) \
.replace("Sous-vide ", _("sous-vide"))
def parse_instructions(instructions):
@@ -322,6 +341,11 @@ def parse_servings_text(servings):
servings = re.sub("\d+", '', servings).strip()
except Exception:
servings = ''
if type(servings) == list:
try:
servings = parse_servings_text(servings[1])
except Exception:
pass
return str(servings)[:32]
@@ -345,10 +369,28 @@ def parse_time(recipe_time):
def parse_keywords(keyword_json, space):
keywords = []
keyword_aliases = {}
# retrieve keyword automation cache if it exists, otherwise build from database
KEYWORD_CACHE_KEY = f'automation_keyword_alias_{space.pk}'
if c := caches['default'].get(KEYWORD_CACHE_KEY, None):
self.food_aliases = c
caches['default'].touch(KEYWORD_CACHE_KEY, 30)
else:
for a in Automation.objects.filter(space=space, disabled=False, type=Automation.KEYWORD_ALIAS).only('param_1', 'param_2').order_by('order').all():
keyword_aliases[a.param_1] = a.param_2
caches['default'].set(KEYWORD_CACHE_KEY, keyword_aliases, 30)
# keywords as list
for kw in keyword_json:
kw = normalize_string(kw)
# if alias exists use that instead
if len(kw) != 0:
if keyword_aliases:
try:
kw = keyword_aliases[kw]
except KeyError:
pass
if k := Keyword.objects.filter(name=kw, space=space).first():
keywords.append({'label': str(k), 'name': k.name, 'id': k.id})
else:
@@ -419,3 +461,18 @@ def get_images_from_soup(soup, url):
if 'http' in u:
images.append(u)
return images
def clean_dict(input_dict, key):
if type(input_dict) == dict:
for x in list(input_dict):
if x == key:
del input_dict[x]
elif type(input_dict[x]) == dict:
input_dict[x] = clean_dict(input_dict[x], key)
elif type(input_dict[x]) == list:
temp_list = []
for e in input_dict[x]:
temp_list.append(clean_dict(e, key))
return input_dict

View File

@@ -47,6 +47,8 @@ class RecipeShoppingEditor():
self.mealplan = self._kwargs.get('mealplan', None)
if type(self.mealplan) in [int, float]:
self.mealplan = MealPlan.objects.filter(id=self.mealplan, space=self.space)
if type(self.mealplan) == dict:
self.mealplan = MealPlan.objects.filter(id=self.mealplan['id'], space=self.space).first()
self.id = self._kwargs.get('id', None)
self._shopping_list_recipe = self.get_shopping_list_recipe(self.id, self.created_by, self.space)
@@ -107,7 +109,10 @@ class RecipeShoppingEditor():
self.servings = float(servings)
if mealplan := kwargs.get('mealplan', None):
self.mealplan = mealplan
if type(mealplan) == dict:
self.mealplan = MealPlan.objects.filter(id=mealplan['id'], space=self.space).first()
else:
self.mealplan = mealplan
self.recipe = mealplan.recipe
elif recipe := kwargs.get('recipe', None):
self.recipe = recipe
@@ -310,4 +315,4 @@ class RecipeShoppingEditor():
# )
# # return all shopping list items
# return list_recipe
# return list_recipe

View File

@@ -5,6 +5,7 @@ from zipfile import ZipFile
from cookbook.helper.image_processing import get_filetype
from cookbook.helper.ingredient_parser import IngredientParser
from cookbook.helper.recipe_url_import import parse_servings, parse_servings_text, parse_time
from cookbook.integration.integration import Integration
from cookbook.models import Ingredient, Recipe, Step
@@ -23,41 +24,60 @@ class Mealie(Integration):
name=recipe_json['name'].strip(), description=description,
created_by=self.request.user, internal=True, space=self.request.space)
# TODO parse times (given in PT2H3M )
# @vabene check recipe_url_import.iso_duration_to_minutes I think it does what you are looking for
ingredients_added = False
for s in recipe_json['recipe_instructions']:
step = Step.objects.create(
instruction=s['text'], space=self.request.space,
)
if not ingredients_added:
ingredients_added = True
if len(recipe_json['description'].strip()) > 500:
step.instruction = recipe_json['description'].strip() + '\n\n' + step.instruction
ingredient_parser = IngredientParser(self.request, True)
for ingredient in recipe_json['recipe_ingredient']:
try:
if ingredient['food']:
f = ingredient_parser.get_food(ingredient['food'])
u = ingredient_parser.get_unit(ingredient['unit'])
amount = ingredient['quantity']
note = ingredient['note']
original_text = None
else:
amount, unit, food, note = ingredient_parser.parse(ingredient['note'])
f = ingredient_parser.get_food(food)
u = ingredient_parser.get_unit(unit)
original_text = ingredient['note']
step.ingredients.add(Ingredient.objects.create(
food=f, unit=u, amount=amount, note=note, original_text=original_text, space=self.request.space,
))
except Exception:
pass
step = Step.objects.create(instruction=s['text'], space=self.request.space, )
recipe.steps.add(step)
step = recipe.steps.first()
if not step: # if there is no step in the exported data
step = Step.objects.create(instruction='', space=self.request.space, )
recipe.steps.add(step)
if len(recipe_json['description'].strip()) > 500:
step.instruction = recipe_json['description'].strip() + '\n\n' + step.instruction
ingredient_parser = IngredientParser(self.request, True)
for ingredient in recipe_json['recipe_ingredient']:
try:
if ingredient['food']:
f = ingredient_parser.get_food(ingredient['food'])
u = ingredient_parser.get_unit(ingredient['unit'])
amount = ingredient['quantity']
note = ingredient['note']
original_text = None
else:
amount, unit, food, note = ingredient_parser.parse(ingredient['note'])
f = ingredient_parser.get_food(food)
u = ingredient_parser.get_unit(unit)
original_text = ingredient['note']
step.ingredients.add(Ingredient.objects.create(
food=f, unit=u, amount=amount, note=note, original_text=original_text, space=self.request.space,
))
except Exception:
pass
if 'notes' in recipe_json and len(recipe_json['notes']) > 0:
notes_text = "#### Notes \n\n"
for n in recipe_json['notes']:
notes_text += f'{n["text"]} \n'
step = Step.objects.create(
instruction=notes_text, space=self.request.space,
)
recipe.steps.add(step)
if 'recipe_yield' in recipe_json:
recipe.servings = parse_servings(recipe_json['recipe_yield'])
recipe.servings_text = parse_servings_text(recipe_json['recipe_yield'])
if 'total_time' in recipe_json and recipe_json['total_time'] is not None:
recipe.working_time = parse_time(recipe_json['total_time'])
if 'org_url' in recipe_json:
recipe.source_url = recipe_json['org_url']
recipe.save()
for f in self.files:
if '.zip' in f['name']:
import_zip = ZipFile(f['file'])

View File

@@ -2,24 +2,54 @@ import json
from cookbook.helper.ingredient_parser import IngredientParser
from cookbook.integration.integration import Integration
from cookbook.models import Ingredient, Recipe, Step
from cookbook.models import Ingredient, Recipe, Step, Keyword, Comment, CookLog
from django.utils.translation import gettext as _
class OpenEats(Integration):
def get_recipe_from_file(self, file):
recipe = Recipe.objects.create(name=file['name'].strip(), created_by=self.request.user, internal=True,
description = file['info']
description_max_length = Recipe._meta.get_field('description').max_length
if len(description) > description_max_length:
description = description[0:description_max_length]
recipe = Recipe.objects.create(name=file['name'].strip(), description=description, created_by=self.request.user, internal=True,
servings=file['servings'], space=self.request.space, waiting_time=file['cook_time'], working_time=file['prep_time'])
instructions = ''
if file["info"] != '':
instructions += file["info"]
if file["directions"] != '':
instructions += file["directions"]
if file["source"] != '':
instructions += file["source"]
instructions += '\n' + _('Recipe source:') + f'[{file["source"]}]({file["source"]})'
cuisine_keyword, created = Keyword.objects.get_or_create(name="Cuisine", space=self.request.space)
if file["cuisine"] != '':
keyword, created = Keyword.objects.get_or_create(name=file["cuisine"].strip(), space=self.request.space)
if created:
keyword.move(cuisine_keyword, pos="last-child")
recipe.keywords.add(keyword)
course_keyword, created = Keyword.objects.get_or_create(name="Course", space=self.request.space)
if file["course"] != '':
keyword, created = Keyword.objects.get_or_create(name=file["course"].strip(), space=self.request.space)
if created:
keyword.move(course_keyword, pos="last-child")
recipe.keywords.add(keyword)
for tag in file["tags"]:
keyword, created = Keyword.objects.get_or_create(name=tag.strip(), space=self.request.space)
recipe.keywords.add(keyword)
for comment in file['comments']:
Comment.objects.create(recipe=recipe, text=comment['text'], created_by=self.request.user)
CookLog.objects.create(recipe=recipe, rating=comment['rating'], created_by=self.request.user, space=self.request.space)
if file["photo"] != '':
recipe.image = f'recipes/openeats-import/{file["photo"]}'
recipe.save()
step = Step.objects.create(instruction=instructions, space=self.request.space,)
@@ -38,6 +68,9 @@ class OpenEats(Integration):
recipe_json = json.loads(file.read())
recipe_dict = {}
ingredient_group_dict = {}
cuisine_group_dict = {}
course_group_dict = {}
tag_group_dict = {}
for o in recipe_json:
if o['model'] == 'recipe.recipe':
@@ -50,11 +83,27 @@ class OpenEats(Integration):
'cook_time': o['fields']['cook_time'],
'servings': o['fields']['servings'],
'ingredients': [],
'photo': o['fields']['photo'],
'cuisine': o['fields']['cuisine'],
'course': o['fields']['course'],
'tags': o['fields']['tags'],
'comments': [],
}
if o['model'] == 'ingredient.ingredientgroup':
ingredient_group_dict[o['pk']] = o['fields']['recipe']
if o['model'] == 'recipe_groups.cuisine':
cuisine_group_dict[o['pk']] = o['fields']['title']
if o['model'] == 'recipe_groups.course':
course_group_dict[o['pk']] = o['fields']['title']
if o['model'] == 'recipe_groups.tag':
tag_group_dict[o['pk']] = o['fields']['title']
for o in recipe_json:
if o['model'] == 'rating.rating':
recipe_dict[o['fields']['recipe']]["comments"].append({
"text": o['fields']['comment'],
"rating": o['fields']['rating']
})
if o['model'] == 'ingredient.ingredient':
ingredient = {
'food': o['fields']['title'],
@@ -63,6 +112,15 @@ class OpenEats(Integration):
}
recipe_dict[ingredient_group_dict[o['fields']['ingredient_group']]]['ingredients'].append(ingredient)
for k, r in recipe_dict.items():
if r["cuisine"] in cuisine_group_dict:
r["cuisine"] = cuisine_group_dict[r["cuisine"]]
if r["course"] in course_group_dict:
r["course"] = course_group_dict[r["course"]]
for index in range(len(r["tags"])):
if r["tags"][index] in tag_group_dict:
r["tags"][index] = tag_group_dict[r["tags"][index]]
return list(recipe_dict.values())
def get_file_from_recipe(self, recipe):

View File

@@ -5,6 +5,9 @@ import re
from gettext import gettext as _
from io import BytesIO
import requests
import validators
from cookbook.helper.ingredient_parser import IngredientParser
from cookbook.helper.recipe_url_import import parse_servings, parse_servings_text
from cookbook.integration.integration import Integration
@@ -81,7 +84,14 @@ class Paprika(Integration):
recipe.steps.add(step)
if recipe_json.get("photo_data", None):
self.import_recipe_image(recipe, BytesIO(base64.b64decode(recipe_json['photo_data'])), filetype='.jpeg')
try:
if recipe_json.get("image_url", None):
url = recipe_json.get("image_url", None)
if validators.url(url, public=True):
response = requests.get(url)
self.import_recipe_image(recipe, BytesIO(response.content))
except:
if recipe_json.get("photo_data", None):
self.import_recipe_image(recipe, BytesIO(base64.b64decode(recipe_json['photo_data'])), filetype='.jpeg')
return recipe

View File

@@ -1,3 +1,5 @@
import base64
from io import BytesIO
from xml import etree
from lxml import etree
@@ -5,54 +7,65 @@ from lxml import etree
from cookbook.helper.ingredient_parser import IngredientParser
from cookbook.helper.recipe_url_import import parse_time, parse_servings, parse_servings_text
from cookbook.integration.integration import Integration
from cookbook.models import Ingredient, Recipe, Step
from cookbook.models import Ingredient, Recipe, Step, Keyword
class Rezeptsuitede(Integration):
def split_recipe_file(self, file):
xml_file = etree.parse(file).getroot().getchildren()
recipe_list = xml_file.find('recipe')
return recipe_list
return etree.parse(file).getroot().getchildren()
def get_recipe_from_file(self, file):
recipe_xml = file
recipe = Recipe.objects.create(
name=recipe_xml.find('title').text.strip(),
name=recipe_xml.find('head').attrib['title'].strip(),
created_by=self.request.user, internal=True, space=self.request.space)
if recipe_xml.find('servingtype') is not None and recipe_xml.find('servingtype').text is not None:
recipe.servings = parse_servings(recipe_xml.find('servingtype').text.strip())
recipe.servings_text = parse_servings_text(recipe_xml.find('servingtype').text.strip())
if recipe_xml.find('head').attrib['servingtype']:
recipe.servings = parse_servings(recipe_xml.find('head').attrib['servingtype'].strip())
recipe.servings_text = parse_servings_text(recipe_xml.find('head').attrib['servingtype'].strip())
if recipe_xml.find('description') is not None: # description is a list of <li>'s with text
if len(recipe_xml.find('description')) > 0:
recipe.description = recipe_xml.find('description')[0].text[:512]
if recipe_xml.find('remark') is not None: # description is a list of <li>'s with text
if recipe_xml.find('remark').find('line') is not None:
recipe.description = recipe_xml.find('remark').find('line').text[:512]
for step in recipe_xml.find('step'):
if step.text:
step = Step.objects.create(
instruction=step.text.strip(), space=self.request.space,
)
recipe.steps.add(step)
for prep in recipe_xml.findall('preparation'):
try:
if prep.find('step').text:
step = Step.objects.create(
instruction=prep.find('step').text.strip(), space=self.request.space,
)
recipe.steps.add(step)
except Exception:
pass
ingredient_parser = IngredientParser(self.request, True)
if recipe_xml.find('ingredient'):
if recipe_xml.find('part').find('ingredient') is not None:
ingredient_step = recipe.steps.first()
if ingredient_step is None:
ingredient_step = Step.objects.create(space=self.request.space, instruction='')
for ingredient in recipe_xml.find('ingredient'):
for ingredient in recipe_xml.find('part').findall('ingredient'):
f = ingredient_parser.get_food(ingredient.attrib['item'])
u = ingredient_parser.get_unit(ingredient.attrib['unit'])
ingredient_step.ingredients.add(Ingredient.objects.create(
food=f, unit=u, amount=ingredient.attrib['qty'], original_text=ingredient.text.strip(), space=self.request.space,
))
amount, unit, note = ingredient_parser.parse_amount(ingredient.attrib['qty'])
ingredient_step.ingredients.add(Ingredient.objects.create(food=f, unit=u, amount=amount, space=self.request.space, ))
try:
k, created = Keyword.objects.get_or_create(name=recipe_xml.find('head').find('cat').text.strip(), space=self.request.space)
recipe.keywords.add(k)
except Exception as e:
pass
recipe.save()
try:
self.import_recipe_image(recipe, BytesIO(base64.b64decode(recipe_xml.find('head').find('picbin').text)), filetype='.jpeg')
except:
pass
return recipe
def get_file_from_recipe(self, recipe):

View File

@@ -8,8 +8,8 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-04-29 18:42+0200\n"
"PO-Revision-Date: 2022-05-10 15:32+0000\n"
"Last-Translator: zeon <zeonbg@gmail.com>\n"
"PO-Revision-Date: 2023-04-12 11:55+0000\n"
"Last-Translator: noxonad <noxonad@proton.me>\n"
"Language-Team: Bulgarian <http://translate.tandoor.dev/projects/tandoor/"
"recipes-backend/bg/>\n"
"Language: bg\n"
@@ -17,7 +17,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.10.1\n"
"X-Generator: Weblate 4.15\n"
#: .\cookbook\filters.py:23 .\cookbook\templates\forms\ingredients.html:34
#: .\cookbook\templates\space.html:49 .\cookbook\templates\stats.html:28
@@ -1433,7 +1433,7 @@ msgstr ""
#: .\cookbook\templates\index.html:29
msgid "Search recipe ..."
msgstr "Търсете рецепта..."
msgstr "Търсете рецепта ..."
#: .\cookbook\templates\index.html:44
msgid "New Recipe"
@@ -1818,7 +1818,7 @@ msgid ""
msgstr ""
" \n"
" Пълнотекстови търсения се опитват да нормализират предоставените "
"думи, за да съответстват на често срещани варианти. Например: 'вили, "
"думи, за да съответстват на често срещани варианти. Например: 'вили, "
"'вилица', 'вилици' всички ще се нормализират до 'вилиц'.\n"
" Има няколко налични метода, описани по-долу, които ще "
"контролират как поведението при търсене трябва да реагира, когато се търсят "

File diff suppressed because it is too large Load Diff

View File

@@ -11,8 +11,8 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-09 18:01+0100\n"
"PO-Revision-Date: 2023-01-08 17:55+0000\n"
"Last-Translator: Joachim Weber <joachim.weber@gmx.de>\n"
"PO-Revision-Date: 2023-03-25 11:32+0000\n"
"Last-Translator: Matěj Kubla <matykubla@gmail.com>\n"
"Language-Team: Czech <http://translate.tandoor.dev/projects/tandoor/"
"recipes-backend/cs/>\n"
"Language: cs\n"
@@ -553,7 +553,7 @@ msgstr "Cesta musí být v následujícím formátu"
#: .\cookbook\templates\batch\monitor.html:27
msgid "Sync Now!"
msgstr "Zahájit synchronizaci"
msgstr "Zahájit synchronizaci!"
#: .\cookbook\templates\batch\waiting.html:4
#: .\cookbook\templates\batch\waiting.html:10
@@ -1036,7 +1036,7 @@ msgstr "Tento text je kurzívou"
#: .\cookbook\templates\markdown_info.html:61
#: .\cookbook\templates\markdown_info.html:77
msgid "Blockquotes are also possible"
msgstr "Lze použít i kvotace "
msgstr "Lze použít i kvotace"
#: .\cookbook\templates\markdown_info.html:84
msgid "Lists"
@@ -1106,8 +1106,8 @@ msgid ""
"rel=\"noreferrer noopener\" target=\"_blank\">this one.</a>"
msgstr ""
"Ruční vytváření tabulek pomocí značek je složité. Doporučujeme použít "
"například <a href=\"https://www.tablesgenerator.com/markdown_tables\" "
"rel=\"noreferrer noopener\" target=\"_blank\">tento tabulkový editor</a>."
"například <a href=\"https://www.tablesgenerator.com/markdown_tables\" rel="
"\"noreferrer noopener\" target=\"_blank\">tento tabulkový editor.</a>"
#: .\cookbook\templates\markdown_info.html:155
#: .\cookbook\templates\markdown_info.html:157
@@ -1256,22 +1256,36 @@ msgid ""
" "
msgstr ""
"\n"
" <p>Modul jídelníčku umožňuje plánovat jídlo pomocí receptů i poznámek.</p>\n"
" <p>Jednoduše vyberte recept ze seznamu naposledy navštívených receptů, nebo ho vyhledejte\n"
" s přetáhněte na požadovaný den v rozvrhu. Můžete také přidat poznámku s popiskem\n"
" a poté přetáhnout recept pro vytvoření plánu s vlatními popisky. Vytvořením samotné poznámky\n"
" je možné přetažením pole poznámky do rozvrhu.</p>\n"
" <p>Kliknutím na recept zobrazíte detailní náhled. Odtud lze také přidat položky\n"
" do nákupního seznamu. Do nákupního seznamu můžete také přidat všechny recepty na daný den\n"
" kliknutím na ikonu nákupního košíku na horní straně tabulky.</p>\n"
" <p>V běžnémípadě se jídelníček plánuje hromadně, proto můžete v nastavení definovat\n"
" se kterými uživateli si přejete jídelníčky sdílet.\n"
" <p>Modul jídelníčku umožňuje plánovat jídlo "
"pomocí receptů i poznámek.</p>\n"
" <p>Jednoduše vyberte recept ze seznamu naposledy "
"navštívených receptů, nebo ho vyhledejte\n"
" s přetáhněte na požadovaný den v rozvrhu. "
"Můžete také přidat poznámku s popiskem\n"
" a poté přetáhnout recept pro vytvoření plánu "
"s vlatními popisky. Vytvořem samotné poznámky\n"
" je možné přetažením pole poznámky do "
"rozvrhu.</p>\n"
" <p>Kliknutím na recept zobrazíte detailní "
"náhled. Odtud lze také přidat položky\n"
" do nákupního seznamu. Do nákupního seznamu "
"můžete také přidat všechny recepty na daný den\n"
" kliknutím na ikonu nákupního košíku na horní "
"straně tabulky.</p>\n"
" <p>V běžném případě se jídelníček plánuje "
"hromadně, proto můžete v nastavení definovat\n"
" se kterými uživateli si přejete jídelníčky "
"sdílet.\n"
" </p>\n"
" <p>Můžete také upravovat typy jídel, které si přejete naplánovat. Pokud budete sdílet jídelníček \n"
" <p>Můžete také upravovat typy jídel, které si "
"přejete naplánovat. Pokud budete sdílet jídelníček \n"
" s někým, kdo\n"
" má přidána jiná jídla, jeho typy jídel se objeví i ve vašem seznamu. Pro předcházení\n"
" má přidána jiná jídla, jeho typy jídel se "
"objeví i ve vašem seznamu. Pro předcházení\n"
" duplicitám (např. Ostatní, Jiná)\n"
" pojmenujte váš typ jídla stejně, jako uživatel se kterým své seznamy sdílíte. Tím budou seznamy sloučeny.</p>\n"
" pojmenujte váš typ jídla stejně, jako "
"uživatel se kterým své seznamy sdílíte. Tím budou seznamy\n"
" sloučeny.</p>\n"
" "
#: .\cookbook\templates\meal_plan_entry.html:6
@@ -1333,12 +1347,12 @@ msgstr "Obrázek receptu"
#: .\cookbook\templates\recipes_table.html:46
#: .\cookbook\templates\url_import.html:55
msgid "Preparation time ca."
msgstr "Doba přípravy cca"
msgstr "Doba přípravy cca."
#: .\cookbook\templates\recipes_table.html:52
#: .\cookbook\templates\url_import.html:60
msgid "Waiting time ca."
msgstr "Doba čekání cca"
msgstr "Doba čekání cca."
#: .\cookbook\templates\recipes_table.html:55
msgid "External"
@@ -1386,7 +1400,7 @@ msgid ""
" in the following examples:"
msgstr ""
"Použijte tajný klíč jako autorizační hlavičku definovanou slovním klíčem, "
"jak je uvedeno v následujících příkladech."
"jak je uvedeno v následujících příkladech:"
#: .\cookbook\templates\settings.html:94
msgid "or"
@@ -1808,7 +1822,7 @@ msgstr "Import není pro tohoto poskytovatele implementován!"
#: .\cookbook\views\import_export.py:58
msgid "Exporting is not implemented for this provider"
msgstr "Eport není pro tohoto poskytovatele implementován!"
msgstr "Export není pro tohoto poskytovatele implementován!"
#: .\cookbook\views\lists.py:42
msgid "Import Log"
@@ -1840,7 +1854,7 @@ msgstr "Komentář uložen!"
#: .\cookbook\views\views.py:152
msgid "This recipe is already linked to the book!"
msgstr "Tento recept už v kuchařce existuje."
msgstr "Tento recept už v kuchařce existuje!"
#: .\cookbook\views\views.py:158
msgid "Bookmark saved!"

View File

@@ -8,8 +8,8 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-04-29 18:42+0200\n"
"PO-Revision-Date: 2022-08-18 14:32+0000\n"
"Last-Translator: Mathias Rasmussen <math625f@gmail.com>\n"
"PO-Revision-Date: 2023-04-12 11:55+0000\n"
"Last-Translator: noxonad <noxonad@proton.me>\n"
"Language-Team: Danish <http://translate.tandoor.dev/projects/tandoor/"
"recipes-backend/da/>\n"
"Language: da\n"
@@ -17,7 +17,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.10.1\n"
"X-Generator: Weblate 4.15\n"
#: .\cookbook\filters.py:23 .\cookbook\templates\forms\ingredients.html:34
#: .\cookbook\templates\space.html:49 .\cookbook\templates\stats.html:28
@@ -1806,7 +1806,7 @@ msgid ""
msgstr ""
" \n"
" Heltekstsøgning forsøger at normalisere de givne ord så de "
"matcher stammevarianter. F.eks: 'skeen', 'skeer' og 'sket' vil alt "
"matcher stammevarianter. F.eks: 'skeen', 'skeer' og 'sket' vil alt "
"normaliseres til 'ske'.\n"
" Der er flere metoder tilgængelige, beskrevet herunder, som vil "
"bestemme hvordan søgningen skal opfører sig når flere søgeord er angivet.\n"
@@ -2122,9 +2122,9 @@ msgid ""
"return more results than needed to make sure you find what you are looking "
"for."
msgstr ""
"Find hvad du har brug for selvom opskriften har stavefejl. Kan måske "
"returnere flere resultater end du har brug for, for at være sikker på at du "
"finder hvad du leder efter."
"Find hvad du har brug for, selvom opskriften har stavefejl. Kan måske "
"returnere flere resultater end du har brug for, for at være sikker på, at du "
"finder, hvad du leder efter."
#: .\cookbook\templates\settings.html:182
msgid "This is the default behavior"
@@ -2196,8 +2196,7 @@ msgid ""
"You can sign in to your account using any of the following third party\n"
" accounts:"
msgstr ""
"Du kan logge ind på din konto med enhver af de følgende tredjepartsapps\n"
" kontoer:"
"Du kan logge ind på din konto med enhver af de følgende tredjepartskontoer:"
#: .\cookbook\templates\socialaccount\connections.html:52
msgid ""
@@ -2212,7 +2211,7 @@ msgstr "Tilføj en tredjepartskonto"
#: .\cookbook\templates\socialaccount\signup.html:5
msgid "Signup"
msgstr "Registrering"
msgstr "Registrer"
#: .\cookbook\templates\socialaccount\signup.html:10
#, python-format

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -8,8 +8,8 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-04-11 15:09+0200\n"
"PO-Revision-Date: 2021-04-11 15:23+0000\n"
"Last-Translator: Allan Nordhøy <epost@anotheragency.no>\n"
"PO-Revision-Date: 2023-04-17 20:55+0000\n"
"Last-Translator: Espen Sellevåg <buskmenn.drammer03@icloud.com>\n"
"Language-Team: Norwegian Bokmål <http://translate.tandoor.dev/projects/"
"tandoor/recipes-backend/nb_NO/>\n"
"Language: nb_NO\n"
@@ -17,7 +17,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.5.3\n"
"X-Generator: Weblate 4.15\n"
#: .\cookbook\filters.py:23 .\cookbook\templates\base.html:91
#: .\cookbook\templates\forms\edit_internal_recipe.html:219
@@ -34,19 +34,23 @@ msgstr ""
#: .\cookbook\forms.py:46
msgid "Default Unit to be used when inserting a new ingredient into a recipe."
msgstr ""
msgstr "Standard enhet når ny ingrediens legges til en oppskrift."
#: .\cookbook\forms.py:47
msgid ""
"Enables support for fractions in ingredient amounts (e.g. convert decimals "
"to fractions automatically)"
msgstr ""
"Aktiverer støtte for deler av ingrediensmengde (konverterer feks. desimaler "
"til deler automatisk)"
#: .\cookbook\forms.py:48
msgid ""
"Users with whom newly created meal plan/shopping list entries should be "
"shared by default."
msgstr ""
"Brukere som oppretter nye måltidsplaner/handlelister, deler disse "
"oppføringene som standard."
#: .\cookbook\forms.py:49
msgid "Show recently viewed recipes on search page."
@@ -58,7 +62,7 @@ msgstr "Antall desimaler ingredienser skal avrundes til."
#: .\cookbook\forms.py:51
msgid "If you want to be able to create and see comments underneath recipes."
msgstr ""
msgstr "Hvis du ønsker å opprette og se kommentarer under oppskrifter."
#: .\cookbook\forms.py:53
msgid ""
@@ -67,6 +71,11 @@ msgid ""
"Useful when shopping with multiple people but might use a little bit of "
"mobile data. If lower than instance limit it is reset when saving."
msgstr ""
"0 vil deaktivere automatisk synkronisering. Når en handleliste vises, "
"oppdateres listen med oppgitt antall sekunders mellomrom for å synkronisere "
"endringer fra andre brukere. Nyttig dersom flere brukere handler samtidig. "
"Datatrafikk oppstår når aktiv. Hvis verdien er lavere enn grensen, "
"tilbakestilles den ved lagring."
#: .\cookbook\forms.py:56
msgid "Makes the navbar stick to the top of the page."
@@ -100,11 +109,11 @@ msgstr ""
#: .\cookbook\forms.py:97 .\cookbook\forms.py:317
msgid "Path"
msgstr ""
msgstr "Sti"
#: .\cookbook\forms.py:98
msgid "Storage UID"
msgstr ""
msgstr "Lagring UID"
#: .\cookbook\forms.py:121
msgid "Default"
@@ -129,7 +138,6 @@ msgid "Old Unit"
msgstr "Gammel enhet"
#: .\cookbook\forms.py:156
#, fuzzy
msgid "Unit that should be replaced."
msgstr "Enhet som skal erstattes."
@@ -204,12 +212,11 @@ msgstr ""
#: .\cookbook\views\views.py:112 .\cookbook\views\views.py:116
#: .\cookbook\views\views.py:184
msgid "You do not have the required permissions to view this page!"
msgstr "Du har ikke påkrevd tilgang for å vise denne siden."
msgstr "Du har ikke påkrevd tilgang for å vise denne siden!"
#: .\cookbook\helper\permission_helper.py:141
#, fuzzy
msgid "You are not logged in and therefore cannot view this page!"
msgstr "Du er ikke innlogget og kan derfor ikke vise siden."
msgstr "Du er ikke innlogget og kan derfor ikke vise siden!"
#: .\cookbook\helper\permission_helper.py:145
#: .\cookbook\helper\permission_helper.py:167
@@ -379,7 +386,7 @@ msgstr "Finner ikke siden du leter etter."
#: .\cookbook\templates\404.html:33
msgid "Take me Home"
msgstr ""
msgstr "Tilbake til Startsiden"
#: .\cookbook\templates\404.html:35
msgid "Report a Bug"
@@ -388,12 +395,12 @@ msgstr "Rapporter en feil"
#: .\cookbook\templates\account\login.html:7
#: .\cookbook\templates\base.html:170
msgid "Login"
msgstr ""
msgstr "Logg inn"
#: .\cookbook\templates\account\login.html:13
#: .\cookbook\templates\account\login.html:28
msgid "Sign In"
msgstr ""
msgstr "Opprett bruker"
#: .\cookbook\templates\account\login.html:38
msgid "Social Login"
@@ -401,7 +408,7 @@ msgstr "Sosial innlogging"
#: .\cookbook\templates\account\login.html:39
msgid "You can use any of the following providers to sign in."
msgstr ""
msgstr "Velg en av følgende leverandører for å logge på."
#: .\cookbook\templates\account\logout.html:5
#: .\cookbook\templates\account\logout.html:9
@@ -416,20 +423,20 @@ msgstr "Er du sikker på at du vil logge ut?"
#: .\cookbook\templates\account\password_reset.html:5
#: .\cookbook\templates\account\password_reset_done.html:5
msgid "Password Reset"
msgstr ""
msgstr "Nullstill passord"
#: .\cookbook\templates\account\password_reset.html:9
#: .\cookbook\templates\account\password_reset_done.html:9
msgid "Password reset is not implemented for the time being!"
msgstr ""
msgstr "Det er foreløpig ikke implementert funksjon for å nullstille passord!"
#: .\cookbook\templates\account\signup.html:5
msgid "Register"
msgstr ""
msgstr "Registrer"
#: .\cookbook\templates\account\signup.html:9
msgid "Create your Account"
msgstr "Opprett din konto"
msgstr "Opprett konto"
#: .\cookbook\templates\account\signup.html:14
msgid "Create User"
@@ -442,11 +449,11 @@ msgstr "API-dokumentasjon"
#: .\cookbook\templates\base.html:78
msgid "Utensils"
msgstr ""
msgstr "Redskaper"
#: .\cookbook\templates\base.html:88
msgid "Shopping"
msgstr ""
msgstr "Handle"
#: .\cookbook\templates\base.html:102 .\cookbook\views\delete.py:84
#: .\cookbook\views\edit.py:93 .\cookbook\views\lists.py:26
@@ -456,27 +463,27 @@ msgstr "Nøkkelord"
#: .\cookbook\templates\base.html:104
msgid "Batch Edit"
msgstr ""
msgstr "Oppdatere flere"
#: .\cookbook\templates\base.html:109
msgid "Storage Data"
msgstr ""
msgstr "Datalagring"
#: .\cookbook\templates\base.html:113
msgid "Storage Backends"
msgstr ""
msgstr "Lagringsplasser"
#: .\cookbook\templates\base.html:115
msgid "Configure Sync"
msgstr ""
msgstr "Konfigurer synkronisering"
#: .\cookbook\templates\base.html:117
msgid "Discovered Recipes"
msgstr ""
msgstr "Oppdagede oppskrifter"
#: .\cookbook\templates\base.html:119
msgid "Discovery Log"
msgstr ""
msgstr "Logg Oppdagelser"
#: .\cookbook\templates\base.html:121 .\cookbook\templates\stats.html:10
msgid "Statistics"
@@ -484,7 +491,7 @@ msgstr "Statistikk"
#: .\cookbook\templates\base.html:123
msgid "Units & Ingredients"
msgstr ""
msgstr "Enheter & Ingredienser"
#: .\cookbook\templates\base.html:125
msgid "Import Recipe"
@@ -521,58 +528,61 @@ msgid "API Browser"
msgstr "API-utforsker"
#: .\cookbook\templates\base.html:165
#, fuzzy
msgid "Logout"
msgstr "Logg ut"
#: .\cookbook\templates\batch\edit.html:6
msgid "Batch edit Category"
msgstr ""
msgstr "Oppdater flere kategorier"
#: .\cookbook\templates\batch\edit.html:15
msgid "Batch edit Recipes"
msgstr ""
msgstr "Oppdater flere oppskrifter"
#: .\cookbook\templates\batch\edit.html:20
msgid "Add the specified keywords to all recipes containing a word"
msgstr ""
msgstr "Legg til spesifikt nøkkelord til alle oppskrifter som inneholder et ord"
#: .\cookbook\templates\batch\monitor.html:6 .\cookbook\views\edit.py:76
msgid "Sync"
msgstr ""
msgstr "Synkronisering"
#: .\cookbook\templates\batch\monitor.html:10
msgid "Manage watched Folders"
msgstr ""
msgstr "Behandle overvåkede mapper"
#: .\cookbook\templates\batch\monitor.html:14
msgid ""
"On this Page you can manage all storage folder locations that should be "
"monitored and synced."
msgstr ""
"Her kan du behandle alle lagringsmapper og plasseringer for monitorering og "
"synkronisering."
#: .\cookbook\templates\batch\monitor.html:16
msgid "The path must be in the following format"
msgstr ""
msgstr "Stien må være i følgende format"
#: .\cookbook\templates\batch\monitor.html:27
msgid "Sync Now!"
msgstr ""
msgstr "Synkroniser nå!"
#: .\cookbook\templates\batch\waiting.html:4
#: .\cookbook\templates\batch\waiting.html:10
msgid "Importing Recipes"
msgstr ""
msgstr "Importerer oppskrifter"
#: .\cookbook\templates\batch\waiting.html:23
msgid ""
"This can take a few minutes, depending on the number of recipes in sync, "
"please wait."
msgstr ""
"Dette kan ta noen minutter, avhenging av antall oppskrifter som skal "
"synkroniseres. Vennligst vent."
#: .\cookbook\templates\books.html:5 .\cookbook\templates\books.html:11
msgid "Recipe Books"
msgstr ""
msgstr "Oppskriftsbøker"
#: .\cookbook\templates\books.html:15
msgid "New Book"
@@ -584,32 +594,32 @@ msgstr "av"
#: .\cookbook\templates\books.html:34
msgid "Toggle Recipes"
msgstr ""
msgstr "Veksle oppskrifter"
#: .\cookbook\templates\books.html:54
#: .\cookbook\templates\meal_plan_entry.html:48
#: .\cookbook\templates\recipes_table.html:64
msgid "Last cooked"
msgstr ""
msgstr "Forrige tilbereding"
#: .\cookbook\templates\books.html:71
msgid "There are no recipes in this book yet."
msgstr ""
msgstr "Det er foreløpig ingen oppskrifter i denne boken."
#: .\cookbook\templates\export.html:6 .\cookbook\templates\test2.html:6
msgid "Export Recipes"
msgstr ""
msgstr "Eksporter oppskrifter"
#: .\cookbook\templates\export.html:14 .\cookbook\templates\export.html:20
#: .\cookbook\templates\shopping_list.html:347
#: .\cookbook\templates\test2.html:14 .\cookbook\templates\test2.html:20
msgid "Export"
msgstr ""
msgstr "Eksporter"
#: .\cookbook\templates\forms\edit_import_recipe.html:5
#: .\cookbook\templates\forms\edit_import_recipe.html:9
msgid "Import new Recipe"
msgstr ""
msgstr "Importer ny oppskrift"
#: .\cookbook\templates\forms\edit_import_recipe.html:14
#: .\cookbook\templates\forms\edit_internal_recipe.html:389
@@ -635,29 +645,29 @@ msgstr "Beskrivelse"
#: .\cookbook\templates\forms\edit_internal_recipe.html:72
msgid "Waiting Time"
msgstr ""
msgstr "Ventetid"
#: .\cookbook\templates\forms\edit_internal_recipe.html:78
msgid "Servings Text"
msgstr ""
msgstr "Porsjon beskrivelse"
#: .\cookbook\templates\forms\edit_internal_recipe.html:89
msgid "Select Keywords"
msgstr ""
msgstr "Velg nøkkelord"
#: .\cookbook\templates\forms\edit_internal_recipe.html:90
#: .\cookbook\templates\url_import.html:212
msgid "Add Keyword"
msgstr ""
msgstr "Legg til nøkkelord"
#: .\cookbook\templates\forms\edit_internal_recipe.html:108
msgid "Nutrition"
msgstr ""
msgstr "Næringsinnhold"
#: .\cookbook\templates\forms\edit_internal_recipe.html:112
#: .\cookbook\templates\forms\edit_internal_recipe.html:162
msgid "Delete Step"
msgstr ""
msgstr "Fjern trinn"
#: .\cookbook\templates\forms\edit_internal_recipe.html:116
msgid "Calories"
@@ -678,15 +688,15 @@ msgstr "Proteiner"
#: .\cookbook\templates\forms\edit_internal_recipe.html:146
#: .\cookbook\templates\forms\edit_internal_recipe.html:454
msgid "Step"
msgstr ""
msgstr "Trinn"
#: .\cookbook\templates\forms\edit_internal_recipe.html:167
msgid "Show as header"
msgstr ""
msgstr "Vis som overskrift"
#: .\cookbook\templates\forms\edit_internal_recipe.html:173
msgid "Hide as header"
msgstr ""
msgstr "Skjul overskrift"
#: .\cookbook\templates\forms\edit_internal_recipe.html:178
msgid "Move Up"
@@ -698,15 +708,15 @@ msgstr "Flytt nedover"
#: .\cookbook\templates\forms\edit_internal_recipe.html:192
msgid "Step Name"
msgstr ""
msgstr "Trinn navn"
#: .\cookbook\templates\forms\edit_internal_recipe.html:196
msgid "Step Type"
msgstr ""
msgstr "Trinn type"
#: .\cookbook\templates\forms\edit_internal_recipe.html:207
msgid "Step time in Minutes"
msgstr ""
msgstr "Trinn tid i minutter"
#: .\cookbook\templates\forms\edit_internal_recipe.html:261
#: .\cookbook\templates\shopping_list.html:183
@@ -740,7 +750,7 @@ msgstr "Velg mat"
#: .\cookbook\templates\meal_plan.html:256
#: .\cookbook\templates\url_import.html:171
msgid "Note"
msgstr ""
msgstr "Notis"
#: .\cookbook\templates\forms\edit_internal_recipe.html:319
msgid "Delete Ingredient"
@@ -748,7 +758,7 @@ msgstr "Slett ingrediens"
#: .\cookbook\templates\forms\edit_internal_recipe.html:325
msgid "Make Header"
msgstr ""
msgstr "Bruk som overskrift"
#: .\cookbook\templates\forms\edit_internal_recipe.html:331
msgid "Make Ingredient"
@@ -756,15 +766,15 @@ msgstr "Opprett ingrediens"
#: .\cookbook\templates\forms\edit_internal_recipe.html:337
msgid "Disable Amount"
msgstr ""
msgstr "Deaktiver mengde"
#: .\cookbook\templates\forms\edit_internal_recipe.html:343
msgid "Enable Amount"
msgstr ""
msgstr "Aktiver mengde"
#: .\cookbook\templates\forms\edit_internal_recipe.html:348
msgid "Copy Template Reference"
msgstr ""
msgstr "Kopier mal-referanse"
#: .\cookbook\templates\forms\edit_internal_recipe.html:374
#: .\cookbook\templates\url_import.html:196
@@ -773,29 +783,28 @@ msgstr "Instruksjoner"
#: .\cookbook\templates\forms\edit_internal_recipe.html:387
#: .\cookbook\templates\forms\edit_internal_recipe.html:418
#, fuzzy
msgid "Save & View"
msgstr "Lagre og vis"
#: .\cookbook\templates\forms\edit_internal_recipe.html:391
#: .\cookbook\templates\forms\edit_internal_recipe.html:424
msgid "Add Step"
msgstr ""
msgstr "Legg til trinn"
#: .\cookbook\templates\forms\edit_internal_recipe.html:394
#: .\cookbook\templates\forms\edit_internal_recipe.html:428
msgid "Add Nutrition"
msgstr ""
msgstr "Legg til næringsinnhold"
#: .\cookbook\templates\forms\edit_internal_recipe.html:396
#: .\cookbook\templates\forms\edit_internal_recipe.html:430
msgid "Remove Nutrition"
msgstr ""
msgstr "Fjern næringsinnhold"
#: .\cookbook\templates\forms\edit_internal_recipe.html:398
#: .\cookbook\templates\forms\edit_internal_recipe.html:433
msgid "View Recipe"
msgstr ""
msgstr "Vis oppskrift"
#: .\cookbook\templates\forms\edit_internal_recipe.html:400
#: .\cookbook\templates\forms\edit_internal_recipe.html:435
@@ -804,11 +813,11 @@ msgstr "Slett oppskrift"
#: .\cookbook\templates\forms\edit_internal_recipe.html:441
msgid "Steps"
msgstr ""
msgstr "Trinn"
#: .\cookbook\templates\forms\ingredients.html:15
msgid "Edit Ingredients"
msgstr ""
msgstr "Rediger ingrediens"
#: .\cookbook\templates\forms\ingredients.html:16
msgid ""
@@ -820,54 +829,61 @@ msgid ""
"them.\n"
" "
msgstr ""
"\n"
" Følgende skjema kan brukes dersom, tilfeldigvis, to eller flere "
"enheter eller ingredienser er opprettet,\n"
" og burde være identiske.\n"
" Det slår sammen to enheter eller ingredienser og oppdaterer alle "
"oppskrifter som inneholder disse.\n"
" "
#: .\cookbook\templates\forms\ingredients.html:24
#: .\cookbook\templates\stats.html:26
msgid "Units"
msgstr ""
msgstr "Enheter"
#: .\cookbook\templates\forms\ingredients.html:26
msgid "Are you sure that you want to merge these two units?"
msgstr ""
msgstr "Er du sikker på at du vil slå sammen disse enhetene?"
#: .\cookbook\templates\forms\ingredients.html:31
#: .\cookbook\templates\forms\ingredients.html:40
msgid "Merge"
msgstr "Flett"
msgstr "Slå sammen"
#: .\cookbook\templates\forms\ingredients.html:36
msgid "Are you sure that you want to merge these two ingredients?"
msgstr ""
msgstr "Er du sikker på at du vil slå sammen disse ingrediensene?"
#: .\cookbook\templates\generic\delete_template.html:18
#, python-format
msgid "Are you sure you want to delete the %(title)s: <b>%(object)s</b> "
msgstr ""
msgstr "Er du sikker på at du vil slette %(title)s: <b>%(object)s</b> "
#: .\cookbook\templates\generic\delete_template.html:21
msgid "Confirm"
msgstr ""
msgstr "Bekreft"
#: .\cookbook\templates\generic\edit_template.html:30
msgid "View"
msgstr ""
msgstr "Vis"
#: .\cookbook\templates\generic\edit_template.html:34
msgid "Delete original file"
msgstr ""
msgstr "Slett opprinnelig fil"
#: .\cookbook\templates\generic\list_template.html:6
#: .\cookbook\templates\generic\list_template.html:12
msgid "List"
msgstr ""
msgstr "Liste"
#: .\cookbook\templates\generic\list_template.html:25
msgid "Filter"
msgstr ""
msgstr "Filtrer"
#: .\cookbook\templates\generic\list_template.html:30
msgid "Import all"
msgstr ""
msgstr "Importer alle"
#: .\cookbook\templates\generic\new_template.html:6
#: .\cookbook\templates\generic\new_template.html:14
@@ -891,19 +907,19 @@ msgstr "Vis logg"
#: .\cookbook\templates\history.html:24
msgid "Cook Log"
msgstr ""
msgstr "Tilberedingslogg"
#: .\cookbook\templates\import.html:6 .\cookbook\templates\test.html:6
msgid "Import Recipes"
msgstr ""
msgstr "Importer oppskrifter"
#: .\cookbook\templates\include\log_cooking.html:7
msgid "Log Recipe Cooking"
msgstr ""
msgstr "Loggfør tilberedt oppskrift"
#: .\cookbook\templates\include\log_cooking.html:13
msgid "All fields are optional and can be left empty."
msgstr ""
msgstr "Alle felt er valgfri og kan stå tomme."
#: .\cookbook\templates\include\log_cooking.html:19
msgid "Rating"
@@ -943,44 +959,53 @@ msgid ""
"can be used.\n"
" "
msgstr ""
"\n"
" <b>Passord og nøkkelfeltene</b> er lagret som <b>ren tekst</b> i "
"databasen.\n"
" Dette er nødvendig for å kunne utføre API-forespørsler, men det øker "
"samtidig risiko for\n"
" uønsket tilgang til dem.<br/>\n"
" For å begrense kosekvensene av uønsket tilgang, kan nøkler eller "
"kontoer med begrenset tilgang benyttes.\n"
" "
#: .\cookbook\templates\index.html:29
msgid "Search recipe ..."
msgstr ""
msgstr "Søk etter oppskrift..."
#: .\cookbook\templates\index.html:44
msgid "New Recipe"
msgstr ""
msgstr "Ny oppskrift"
#: .\cookbook\templates\index.html:47
msgid "Website Import"
msgstr ""
msgstr "Importer fra nettside"
#: .\cookbook\templates\index.html:53
msgid "Advanced Search"
msgstr ""
msgstr "Avansert søk"
#: .\cookbook\templates\index.html:57
msgid "Reset Search"
msgstr ""
msgstr "Nullstill søk"
#: .\cookbook\templates\index.html:85
msgid "Last viewed"
msgstr ""
msgstr "Sist sett"
#: .\cookbook\templates\index.html:87 .\cookbook\templates\meal_plan.html:178
#: .\cookbook\templates\stats.html:22
msgid "Recipes"
msgstr ""
msgstr "Oppskrifter"
#: .\cookbook\templates\index.html:94
msgid "Log in to view recipes"
msgstr ""
msgstr "Logg inn for å se oppskrifter"
#: .\cookbook\templates\markdown_info.html:5
#: .\cookbook\templates\markdown_info.html:13
msgid "Markdown Info"
msgstr ""
msgstr "Markdown informasjon"
#: .\cookbook\templates\markdown_info.html:14
msgid ""
@@ -997,43 +1022,56 @@ msgid ""
"below.\n"
" "
msgstr ""
"\n"
" Markdown er et lettvekts markup språk som benyttes for å formatere "
"ren tekst.\n"
" Denne siden bruker biblioteket <a href=\"https://python-markdown."
"github.io/\" target=\"_blank\">Python Markdown</a> for\n"
" å konvertere teksten din til velformatert HTML. Fullstendig "
"dokumentasjon for markdown finner du\n"
" <a href=\"https://daringfireball.net/projects/markdown/syntax\" "
"target=\"_blank\">her</a>.\n"
" En ufullstendig, men sannsynligvis tilstrekkelig dokumentasjon "
"finner du under her.\n"
" "
#: .\cookbook\templates\markdown_info.html:25
msgid "Headers"
msgstr ""
msgstr "Overskrifter"
#: .\cookbook\templates\markdown_info.html:54
msgid "Formatting"
msgstr ""
msgstr "Formatering"
#: .\cookbook\templates\markdown_info.html:56
#: .\cookbook\templates\markdown_info.html:72
msgid "Line breaks are inserted by adding two spaces after the end of a line"
msgstr ""
"Linjeskift er satt inn ved å sette inn to mellomrom på slutten av en linje"
#: .\cookbook\templates\markdown_info.html:57
#: .\cookbook\templates\markdown_info.html:73
msgid "or by leaving a blank line inbetween."
msgstr ""
msgstr "eller ved å sette inn en tom linje mellom."
#: .\cookbook\templates\markdown_info.html:59
#: .\cookbook\templates\markdown_info.html:74
msgid "This text is bold"
msgstr ""
msgstr "Denne teksten er Fet"
#: .\cookbook\templates\markdown_info.html:60
#: .\cookbook\templates\markdown_info.html:75
msgid "This text is italic"
msgstr ""
msgstr "Denne teksten er Kursiv"
#: .\cookbook\templates\markdown_info.html:61
#: .\cookbook\templates\markdown_info.html:77
msgid "Blockquotes are also possible"
msgstr ""
msgstr "Det er også mulig å sitere avsnitt"
#: .\cookbook\templates\markdown_info.html:84
msgid "Lists"
msgstr ""
msgstr "Lister"
#: .\cookbook\templates\markdown_info.html:85
msgid ""
@@ -1264,7 +1302,7 @@ msgstr ""
#: .\cookbook\templates\no_groups_info.html:5
#: .\cookbook\templates\no_groups_info.html:12
msgid "No Permissions"
msgstr "Ingen tilganger."
msgstr "Ingen tilgang"
#: .\cookbook\templates\no_groups_info.html:17
msgid "You do not have any groups and therefor cannot use this application."
@@ -1298,12 +1336,11 @@ msgstr ""
#: .\cookbook\templates\offline.html:6
msgid "Offline"
msgstr "Frakoblet."
msgstr "Frakoblet"
#: .\cookbook\templates\offline.html:19
#, fuzzy
msgid "You are currently offline!"
msgstr "Du er ikke tilkoblet Internett."
msgstr "Du er ikke tilkoblet!"
#: .\cookbook\templates\offline.html:20
msgid ""
@@ -1366,7 +1403,7 @@ msgstr "Stil"
#: .\cookbook\templates\settings.html:79
msgid "API Token"
msgstr "API-symbol"
msgstr "API nøkkel"
#: .\cookbook\templates\settings.html:80
msgid ""
@@ -1389,9 +1426,8 @@ msgid "Cookbook Setup"
msgstr "Kokeboksoppsett"
#: .\cookbook\templates\setup.html:14
#, fuzzy
msgid "Setup"
msgstr "Sett opp"
msgstr "Installering"
#: .\cookbook\templates\setup.html:15
msgid ""
@@ -1424,11 +1460,11 @@ msgstr "Mengde"
#: .\cookbook\templates\shopping_list.html:226
msgid "Supermarket"
msgstr "Matbutikk"
msgstr "Butikk"
#: .\cookbook\templates\shopping_list.html:236
msgid "Select Supermarket"
msgstr "Velg matbutikk"
msgstr "Velg butikk"
#: .\cookbook\templates\shopping_list.html:260
msgid "Select User"
@@ -1540,7 +1576,6 @@ msgstr ""
#: .\cookbook\templates\system.html:49 .\cookbook\templates\system.html:64
#: .\cookbook\templates\system.html:80 .\cookbook\templates\system.html:95
#, fuzzy
msgid "Ok"
msgstr "OK"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -8,8 +8,8 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-02-11 08:52+0100\n"
"PO-Revision-Date: 2022-03-08 01:31+0000\n"
"Last-Translator: Felipe Castro <felipefcastro@gmail.com>\n"
"PO-Revision-Date: 2023-04-12 11:55+0000\n"
"Last-Translator: noxonad <noxonad@proton.me>\n"
"Language-Team: Portuguese (Brazil) <http://translate.tandoor.dev/projects/"
"tandoor/recipes-backend/pt_BR/>\n"
"Language: pt_BR\n"
@@ -17,7 +17,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 4.10.1\n"
"X-Generator: Weblate 4.15\n"
#: .\cookbook\filters.py:23 .\cookbook\templates\forms\ingredients.html:34
#: .\cookbook\templates\space.html:50 .\cookbook\templates\stats.html:28
@@ -158,7 +158,7 @@ msgstr ""
#: .\cookbook\templates\url_import.html:195
#: .\cookbook\templates\url_import.html:585 .\cookbook\views\lists.py:97
msgid "Keywords"
msgstr ""
msgstr "Palavras-chave"
#: .\cookbook\forms.py:131
msgid "Preparation time in minutes"
@@ -513,7 +513,7 @@ msgstr ""
#: .\cookbook\templates\url_import.html:231
#: .\cookbook\templates\url_import.html:462
msgid "Servings"
msgstr ""
msgstr "Porções"
#: .\cookbook\integration\saffron.py:25
msgid "Waiting time"
@@ -585,7 +585,7 @@ msgstr ""
#: .\cookbook\models.py:302 .\cookbook\templates\base.html:90
msgid "Books"
msgstr ""
msgstr "Livros"
#: .\cookbook\models.py:310
msgid "Small"
@@ -598,7 +598,7 @@ msgstr ""
#: .\cookbook\models.py:310 .\cookbook\templates\generic\new_template.html:6
#: .\cookbook\templates\generic\new_template.html:14
msgid "New"
msgstr ""
msgstr "Novo"
#: .\cookbook\models.py:513
msgid " is part of a recipe step and cannot be deleted"
@@ -677,7 +677,7 @@ msgstr ""
#: .\cookbook\templates\shopping_list.html:37
#: .\cookbook\templates\space.html:109
msgid "Edit"
msgstr ""
msgstr "Editar"
#: .\cookbook\tables.py:115 .\cookbook\tables.py:138
#: .\cookbook\templates\generic\delete_template.html:7
@@ -715,7 +715,7 @@ msgstr ""
#: .\cookbook\templates\settings.html:17
#: .\cookbook\templates\socialaccount\connections.html:10
msgid "Settings"
msgstr ""
msgstr "Configurações"
#: .\cookbook\templates\account\email.html:13
msgid "Email"
@@ -937,7 +937,7 @@ msgstr ""
#: .\cookbook\templates\account\signup.html:48
#: .\cookbook\templates\socialaccount\signup.html:39
msgid "and"
msgstr ""
msgstr "e"
#: .\cookbook\templates\account\signup.html:52
#: .\cookbook\templates\socialaccount\signup.html:43
@@ -989,7 +989,7 @@ msgstr ""
#: .\cookbook\templates\shopping_list.html:208
#: .\cookbook\templates\supermarket.html:7
msgid "Supermarket"
msgstr ""
msgstr "Supermercado"
#: .\cookbook\templates\base.html:163
msgid "Supermarket Category"
@@ -1027,7 +1027,7 @@ msgstr ""
#: .\cookbook\templates\shopping_list.html:165
#: .\cookbook\templates\shopping_list.html:188
msgid "Create"
msgstr ""
msgstr "Criar"
#: .\cookbook\templates\base.html:259
#: .\cookbook\templates\generic\list_template.html:14
@@ -1190,7 +1190,7 @@ msgstr ""
#: .\cookbook\templates\generic\delete_template.html:26
msgid "Protected"
msgstr ""
msgstr "Protegido"
#: .\cookbook\templates\generic\delete_template.html:41
msgid "Cascade"
@@ -1268,7 +1268,7 @@ msgstr ""
#: .\cookbook\templates\include\recipe_open_modal.html:18
msgid "Close"
msgstr ""
msgstr "Fechar"
#: .\cookbook\templates\include\recipe_open_modal.html:32
msgid "Open Recipe"
@@ -1821,7 +1821,7 @@ msgstr ""
#: .\cookbook\templates\settings.html:162
msgid "or"
msgstr ""
msgstr "ou"
#: .\cookbook\templates\settings.html:173
msgid ""
@@ -2062,7 +2062,7 @@ msgstr ""
#: .\cookbook\templates\space.html:120
msgid "user"
msgstr ""
msgstr "usuário"
#: .\cookbook\templates\space.html:121
msgid "guest"
@@ -2208,7 +2208,7 @@ msgstr ""
#: .\cookbook\templates\url_import.html:38
msgid "URL"
msgstr ""
msgstr "URL"
#: .\cookbook\templates\url_import.html:40
msgid "App"
@@ -2273,7 +2273,7 @@ msgstr ""
#: .\cookbook\templates\url_import.html:214
msgid "Image"
msgstr ""
msgstr "Imagem"
#: .\cookbook\templates\url_import.html:246
msgid "Prep Time"
@@ -2359,7 +2359,7 @@ msgstr ""
#: .\cookbook\templates\url_import.html:640
msgid "Information"
msgstr ""
msgstr "Informação"
#: .\cookbook\templates\url_import.html:642
msgid ""

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -8,17 +8,17 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-09-13 22:40+0200\n"
"PO-Revision-Date: 2022-11-30 19:09+0000\n"
"Last-Translator: Alex <kovsharoff@gmail.com>\n"
"PO-Revision-Date: 2023-05-01 07:55+0000\n"
"Last-Translator: axeron2036 <admin@axeron2036.ru>\n"
"Language-Team: Russian <http://translate.tandoor.dev/projects/tandoor/"
"recipes-backend/ru/>\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 4.14.1\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 4.15\n"
#: .\cookbook\filters.py:23 .\cookbook\templates\base.html:125
#: .\cookbook\templates\forms\ingredients.html:34
@@ -286,7 +286,7 @@ msgstr ""
#: .\cookbook\forms.py:497
msgid "Search Method"
msgstr ""
msgstr "Способ поиска"
#: .\cookbook\forms.py:498
msgid "Fuzzy Lookups"
@@ -861,7 +861,7 @@ msgstr ""
#: .\cookbook\templates\base.html:220
msgid "GitHub"
msgstr ""
msgstr "GitHub"
#: .\cookbook\templates\base.html:224
msgid "API Browser"
@@ -1937,7 +1937,7 @@ msgstr ""
#: .\cookbook\templates\space.html:106
msgid "user"
msgstr ""
msgstr "пользователь"
#: .\cookbook\templates\space.html:107
msgid "guest"

View File

@@ -8,17 +8,17 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-08 16:27+0100\n"
"PO-Revision-Date: 2022-02-02 15:31+0000\n"
"Last-Translator: Mario Dvorsek <mario.dvorsek@gmail.com>\n"
"PO-Revision-Date: 2023-04-12 11:55+0000\n"
"Last-Translator: noxonad <noxonad@proton.me>\n"
"Language-Team: Slovenian <http://translate.tandoor.dev/projects/tandoor/"
"recipes-backend/sl/>\n"
"Language: sl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
"%100==4 ? 2 : 3;\n"
"X-Generator: Weblate 4.10.1\n"
"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || "
"n%100==4 ? 2 : 3;\n"
"X-Generator: Weblate 4.15\n"
#: .\cookbook\filters.py:23 .\cookbook\templates\base.html:125
#: .\cookbook\templates\forms\ingredients.html:34
@@ -2107,7 +2107,7 @@ msgstr ""
#: .\cookbook\templates\url_import.html:36
msgid "URL"
msgstr ""
msgstr "URL"
#: .\cookbook\templates\url_import.html:38
msgid "App"

File diff suppressed because it is too large Load Diff

View File

@@ -8,15 +8,17 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-04-29 18:42+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"PO-Revision-Date: 2023-04-12 11:55+0000\n"
"Last-Translator: noxonad <noxonad@proton.me>\n"
"Language-Team: Ukrainian <http://translate.tandoor.dev/projects/tandoor/"
"recipes-backend/uk/>\n"
"Language: uk\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 4.15\n"
#: .\cookbook\filters.py:23 .\cookbook\templates\forms\ingredients.html:34
#: .\cookbook\templates\space.html:49 .\cookbook\templates\stats.html:28
@@ -1089,7 +1091,7 @@ msgstr ""
#: .\cookbook\templates\base.html:311
msgid "GitHub"
msgstr ""
msgstr "GitHub"
#: .\cookbook\templates\base.html:313
msgid "Translate Tandoor"
@@ -2026,7 +2028,7 @@ msgstr ""
#: .\cookbook\templates\space.html:118
msgid "user"
msgstr ""
msgstr "користувач"
#: .\cookbook\templates\space.html:119
msgid "guest"

File diff suppressed because it is too large Load Diff

View File

@@ -8,14 +8,16 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-06-12 20:30+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"PO-Revision-Date: 2023-03-12 02:55+0000\n"
"Last-Translator: Feng Zhong <fewoodse@gmail.com>\n"
"Language-Team: Chinese (Traditional) <http://translate.tandoor.dev/projects/"
"tandoor/recipes-backend/zh_Hant/>\n"
"Language: zh_Hant\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 4.15\n"
#: .\cookbook\filters.py:23 .\cookbook\templates\base.html:98
#: .\cookbook\templates\forms\edit_internal_recipe.html:246
@@ -23,41 +25,41 @@ msgstr ""
#: .\cookbook\templates\space.html:37 .\cookbook\templates\stats.html:28
#: .\cookbook\templates\url_import.html:270 .\cookbook\views\lists.py:67
msgid "Ingredients"
msgstr ""
msgstr "食材"
#: .\cookbook\forms.py:49
msgid ""
"Color of the top navigation bar. Not all colors work with all themes, just "
"try them out!"
msgstr ""
msgstr "頂部導航欄的顏色。並非所有的顏色都適用於所有的主題,只要試一試就可以了!"
#: .\cookbook\forms.py:51
msgid "Default Unit to be used when inserting a new ingredient into a recipe."
msgstr ""
msgstr "在菜譜中插入新食材時使用的默認單位。"
#: .\cookbook\forms.py:53
msgid ""
"Enables support for fractions in ingredient amounts (e.g. convert decimals "
"to fractions automatically)"
msgstr ""
msgstr "啟用對食材數量的分數支持(例如自動將小數轉換為分數)"
#: .\cookbook\forms.py:56
msgid ""
"Users with whom newly created meal plan/shopping list entries should be "
"shared by default."
msgstr ""
msgstr "默認情況下,將自動與用戶共享新創建的膳食計劃。"
#: .\cookbook\forms.py:58
msgid "Show recently viewed recipes on search page."
msgstr ""
msgstr "在搜索頁面上查看最近看過的食譜。"
#: .\cookbook\forms.py:59
msgid "Number of decimals to round ingredients."
msgstr ""
msgstr "四舍五入食材的小數點數量。"
#: .\cookbook\forms.py:60
msgid "If you want to be able to create and see comments underneath recipes."
msgstr ""
msgstr "如果你希望能夠在菜譜下面創建並看到評論。"
#: .\cookbook\forms.py:62
msgid ""
@@ -66,22 +68,25 @@ msgid ""
"Useful when shopping with multiple people but might use a little bit of "
"mobile data. If lower than instance limit it is reset when saving."
msgstr ""
"設置為0將禁用自動同步。當查看購物清單時清單會每隔幾秒鐘更新一次以同步其他"
"人可能做出的改變。在與多人一起購物時很有用,但可能會消耗一點移動數據。如果低"
"於實例限制,它將在保存時被重置。"
#: .\cookbook\forms.py:65
msgid "Makes the navbar stick to the top of the page."
msgstr ""
msgstr "使導航欄保持在頁面的頂部。"
#: .\cookbook\forms.py:81
msgid ""
"Both fields are optional. If none are given the username will be displayed "
"instead"
msgstr ""
msgstr "這兩個字段都是可選的。如果沒有輸入,將顯示用戶名"
#: .\cookbook\forms.py:102 .\cookbook\forms.py:331
#: .\cookbook\templates\forms\edit_internal_recipe.html:49
#: .\cookbook\templates\url_import.html:154
msgid "Name"
msgstr ""
msgstr "名字"
#: .\cookbook\forms.py:103 .\cookbook\forms.py:332
#: .\cookbook\templates\base.html:105
@@ -90,37 +95,37 @@ msgstr ""
#: .\cookbook\templates\url_import.html:188
#: .\cookbook\templates\url_import.html:573
msgid "Keywords"
msgstr ""
msgstr "關鍵詞"
#: .\cookbook\forms.py:104
msgid "Preparation time in minutes"
msgstr ""
msgstr "準備時間(分鐘)"
#: .\cookbook\forms.py:105
msgid "Waiting time (cooking/baking) in minutes"
msgstr ""
msgstr "等候(烹飪、烘焙等)時間(分鐘)"
#: .\cookbook\forms.py:106 .\cookbook\forms.py:333
msgid "Path"
msgstr ""
msgstr "路徑"
#: .\cookbook\forms.py:107
msgid "Storage UID"
msgstr ""
msgstr "存儲ID"
#: .\cookbook\forms.py:133
msgid "Default"
msgstr ""
msgstr "默認"
#: .\cookbook\forms.py:144 .\cookbook\templates\url_import.html:90
msgid ""
"To prevent duplicates recipes with the same name as existing ones are "
"ignored. Check this box to import everything."
msgstr ""
msgstr "為防止重復,忽略與現有同名的菜譜。選中此框可導入所有內容(包括同名菜譜)。"
#: .\cookbook\forms.py:164
msgid "New Unit"
msgstr ""
msgstr "新單位"
#: .\cookbook\forms.py:165
msgid "New unit that other gets replaced by."
@@ -128,15 +133,15 @@ msgstr ""
#: .\cookbook\forms.py:170
msgid "Old Unit"
msgstr ""
msgstr "舊單位"
#: .\cookbook\forms.py:171
msgid "Unit that should be replaced."
msgstr ""
msgstr "該被替換的單位。"
#: .\cookbook\forms.py:187
msgid "New Food"
msgstr ""
msgstr "新食物"
#: .\cookbook\forms.py:188
msgid "New food that other gets replaced by."
@@ -144,85 +149,86 @@ msgstr ""
#: .\cookbook\forms.py:193
msgid "Old Food"
msgstr ""
msgstr "舊食物"
#: .\cookbook\forms.py:194
msgid "Food that should be replaced."
msgstr ""
msgstr "該被替換的食物。"
#: .\cookbook\forms.py:212
msgid "Add your comment: "
msgstr ""
msgstr "發表評論。 "
#: .\cookbook\forms.py:253
msgid "Leave empty for dropbox and enter app password for nextcloud."
msgstr ""
msgstr "Dropbox 留空並輸入 Nextcloud 應用密碼。"
#: .\cookbook\forms.py:260
msgid "Leave empty for nextcloud and enter api token for dropbox."
msgstr ""
msgstr "Nextcloud 留空並輸入 Dropbox API 令牌。"
#: .\cookbook\forms.py:269
msgid ""
"Leave empty for dropbox and enter only base url for nextcloud (<code>/remote."
"php/webdav/</code> is added automatically)"
msgstr ""
msgstr "Dropbox 留空並輸入基礎 Nextcloud 網址(<code>/remote.php/webdav/</code> "
"會自動添加)"
#: .\cookbook\forms.py:307
msgid "Search String"
msgstr ""
msgstr "搜索字符串"
#: .\cookbook\forms.py:334
msgid "File ID"
msgstr ""
msgstr "文件編號"
#: .\cookbook\forms.py:370
msgid "You must provide at least a recipe or a title."
msgstr ""
msgstr "你必須至少提供一份菜譜或一個標題。"
#: .\cookbook\forms.py:383
msgid "You can list default users to share recipes with in the settings."
msgstr ""
msgstr "你可以在設置中列出默認用戶來分享菜譜。"
#: .\cookbook\forms.py:384
#: .\cookbook\templates\forms\edit_internal_recipe.html:404
msgid ""
"You can use markdown to format this field. See the <a href=\"/docs/markdown/"
"\">docs here</a>"
msgstr ""
msgstr "可以使用 Markdown 設置此字段格式。<a href=\"/docs/markdown/\">查看文檔</a>"
#: .\cookbook\forms.py:409
msgid "Maximum number of users for this space reached."
msgstr ""
msgstr "已達到該空間的最大用戶數。"
#: .\cookbook\forms.py:415
msgid "Email address already taken!"
msgstr ""
msgstr "電子郵件地址已被註冊!"
#: .\cookbook\forms.py:423
msgid ""
"An email address is not required but if present the invite link will be send "
"to the user."
msgstr ""
msgstr "電子郵件地址不是必需的,但如果存在,邀請鏈接將被發送給用戶。"
#: .\cookbook\forms.py:438
msgid "Name already taken."
msgstr ""
msgstr "名字已被占用。"
#: .\cookbook\forms.py:449
msgid "Accept Terms and Privacy"
msgstr ""
msgstr "接受條款及隱私政策"
#: .\cookbook\helper\AllAuthCustomAdapter.py:30
msgid ""
"In order to prevent spam, the requested email was not send. Please wait a "
"few minutes and try again."
msgstr ""
msgstr "為了防止垃圾郵件,所要求的電子郵件沒有被發送。請等待幾分鐘後再試。"
#: .\cookbook\helper\permission_helper.py:124
#: .\cookbook\helper\permission_helper.py:144 .\cookbook\views\views.py:147
msgid "You are not logged in and therefore cannot view this page!"
msgstr ""
msgstr "你还沒有登錄,因此不能查看這個頁面!"
#: .\cookbook\helper\permission_helper.py:127
#: .\cookbook\helper\permission_helper.py:132
@@ -234,18 +240,18 @@ msgstr ""
#: .\cookbook\views\views.py:158 .\cookbook\views\views.py:165
#: .\cookbook\views\views.py:253
msgid "You do not have the required permissions to view this page!"
msgstr ""
msgstr "你沒有必要的權限來查看這個頁面!"
#: .\cookbook\helper\permission_helper.py:148
#: .\cookbook\helper\permission_helper.py:170
#: .\cookbook\helper\permission_helper.py:185
msgid "You cannot interact with this object as it is not owned by you!"
msgstr ""
msgstr "你不能與此對象交互,因為它不屬於你!"
#: .\cookbook\helper\template_helper.py:60
#: .\cookbook\helper\template_helper.py:62
msgid "Could not parse template code."
msgstr ""
msgstr "無法解析模板代碼。"
#: .\cookbook\integration\integration.py:102
#: .\cookbook\templates\import.html:14 .\cookbook\templates\import.html:20
@@ -258,40 +264,40 @@ msgstr ""
#: .\cookbook\templates\url_import.html:604 .\cookbook\views\delete.py:60
#: .\cookbook\views\edit.py:199
msgid "Import"
msgstr ""
msgstr "導入"
#: .\cookbook\integration\integration.py:162
msgid ""
"Importer expected a .zip file. Did you choose the correct importer type for "
"your data ?"
msgstr ""
msgstr "導入需要一個 .zip 文件。你是否為數據選擇了正確的導入器類型?"
#: .\cookbook\integration\integration.py:165
msgid ""
"An unexpected error occurred during the import. Please make sure you have "
"uploaded a valid file."
msgstr ""
msgstr "在導入過程中發生了一個意外的錯誤。請確認你上傳的文件是否有效。"
#: .\cookbook\integration\integration.py:169
msgid "The following recipes were ignored because they already existed:"
msgstr ""
msgstr "以下菜譜被忽略了,因為它們已經存在了:"
#: .\cookbook\integration\integration.py:173
#, python-format
msgid "Imported %s recipes."
msgstr ""
msgstr "導入了%s菜譜。"
#: .\cookbook\integration\paprika.py:46
msgid "Notes"
msgstr ""
msgstr "說明"
#: .\cookbook\integration\paprika.py:49
msgid "Nutritional Information"
msgstr ""
msgstr "營養信息"
#: .\cookbook\integration\paprika.py:53
msgid "Source"
msgstr ""
msgstr "來源"
#: .\cookbook\integration\safron.py:23
#: .\cookbook\templates\forms\edit_internal_recipe.html:79
@@ -299,101 +305,101 @@ msgstr ""
#: .\cookbook\templates\url_import.html:224
#: .\cookbook\templates\url_import.html:455
msgid "Servings"
msgstr ""
msgstr "份量"
#: .\cookbook\integration\safron.py:25
msgid "Waiting time"
msgstr ""
msgstr "等待時間"
#: .\cookbook\integration\safron.py:27
#: .\cookbook\templates\forms\edit_internal_recipe.html:73
msgid "Preparation Time"
msgstr ""
msgstr "準備時間"
#: .\cookbook\integration\safron.py:29 .\cookbook\templates\base.html:78
#: .\cookbook\templates\forms\ingredients.html:7
#: .\cookbook\templates\index.html:7
msgid "Cookbook"
msgstr ""
msgstr "菜譜"
#: .\cookbook\integration\safron.py:31
msgid "Section"
msgstr ""
msgstr "部分"
#: .\cookbook\migrations\0047_auto_20200602_1133.py:14
msgid "Breakfast"
msgstr ""
msgstr "早餐"
#: .\cookbook\migrations\0047_auto_20200602_1133.py:19
msgid "Lunch"
msgstr ""
msgstr "午餐"
#: .\cookbook\migrations\0047_auto_20200602_1133.py:24
msgid "Dinner"
msgstr ""
msgstr "晚餐"
#: .\cookbook\migrations\0047_auto_20200602_1133.py:29
msgid "Other"
msgstr ""
msgstr "其他"
#: .\cookbook\models.py:71
msgid ""
"Maximum file storage for space in MB. 0 for unlimited, -1 to disable file "
"upload."
msgstr ""
msgstr "空間的最大文件存儲量,單位為 MB。0表示無限製-1表示禁止上傳文件。"
#: .\cookbook\models.py:121 .\cookbook\templates\search.html:7
#: .\cookbook\templates\shopping_list.html:52
msgid "Search"
msgstr ""
msgstr "搜索"
#: .\cookbook\models.py:122 .\cookbook\templates\base.html:92
#: .\cookbook\templates\meal_plan.html:5 .\cookbook\views\delete.py:152
#: .\cookbook\views\edit.py:233 .\cookbook\views\new.py:201
msgid "Meal-Plan"
msgstr ""
msgstr "膳食計劃"
#: .\cookbook\models.py:123 .\cookbook\templates\base.html:89
msgid "Books"
msgstr ""
msgstr "書籍"
#: .\cookbook\models.py:131
msgid "Small"
msgstr ""
msgstr ""
#: .\cookbook\models.py:131
msgid "Large"
msgstr ""
msgstr ""
#: .\cookbook\models.py:131 .\cookbook\templates\generic\new_template.html:6
#: .\cookbook\templates\generic\new_template.html:14
#: .\cookbook\templates\meal_plan.html:323
msgid "New"
msgstr ""
msgstr ""
#: .\cookbook\models.py:340
#: .\cookbook\templates\forms\edit_internal_recipe.html:202
msgid "Text"
msgstr ""
msgstr "文本"
#: .\cookbook\models.py:340
#: .\cookbook\templates\forms\edit_internal_recipe.html:203
msgid "Time"
msgstr ""
msgstr "時間"
#: .\cookbook\models.py:340
#: .\cookbook\templates\forms\edit_internal_recipe.html:204
#: .\cookbook\templates\forms\edit_internal_recipe.html:218
msgid "File"
msgstr ""
msgstr "文件"
#: .\cookbook\serializer.py:109
msgid "File uploads are not enabled for this Space."
msgstr ""
msgstr "未為此空間啟用文件上傳。"
#: .\cookbook\serializer.py:117
msgid "You have reached your file upload limit."
msgstr ""
msgstr "你已達到文件上傳的限製。"
#: .\cookbook\tables.py:35 .\cookbook\templates\books.html:36
#: .\cookbook\templates\generic\edit_template.html:6
@@ -403,7 +409,7 @@ msgstr ""
#: .\cookbook\templates\shopping_list.html:33
#: .\cookbook\templates\space.html:84
msgid "Edit"
msgstr ""
msgstr "編輯"
#: .\cookbook\tables.py:124 .\cookbook\tables.py:147
#: .\cookbook\templates\books.html:38
@@ -413,28 +419,28 @@ msgstr ""
#: .\cookbook\templates\meal_plan.html:277
#: .\cookbook\templates\recipes_table.html:90
msgid "Delete"
msgstr ""
msgstr "刪除"
#: .\cookbook\templates\404.html:5
msgid "404 Error"
msgstr ""
msgstr "404錯誤"
#: .\cookbook\templates\404.html:18
msgid "The page you are looking for could not be found."
msgstr ""
msgstr "找不到你要找的頁面。"
#: .\cookbook\templates\404.html:33
msgid "Take me Home"
msgstr ""
msgstr "回到主頁"
#: .\cookbook\templates\404.html:35
msgid "Report a Bug"
msgstr ""
msgstr "報告一個錯誤"
#: .\cookbook\templates\account\email.html:6
#: .\cookbook\templates\account\email.html:9
msgid "E-mail Addresses"
msgstr ""
msgstr "電子郵件地址"
#: .\cookbook\templates\account\email.html:11
msgid "The following e-mail addresses are associated with your account:"
@@ -1769,7 +1775,7 @@ msgstr ""
#: .\cookbook\templates\space.html:100
msgid "user"
msgstr ""
msgstr "用戶"
#: .\cookbook\templates\space.html:101
msgid "guest"

View File

@@ -0,0 +1,18 @@
# Generated by Django 4.1.4 on 2023-02-12 16:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0187_alter_space_use_plural'),
]
operations = [
migrations.AddField(
model_name='space',
name='no_sharing_limit',
field=models.BooleanField(default=False),
),
]

View File

@@ -262,6 +262,7 @@ class Space(ExportModelOperationsMixin('space'), models.Model):
max_users = models.IntegerField(default=0)
use_plural = models.BooleanField(default=True)
allow_sharing = models.BooleanField(default=True)
no_sharing_limit = models.BooleanField(default=False)
demo = models.BooleanField(default=False)
food_inherit = models.ManyToManyField(FoodInheritField, blank=True)
show_facet_count = models.BooleanField(default=False)
@@ -680,7 +681,7 @@ class Ingredient(ExportModelOperationsMixin('ingredient'), models.Model, Permiss
if self.always_use_plural_unit and self.unit.plural_name not in (None, "") and not self.no_amount:
unit = self.unit.plural_name
else:
if self.amount > 1 and self.unit.plural_name not in (None, "") and not self.no_amount:
if self.amount > 1 and self.unit is not None and self.unit.plural_name not in (None, "") and not self.no_amount:
unit = self.unit.plural_name
else:
unit = str(self.unit)

View File

@@ -432,9 +432,13 @@ class UnitSerializer(UniqueFieldsMixin, ExtendedRecipeMixin):
def create(self, validated_data):
name = validated_data.pop('name').strip()
plural_name = validated_data.pop('plural_name', None)
if plural_name:
if plural_name := validated_data.pop('plural_name', None):
plural_name = plural_name.strip()
if unit := Unit.objects.filter(Q(name=name) | Q(plural_name=name)).first():
return unit
space = validated_data.pop('space', self.context['request'].space)
obj, created = Unit.objects.get_or_create(name=name, plural_name=plural_name, space=space, defaults=validated_data)
return obj
@@ -544,9 +548,13 @@ class FoodSerializer(UniqueFieldsMixin, WritableNestedModelSerializer, ExtendedR
def create(self, validated_data):
name = validated_data.pop('name').strip()
plural_name = validated_data.pop('plural_name', None)
if plural_name:
if plural_name := validated_data.pop('plural_name', None):
plural_name = plural_name.strip()
if food := Food.objects.filter(Q(name=name) | Q(plural_name=name)).first():
return food
space = validated_data.pop('space', self.context['request'].space)
# supermarket category needs to be handled manually as food.get or create does not create nested serializers unlike a super.create of serializer
if 'supermarket_category' in validated_data and validated_data['supermarket_category']:

View File

@@ -2,6 +2,16 @@
height: 40px;
}
.two-row-text {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2; /* number of lines to show */
line-clamp: 2;
-webkit-box-orient: vertical;
}
@media (max-width: 991.98px) {
.menu-dropdown-text {
font-size: 14px;

View File

@@ -350,8 +350,8 @@
{% message_of_the_day request as message_of_the_day %}
{% if message_of_the_day %}
<div class="bg-success" style=" width: 100%; text-align: center!important; color: #ffffff; padding: 8px">
{{ message_of_the_day }}
<div class="bg-info" style=" width: 100%; text-align: center!important; color: #ffffff; padding: 8px">
{{ message_of_the_day | markdown |safe }}
</div>
{% endif %}

View File

@@ -7,6 +7,21 @@
{% block title %}{{ recipe.name }}{% endblock %}
{% block extra_head %}
<meta property="og:title" content="{{ recipe.name }}"/>
<meta property="og:type" content="website"/>
<meta property="og:url" content="{% base_path request 'base' %}{% url 'view_recipe' recipe.pk share %}"/>
{% if recipe.image %}
<meta property="og:image" content="{% base_path request 'base' %}{{ recipe.image.url }}"/>
<meta property="og:image:url" content="{% base_path request 'base' %}{{ recipe.image.url }}"/>
<meta property="og:image:secure" content="{% base_path request 'base' %}{{ recipe.image.url }}"/>
{% endif %}
{% if recipe.description %}
<meta property="og:description" content="{{ recipe.description }}"/>
{% endif %}
<meta property="og:site_name" content="Tandoor Recipes"/>
{% endblock %}
{% block content %}
{% recipe_rating recipe request.user as rating %}
@@ -33,7 +48,7 @@
{% endfor %}
{% if request.user.is_authenticated %}
<div class="d-print-none">
<div class="d-print-none" style="padding-bottom: 60px">
<form method="POST" class="post-form">
{% csrf_token %}

View File

@@ -10,7 +10,9 @@
{% block content_fluid %}
{{ data }}
<div id="app">
<test-view></test-view>
</div>
{% endblock %}

View File

@@ -57,6 +57,8 @@ def markdown(value):
]
)
markdown_attrs['*'] = markdown_attrs['*'] + ['class']
parsed_md = parsed_md[3:] # remove outer paragraph
parsed_md = parsed_md[:len(parsed_md)-4]
return bleach.clean(parsed_md, tags, markdown_attrs)

View File

@@ -6,7 +6,7 @@ from django.urls import reverse
from django_scopes import scope, scopes_disabled
from pytest_factoryboy import LazyFixture, register
from cookbook.models import Food, FoodInheritField, Ingredient, ShoppingList, ShoppingListEntry
from cookbook.models import Food, Ingredient, ShoppingListEntry
from cookbook.tests.factories import (FoodFactory, IngredientFactory, ShoppingListEntryFactory,
SupermarketCategoryFactory)
@@ -56,23 +56,32 @@ def obj_tree_1(request, space_1):
params = request.param # request.param is a magic variable
except AttributeError:
params = {}
objs = []
inherit = params.pop('inherit', False)
objs.extend(FoodFactory.create_batch(3, space=space_1, **params))
FoodFactory.create_batch(3, space=space_1, **params)
objs = Food.objects.values_list('id', flat=True)
obj_id = objs[1]
child_id = objs[0]
parent_id = objs[2]
# set all foods to inherit everything
if inherit:
inherit = Food.inheritable_fields
Through = Food.objects.filter(space=space_1).first().inherit_fields.through
Through = Food.objects.filter(
space=space_1).first().inherit_fields.through
for i in inherit:
Through.objects.bulk_create([
Through(food_id=x, foodinheritfield_id=i.id)
for x in Food.objects.filter(space=space_1).values_list('id', flat=True)
])
objs[0].move(objs[1], node_location)
objs[1].move(objs[2], node_location)
return Food.objects.get(id=objs[1].id) # whenever you move/merge a tree it's safest to re-get the object
Food.objects.get(id=child_id).move(
Food.objects.get(id=obj_id), node_location)
Food.objects.get(id=obj_id).move(
Food.objects.get(id=parent_id), node_location)
# whenever you move/merge a tree it's safest to re-get the object
return Food.objects.get(id=obj_id)
@pytest.mark.parametrize("arg", [
@@ -90,8 +99,12 @@ def test_list_space(obj_1, obj_2, u1_s1, u1_s2, space_2):
assert json.loads(u1_s1.get(reverse(LIST_URL)).content)['count'] == 2
assert json.loads(u1_s2.get(reverse(LIST_URL)).content)['count'] == 0
obj_1.space = space_2
obj_1.save()
with scopes_disabled():
# for some reason the 'path' attribute changes between the factory and the test
obj_1 = Food.objects.get(id=obj_1.id)
obj_2 = Food.objects.get(id=obj_2.id)
obj_1.space = space_2
obj_1.save()
assert json.loads(u1_s1.get(reverse(LIST_URL)).content)['count'] == 1
assert json.loads(u1_s2.get(reverse(LIST_URL)).content)['count'] == 1
@@ -107,19 +120,23 @@ def test_list_filter(obj_1, obj_2, u1_s1):
assert obj_2.name in [x['name'] for x in response['results']]
assert response['results'][0]['name'] < response['results'][1]['name']
response = json.loads(u1_s1.get(f'{reverse(LIST_URL)}?page_size=1').content)
response = json.loads(
u1_s1.get(f'{reverse(LIST_URL)}?page_size=1').content)
assert len(response['results']) == 1
response = json.loads(u1_s1.get(f'{reverse(LIST_URL)}?limit=1').content)
assert len(response['results']) == 1
response = json.loads(u1_s1.get(f'{reverse(LIST_URL)}?query=''&limit=1').content)
response = json.loads(
u1_s1.get(f'{reverse(LIST_URL)}?query=''&limit=1').content)
assert len(response['results']) == 1
response = json.loads(u1_s1.get(f'{reverse(LIST_URL)}?query=chicken').content)
response = json.loads(
u1_s1.get(f'{reverse(LIST_URL)}?query=chicken').content)
assert response['count'] == 0
response = json.loads(u1_s1.get(f'{reverse(LIST_URL)}?query={obj_1.name[:-4]}').content)
response = json.loads(
u1_s1.get(f'{reverse(LIST_URL)}?query={obj_1.name[:-4]}').content)
assert response['count'] == 1
@@ -262,8 +279,9 @@ def test_integrity(u1_s1, recipe_1_s1):
def test_move(u1_s1, obj_tree_1, obj_2, obj_3, space_1):
with scope(space=space_1):
# for some reason the 'path' attribute changes between the factory and the test when using both obj_tree and obj
obj_tree_1 = Food.objects.get(id=obj_tree_1.id)
parent = obj_tree_1.get_parent()
child = obj_tree_1.get_descendants()[0]
assert parent.get_num_children() == 1
assert parent.get_descendant_count() == 2
assert Food.get_root_nodes().filter(space=space_1).count() == 2
@@ -295,8 +313,9 @@ def test_move(u1_s1, obj_tree_1, obj_2, obj_3, space_1):
def test_move_errors(u1_s1, obj_tree_1, obj_3, space_1):
with scope(space=space_1):
# for some reason the 'path' attribute changes between the factory and the test when using both obj_tree and obj
obj_tree_1 = Food.objects.get(id=obj_tree_1.id)
parent = obj_tree_1.get_parent()
child = obj_tree_1.get_descendants()[0]
# move child to root
r = u1_s1.put(reverse(MOVE_URL, args=[obj_tree_1.id, 0]))
assert r.status_code == 200
@@ -351,7 +370,7 @@ def test_merge_shopping_entries(obj_tree_1, u1_s1, space_1):
with scope(space=space_1):
parent = obj_tree_1.get_parent()
child = obj_tree_1.get_descendants()[0]
ShoppingListEntryFactory.create(food=parent, space=space_1)
ShoppingListEntryFactory.create(food=parent, space=space_1)
ShoppingListEntryFactory.create(food=child, space=space_1)
assert parent.get_num_children() == 1
assert parent.get_descendant_count() == 2
@@ -371,8 +390,10 @@ def test_merge_shopping_entries(obj_tree_1, u1_s1, space_1):
assert obj_tree_1.shopping_entries.count() == 1 # now has child's ingredient
def test_merge(u1_s1, obj_tree_1, obj_1, obj_3, space_1):
def test_merge(u1_s1, obj_tree_1, obj_1, obj_3, space_1):
with scope(space=space_1):
# for some reason the 'path' attribute changes between the factory and the test when using both obj_tree and obj
obj_tree_1 = Food.objects.get(id=obj_tree_1.id)
parent = obj_tree_1.get_parent()
child = obj_tree_1.get_descendants()[0]
assert parent.get_num_children() == 1
@@ -416,8 +437,9 @@ def test_merge(u1_s1, obj_tree_1, obj_1, obj_3, space_1):
def test_merge_errors(u1_s1, obj_tree_1, obj_3, space_1):
with scope(space=space_1):
# for some reason the 'path' attribute changes between the factory and the test when using both obj_tree and obj
obj_tree_1 = Food.objects.get(id=obj_tree_1.id)
parent = obj_tree_1.get_parent()
child = obj_tree_1.get_descendants()[0]
# attempt to merge with non-existent parent
r = u1_s1.put(
@@ -451,44 +473,63 @@ def test_merge_errors(u1_s1, obj_tree_1, obj_3, space_1):
def test_root_filter(obj_tree_1, obj_2, obj_3, u1_s1):
with scope(space=obj_tree_1.space):
# for some reason the 'path' attribute changes between the factory and the test when using both obj_tree and obj
obj_tree_1 = Food.objects.get(id=obj_tree_1.id)
parent = obj_tree_1.get_parent()
child = obj_tree_1.get_descendants()[0]
# should return root objects in the space (obj_1, obj_2), ignoring query filters
response = json.loads(u1_s1.get(f'{reverse(LIST_URL)}?root=0').content)
assert len(response['results']) == 2
# django_tree bypasses ORM - best to retrieve all changed objects
with scopes_disabled():
obj_2.move(parent, node_location)
obj_2 = Food.objects.get(id=obj_2.id)
parent = Food.objects.get(id=parent.id)
# should return direct children of parent (obj_tree_1, obj_2), ignoring query filters
response = json.loads(u1_s1.get(f'{reverse(LIST_URL)}?root={parent.id}').content)
response = json.loads(
u1_s1.get(f'{reverse(LIST_URL)}?root={parent.id}').content)
assert response['count'] == 2
response = json.loads(u1_s1.get(f'{reverse(LIST_URL)}?root={parent.id}&query={obj_2.name[4:]}').content)
response = json.loads(u1_s1.get(
f'{reverse(LIST_URL)}?root={parent.id}&query={obj_2.name[4:]}').content)
assert response['count'] == 2
def test_tree_filter(obj_tree_1, obj_2, obj_3, u1_s1):
with scope(space=obj_tree_1.space):
# for some reason the 'path' attribute changes between the factory and the test when using both obj_tree and obj
obj_tree_1 = Food.objects.get(id=obj_tree_1.id)
parent = obj_tree_1.get_parent()
child = obj_tree_1.get_descendants()[0]
obj_2.move(parent, node_location)
obj_2 = Food.objects.get(id=obj_2.id)
parent = Food.objects.get(id=parent.id)
# should return full tree starting at parent (obj_tree_1, obj_2), ignoring query filters
response = json.loads(u1_s1.get(f'{reverse(LIST_URL)}?tree={parent.id}').content)
response = json.loads(
u1_s1.get(f'{reverse(LIST_URL)}?tree={parent.id}').content)
assert response['count'] == 4
response = json.loads(u1_s1.get(f'{reverse(LIST_URL)}?tree={parent.id}&query={obj_2.name[4:]}').content)
response = json.loads(u1_s1.get(
f'{reverse(LIST_URL)}?tree={parent.id}&query={obj_2.name[4:]}').content)
assert response['count'] == 4
# This is more about the model than the API - should this be moved to a different test?
@pytest.mark.parametrize("obj_tree_1, field, inherit, new_val", [
({'has_category': True, 'inherit': True}, 'supermarket_category', True, 'cat_1'),
({'has_category': True, 'inherit': False}, 'supermarket_category', False, 'cat_1'),
({'ignore_shopping': True, 'inherit': True}, 'ignore_shopping', True, 'false'),
({'ignore_shopping': True, 'inherit': False}, 'ignore_shopping', False, 'false'),
({'substitute_children': True, 'inherit': True}, 'substitute_children', True, 'false'),
({'substitute_children': True, 'inherit': False}, 'substitute_children', False, 'false'),
({'substitute_siblings': True, 'inherit': True}, 'substitute_siblings', True, 'false'),
({'substitute_siblings': True, 'inherit': False}, 'substitute_siblings', False, 'false'),
({'has_category': True, 'inherit': True},
'supermarket_category', True, 'cat_1'),
({'has_category': True, 'inherit': False},
'supermarket_category', False, 'cat_1'),
({'ignore_shopping': True, 'inherit': True}, 'ignore_shopping', True, 'false'),
({'ignore_shopping': True, 'inherit': False},
'ignore_shopping', False, 'false'),
({'substitute_children': True, 'inherit': True},
'substitute_children', True, 'false'),
({'substitute_children': True, 'inherit': False},
'substitute_children', False, 'false'),
({'substitute_siblings': True, 'inherit': True},
'substitute_siblings', True, 'false'),
({'substitute_siblings': True, 'inherit': False},
'substitute_siblings', False, 'false'),
], indirect=['obj_tree_1']) # indirect=True populates magic variable request.param of obj_tree_1 with the parameter
def test_inherit(request, obj_tree_1, field, inherit, new_val, u1_s1):
with scope(space=obj_tree_1.space):
@@ -498,8 +539,10 @@ def test_inherit(request, obj_tree_1, field, inherit, new_val, u1_s1):
new_val = request.getfixturevalue(new_val)
# if this test passes it demonstrates that inheritance works
# when moving to a parent as each food is created with a different category
assert (getattr(parent, field) == getattr(obj_tree_1, field)) in [inherit, True]
assert (getattr(obj_tree_1, field) == getattr(child, field)) in [inherit, True]
assert (getattr(parent, field) == getattr(
obj_tree_1, field)) in [inherit, True]
assert (getattr(obj_tree_1, field) == getattr(
child, field)) in [inherit, True]
# change parent to a new value
setattr(parent, field, new_val)
with scope(space=parent.space):
@@ -515,7 +558,8 @@ def test_inherit(request, obj_tree_1, field, inherit, new_val, u1_s1):
@pytest.mark.parametrize("obj_tree_1", [
({'has_category': True, 'inherit': False, 'ignore_shopping': True, 'substitute_children': True, 'substitute_siblings': True}),
({'has_category': True, 'inherit': False, 'ignore_shopping': True,
'substitute_children': True, 'substitute_siblings': True}),
], indirect=['obj_tree_1'])
@pytest.mark.parametrize("global_reset", [True, False])
@pytest.mark.parametrize("field", ['ignore_shopping', 'substitute_children', 'substitute_siblings', 'supermarket_category'])
@@ -534,10 +578,13 @@ def test_reset_inherit_space_fields(obj_tree_1, space_1, global_reset, field):
assert getattr(parent, field) != getattr(obj_tree_1, field)
if global_reset:
space_1.food_inherit.add(*Food.inheritable_fields.values_list('id', flat=True)) # set default inherit fields
# set default inherit fields
space_1.food_inherit.add(
*Food.inheritable_fields.values_list('id', flat=True))
parent.reset_inheritance(space=space_1)
else:
obj_tree_1.child_inherit_fields.set(Food.inheritable_fields.values_list('id', flat=True))
obj_tree_1.child_inherit_fields.set(
Food.inheritable_fields.values_list('id', flat=True))
obj_tree_1.save()
parent.reset_inheritance(space=space_1, food=obj_tree_1)
# djangotree bypasses ORM and need to be retrieved again
@@ -545,12 +592,14 @@ def test_reset_inherit_space_fields(obj_tree_1, space_1, global_reset, field):
parent = Food.objects.get(id=parent.id)
child = Food.objects.get(id=child.id)
assert (getattr(parent, field) == getattr(obj_tree_1, field)) == global_reset
assert (getattr(parent, field) == getattr(
obj_tree_1, field)) == global_reset
assert getattr(obj_tree_1, field) == getattr(child, field)
@pytest.mark.parametrize("obj_tree_1", [
({'has_category': True, 'inherit': False, 'ignore_shopping': True, 'substitute_children': True, 'substitute_siblings': True}),
({'has_category': True, 'inherit': False, 'ignore_shopping': True,
'substitute_children': True, 'substitute_siblings': True}),
], indirect=['obj_tree_1'])
@pytest.mark.parametrize("field", ['ignore_shopping', 'substitute_children', 'substitute_siblings', 'supermarket_category'])
def test_reset_inherit_no_food_instances(obj_tree_1, space_1, field):
@@ -558,13 +607,17 @@ def test_reset_inherit_no_food_instances(obj_tree_1, space_1, field):
parent = obj_tree_1.get_parent()
Food.objects.all().delete()
space_1.food_inherit.add(*Food.inheritable_fields.values_list('id', flat=True)) # set default inherit fields
# set default inherit fields
space_1.food_inherit.add(
*Food.inheritable_fields.values_list('id', flat=True))
parent.reset_inheritance(space=space_1)
def test_onhand(obj_1, u1_s1, u2_s1):
assert json.loads(u1_s1.get(reverse(DETAIL_URL, args={obj_1.id})).content)['food_onhand'] == False
assert json.loads(u2_s1.get(reverse(DETAIL_URL, args={obj_1.id})).content)['food_onhand'] == False
assert json.loads(u1_s1.get(reverse(DETAIL_URL, args={obj_1.id})).content)[
'food_onhand'] == False
assert json.loads(u2_s1.get(reverse(DETAIL_URL, args={obj_1.id})).content)[
'food_onhand'] == False
u1_s1.patch(
reverse(
@@ -574,10 +627,13 @@ def test_onhand(obj_1, u1_s1, u2_s1):
{'food_onhand': True},
content_type='application/json'
)
assert json.loads(u1_s1.get(reverse(DETAIL_URL, args={obj_1.id})).content)['food_onhand'] == True
assert json.loads(u2_s1.get(reverse(DETAIL_URL, args={obj_1.id})).content)['food_onhand'] == False
assert json.loads(u1_s1.get(reverse(DETAIL_URL, args={obj_1.id})).content)[
'food_onhand'] == True
assert json.loads(u2_s1.get(reverse(DETAIL_URL, args={obj_1.id})).content)[
'food_onhand'] == False
user1 = auth.get_user(u1_s1)
user2 = auth.get_user(u2_s1)
user1.userpreference.shopping_share.add(user2)
assert json.loads(u2_s1.get(reverse(DETAIL_URL, args={obj_1.id})).content)['food_onhand'] == True
assert json.loads(u2_s1.get(reverse(DETAIL_URL, args={obj_1.id})).content)[
'food_onhand'] == True

View File

@@ -1,20 +1,14 @@
import json
from datetime import timedelta
import factory
import pytest
# work around for bug described here https://stackoverflow.com/a/70312265/15762829
from django.conf import settings
from django.contrib import auth
from django.forms import model_to_dict
from django.urls import reverse
from django.utils import timezone
from django_scopes import scope, scopes_disabled
from pytest_factoryboy import LazyFixture, register
from django_scopes import scopes_disabled
from cookbook.models import Food, Ingredient, ShoppingListEntry, Step
from cookbook.tests.factories import (IngredientFactory, MealPlanFactory, RecipeFactory,
StepFactory, UserFactory)
from cookbook.models import Food, Ingredient
from cookbook.tests.factories import MealPlanFactory, RecipeFactory, StepFactory, UserFactory
if settings.DATABASES['default']['ENGINE'] in ['django.db.backends.postgresql_psycopg2',
'django.db.backends.postgresql']:
@@ -32,9 +26,12 @@ def user2(request, u1_s1):
except AttributeError:
params = {}
user = auth.get_user(u1_s1)
user.userpreference.mealplan_autoadd_shopping = params.get('mealplan_autoadd_shopping', True)
user.userpreference.mealplan_autoinclude_related = params.get('mealplan_autoinclude_related', True)
user.userpreference.mealplan_autoexclude_onhand = params.get('mealplan_autoexclude_onhand', True)
user.userpreference.mealplan_autoadd_shopping = params.get(
'mealplan_autoadd_shopping', True)
user.userpreference.mealplan_autoinclude_related = params.get(
'mealplan_autoinclude_related', True)
user.userpreference.mealplan_autoexclude_onhand = params.get(
'mealplan_autoexclude_onhand', True)
user.userpreference.save()
return u1_s1
@@ -50,7 +47,6 @@ def recipe(request, space_1, u1_s1):
return RecipeFactory(**params)
@pytest.mark.parametrize("arg", [
['g1_s1', 204],
['u1_s1', 204],
@@ -59,11 +55,14 @@ def recipe(request, space_1, u1_s1):
])
@pytest.mark.parametrize("recipe, sle_count", [
({}, 10),
({'steps__recipe_count': 1}, 20), # shopping list from recipe with StepRecipe
({'steps__food_recipe_count': {'step': 0, 'count': 1}}, 19), # shopping list from recipe with food recipe
({'steps__food_recipe_count': {'step': 0, 'count': 1}, 'steps__recipe_count': 1}, 29), # shopping list from recipe with StepRecipe and food recipe
# shopping list from recipe with StepRecipe
({'steps__recipe_count': 1}, 20),
# shopping list from recipe with food recipe
({'steps__food_recipe_count': {'step': 0, 'count': 1}}, 19),
# shopping list from recipe with StepRecipe and food recipe
({'steps__food_recipe_count': {'step': 0, 'count': 1}, 'steps__recipe_count': 1}, 29),
], indirect=['recipe'])
def test_shopping_recipe_method(request, arg, recipe, sle_count, u1_s1, u2_s1):
def test_shopping_recipe_method(request, arg, recipe, sle_count, u1_s1, u2_s1):
c = request.getfixturevalue(arg[0])
user = auth.get_user(c)
user.userpreference.mealplan_autoadd_shopping = True
@@ -78,16 +77,20 @@ def test_shopping_recipe_method(request, arg, recipe, sle_count, u1_s1, u2_s1):
if r.status_code == 204: # skip anonymous user
r = json.loads(c.get(reverse(SHOPPING_LIST_URL)).content)
assert len(r) == sle_count # recipe factory creates 10 ingredients by default
# recipe factory creates 10 ingredients by default
assert len(r) == sle_count
assert [x['created_by']['id'] for x in r].count(user.id) == sle_count
# user in space can't see shopping list
assert len(json.loads(u2_s1.get(reverse(SHOPPING_LIST_URL)).content)) == 0
assert len(json.loads(
u2_s1.get(reverse(SHOPPING_LIST_URL)).content)) == 0
user.userpreference.shopping_share.add(auth.get_user(u2_s1))
# after share, user in space can see shopping list
assert len(json.loads(u2_s1.get(reverse(SHOPPING_LIST_URL)).content)) == sle_count
assert len(json.loads(
u2_s1.get(reverse(SHOPPING_LIST_URL)).content)) == sle_count
# confirm that the author of the recipe doesn't have access to shopping list
if c != u1_s1:
assert len(json.loads(u1_s1.get(reverse(SHOPPING_LIST_URL)).content)) == 0
assert len(json.loads(
u1_s1.get(reverse(SHOPPING_LIST_URL)).content)) == 0
r = c.get(url)
assert r.status_code == 405
@@ -99,9 +102,12 @@ def test_shopping_recipe_method(request, arg, recipe, sle_count, u1_s1, u2_s1):
@pytest.mark.parametrize("recipe, sle_count", [
({}, 10),
({'steps__recipe_count': 1}, 20), # shopping list from recipe with StepRecipe
({'steps__food_recipe_count': {'step': 0, 'count': 1}}, 19), # shopping list from recipe with food recipe
({'steps__food_recipe_count': {'step': 0, 'count': 1}, 'steps__recipe_count': 1}, 29), # shopping list from recipe with StepRecipe and food recipe
# shopping list from recipe with StepRecipe
({'steps__recipe_count': 1}, 20),
# shopping list from recipe with food recipe
({'steps__food_recipe_count': {'step': 0, 'count': 1}}, 19),
# shopping list from recipe with StepRecipe and food recipe
({'steps__food_recipe_count': {'step': 0, 'count': 1}, 'steps__recipe_count': 1}, 29),
], indirect=['recipe'])
@pytest.mark.parametrize("use_mealplan", [(False), (True), ])
def test_shopping_recipe_edit(request, recipe, sle_count, use_mealplan, u1_s1, u2_s1):
@@ -115,31 +121,33 @@ def test_shopping_recipe_edit(request, recipe, sle_count, use_mealplan, u1_s1, u
user.userpreference.save()
if use_mealplan:
mealplan = MealPlanFactory(space=recipe.space, created_by=user, servings=recipe.servings, recipe=recipe)
mealplan = MealPlanFactory(
space=recipe.space, created_by=user, servings=recipe.servings, recipe=recipe)
else:
u1_s1.put(reverse(SHOPPING_RECIPE_URL, args={recipe.id}))
r = json.loads(u1_s1.get(reverse(SHOPPING_LIST_URL)).content)
assert [x['created_by']['id'] for x in r].count(user.id) == sle_count
all_ing = [x['ingredient'] for x in r]
keep_ing = all_ing[1:-1] # remove first and last element
del keep_ing[int(len(keep_ing)/2)] # remove a middle element
del keep_ing[int(len(keep_ing) / 2)] # remove a middle element
list_recipe = r[0]['list_recipe']
amount_sum = sum([x['amount'] for x in r])
# test modifying shopping list as different user
# test increasing servings size of recipe shopping list
if use_mealplan:
mealplan.servings = 2*recipe.servings
mealplan.servings = 2 * recipe.servings
mealplan.save()
else:
u2_s1.put(reverse(SHOPPING_RECIPE_URL, args={recipe.id}),
{'list_recipe': list_recipe, 'servings': 2*recipe.servings},
{'list_recipe': list_recipe, 'servings': 2 * recipe.servings},
content_type='application/json'
)
r = json.loads(u1_s1.get(reverse(SHOPPING_LIST_URL)).content)
assert sum([x['amount'] for x in r]) == amount_sum * 2
assert len(r) == sle_count
assert len(json.loads(u2_s1.get(reverse(SHOPPING_LIST_URL)).content)) == sle_count
assert len(json.loads(
u2_s1.get(reverse(SHOPPING_LIST_URL)).content)) == sle_count
# testing decreasing servings size of recipe shopping list
if use_mealplan:
@@ -153,7 +161,8 @@ def test_shopping_recipe_edit(request, recipe, sle_count, use_mealplan, u1_s1, u
r = json.loads(u1_s1.get(reverse(SHOPPING_LIST_URL)).content)
assert sum([x['amount'] for x in r]) == amount_sum * .5
assert len(r) == sle_count
assert len(json.loads(u2_s1.get(reverse(SHOPPING_LIST_URL)).content)) == sle_count
assert len(json.loads(
u2_s1.get(reverse(SHOPPING_LIST_URL)).content)) == sle_count
# test removing 3 items from shopping list
u2_s1.put(reverse(SHOPPING_RECIPE_URL, args={recipe.id}),
@@ -162,7 +171,8 @@ def test_shopping_recipe_edit(request, recipe, sle_count, use_mealplan, u1_s1, u
)
r = json.loads(u1_s1.get(reverse(SHOPPING_LIST_URL)).content)
assert len(r) == sle_count - 3
assert len(json.loads(u2_s1.get(reverse(SHOPPING_LIST_URL)).content)) == sle_count - 3
assert len(json.loads(
u2_s1.get(reverse(SHOPPING_LIST_URL)).content)) == sle_count - 3
# add all ingredients to existing shopping list - don't change serving size
u2_s1.put(reverse(SHOPPING_RECIPE_URL, args={recipe.id}),
@@ -172,14 +182,16 @@ def test_shopping_recipe_edit(request, recipe, sle_count, use_mealplan, u1_s1, u
r = json.loads(u1_s1.get(reverse(SHOPPING_LIST_URL)).content)
assert sum([x['amount'] for x in r]) == amount_sum * .5
assert len(r) == sle_count
assert len(json.loads(u2_s1.get(reverse(SHOPPING_LIST_URL)).content)) == sle_count
assert len(json.loads(
u2_s1.get(reverse(SHOPPING_LIST_URL)).content)) == sle_count
@pytest.mark.parametrize("user2, sle_count", [
({'mealplan_autoadd_shopping': False}, (0, 18)),
({'mealplan_autoinclude_related': False}, (9, 9)),
({'mealplan_autoexclude_onhand': False}, (20, 20)),
({'mealplan_autoexclude_onhand': False, 'mealplan_autoinclude_related': False}, (10, 10)),
({'mealplan_autoexclude_onhand': False,
'mealplan_autoinclude_related': False}, (10, 10)),
], indirect=['user2'])
@pytest.mark.parametrize("use_mealplan", [(False), (True), ])
@pytest.mark.parametrize("recipe", [({'steps__recipe_count': 1})], indirect=['recipe'])
@@ -191,20 +203,24 @@ def test_shopping_recipe_userpreference(recipe, sle_count, use_mealplan, user2):
food = Food.objects.get(id=ingredients[2].food.id)
food.onhand_users.add(user)
food.save()
food = recipe.steps.exclude(step_recipe=None).first().step_recipe.steps.first().ingredients.first().food
food = recipe.steps.exclude(step_recipe=None).first(
).step_recipe.steps.first().ingredients.first().food
food = Food.objects.get(id=food.id)
food.onhand_users.add(user)
food.save()
if use_mealplan:
mealplan = MealPlanFactory(space=recipe.space, created_by=user, servings=recipe.servings, recipe=recipe)
assert len(json.loads(user2.get(reverse(SHOPPING_LIST_URL)).content)) == sle_count[0]
MealPlanFactory(
space=recipe.space, created_by=user, servings=recipe.servings, recipe=recipe)
assert len(json.loads(
user2.get(reverse(SHOPPING_LIST_URL)).content)) == sle_count[0]
else:
user2.put(reverse(SHOPPING_RECIPE_URL, args={recipe.id}))
assert len(json.loads(user2.get(reverse(SHOPPING_LIST_URL)).content)) == sle_count[1]
assert len(json.loads(
user2.get(reverse(SHOPPING_LIST_URL)).content)) == sle_count[1]
def test_shopping_recipe_mixed_authors(u1_s1, u2_s1,space_1):
def test_shopping_recipe_mixed_authors(u1_s1, u2_s1, space_1):
with scopes_disabled():
user1 = auth.get_user(u1_s1)
user2 = auth.get_user(u2_s1)
@@ -213,15 +229,19 @@ def test_shopping_recipe_mixed_authors(u1_s1, u2_s1,space_1):
recipe1 = RecipeFactory(created_by=user1, space=space)
recipe2 = RecipeFactory(created_by=user2, space=space)
recipe3 = RecipeFactory(created_by=user3, space=space)
food = Food.objects.get(id=recipe1.steps.first().ingredients.first().food.id)
food = Food.objects.get(
id=recipe1.steps.first().ingredients.first().food.id)
food.recipe = recipe2
food.save()
recipe1.steps.add(StepFactory(step_recipe=recipe3, ingredients__count=0, space=space))
recipe1.steps.add(StepFactory(step_recipe=recipe3,
ingredients__count=0, space=space))
recipe1.save()
u1_s1.put(reverse(SHOPPING_RECIPE_URL, args={recipe1.id}))
assert len(json.loads(u1_s1.get(reverse(SHOPPING_LIST_URL)).content)) == 29
assert len(json.loads(u2_s1.get(reverse(SHOPPING_LIST_URL)).content)) == 0
assert len(json.loads(
u1_s1.get(reverse(SHOPPING_LIST_URL)).content)) == 29
assert len(json.loads(
u2_s1.get(reverse(SHOPPING_LIST_URL)).content)) == 0
@pytest.mark.parametrize("recipe", [{'steps__ingredients__header': 1}], indirect=['recipe'])
@@ -230,4 +250,5 @@ def test_shopping_with_header_ingredient(u1_s1, recipe):
# recipe.step_set.first().ingredient_set.add(IngredientFactory(ingredients__header=1))
u1_s1.put(reverse(SHOPPING_RECIPE_URL, args={recipe.id}))
assert len(json.loads(u1_s1.get(reverse(SHOPPING_LIST_URL)).content)) == 10
assert len(json.loads(u1_s1.get(reverse('api:ingredient-list')).content)['results']) == 11
assert len(json.loads(
u1_s1.get(reverse('api:ingredient-list')).content)['results']) == 11

View File

@@ -5,12 +5,11 @@ import uuid
import pytest
from django.contrib import auth
from django.contrib.auth.models import Group, User
from django_scopes import scopes_disabled
from pytest_factoryboy import LazyFixture, register
from pytest_factoryboy import register
from cookbook.models import Food, Ingredient, Recipe, Space, Step, Unit
from cookbook.tests.factories import FoodFactory, SpaceFactory, UserFactory
from cookbook.models import Food, Ingredient, Recipe, Step, Unit
from cookbook.tests.factories import SpaceFactory, UserFactory
register(SpaceFactory, 'space_1')
register(SpaceFactory, 'space_2')
@@ -60,8 +59,10 @@ def get_random_recipe(space_1, u1_s1):
internal=True,
)
s1 = Step.objects.create(name=str(uuid.uuid4()), instruction=str(uuid.uuid4()), space=space_1, )
s2 = Step.objects.create(name=str(uuid.uuid4()), instruction=str(uuid.uuid4()), space=space_1, )
s1 = Step.objects.create(name=str(uuid.uuid4()),
instruction=str(uuid.uuid4()), space=space_1, )
s2 = Step.objects.create(name=str(uuid.uuid4()),
instruction=str(uuid.uuid4()), space=space_1, )
r.steps.add(s1)
r.steps.add(s2)
@@ -70,8 +71,10 @@ def get_random_recipe(space_1, u1_s1):
s1.ingredients.add(
Ingredient.objects.create(
amount=1,
food=Food.objects.get_or_create(name=str(uuid.uuid4()), space=space_1)[0],
unit=Unit.objects.create(name=str(uuid.uuid4()), space=space_1, ),
food=Food.objects.get_or_create(
name=str(uuid.uuid4()), space=space_1)[0],
unit=Unit.objects.create(
name=str(uuid.uuid4()), space=space_1, ),
note=str(uuid.uuid4()),
space=space_1,
)
@@ -80,8 +83,10 @@ def get_random_recipe(space_1, u1_s1):
s2.ingredients.add(
Ingredient.objects.create(
amount=1,
food=Food.objects.get_or_create(name=str(uuid.uuid4()), space=space_1)[0],
unit=Unit.objects.create(name=str(uuid.uuid4()), space=space_1, ),
food=Food.objects.get_or_create(
name=str(uuid.uuid4()), space=space_1)[0],
unit=Unit.objects.create(
name=str(uuid.uuid4()), space=space_1, ),
note=str(uuid.uuid4()),
space=space_1,
)
@@ -99,8 +104,10 @@ def get_random_json_recipe():
{
"instruction": str(uuid.uuid4()),
"ingredients": [
{"food": {"name": str(uuid.uuid4())}, "unit": {"name": str(uuid.uuid4())}, "amount": random.randint(0, 10)},
{"food": {"name": str(uuid.uuid4())}, "unit": {"name": str(uuid.uuid4())}, "amount": random.randint(0, 10)},
{"food": {"name": str(uuid.uuid4())}, "unit": {"name": str(
uuid.uuid4())}, "amount": random.randint(0, 10)},
{"food": {"name": str(uuid.uuid4())}, "unit": {"name": str(
uuid.uuid4())}, "amount": random.randint(0, 10)},
],
}
],
@@ -133,7 +140,8 @@ def validate_recipe(expected, recipe):
for key in expected_lists:
for k in expected_lists[key]:
try:
print('comparing ', any([dict_compare(k, i) for i in target_lists[key]]))
print('comparing ', any([dict_compare(k, i)
for i in target_lists[key]]))
assert any([dict_compare(k, i) for i in target_lists[key]])
except AssertionError:
for result in [dict_compare(k, i, details=True) for i in target_lists[key]]:
@@ -152,7 +160,8 @@ def dict_compare(d1, d2, details=False):
added = d1_keys - d2_keys
removed = d2_keys - d1_keys
modified = {o: (d1[o], d2[o]) for o in not_dicts if d1[o] != d2[o]}
modified_dicts = {o: (d1[o], d2[o]) for o in sub_dicts if not d1[o].items() <= d2[o].items()}
modified_dicts = {o: (d1[o], d2[o])
for o in sub_dicts if not d1[o].items() <= d2[o].items()}
if details:
return added, removed, modified, modified_dicts
else:
@@ -173,12 +182,12 @@ def transpose(text, number=2):
positions = random.sample(range(len(tokens[token_pos])), number)
# swap the positions
l = list(tokens[token_pos])
lt = list(tokens[token_pos])
for first, second in zip(positions[::2], positions[1::2]):
l[first], l[second] = l[second], l[first]
lt[first], lt[second] = lt[second], lt[first]
# replace original tokens with swapped
tokens[token_pos] = ''.join(l)
tokens[token_pos] = ''.join(lt)
# return text with the swapped token
return ' '.join(tokens)

View File

@@ -4,13 +4,12 @@ from decimal import Decimal
import factory
import pytest
from django.contrib import auth
from django.contrib.auth.models import Group, User
from django_scopes import scopes_disabled
from faker import Factory as FakerFactory
from pytest_factoryboy import register
from cookbook.models import Recipe, Step, UserSpace
from cookbook.models import UserSpace
# this code will run immediately prior to creating the model object useful when you want a reverse relationship
# log = factory.RelatedFactory(
@@ -53,7 +52,8 @@ class SpaceFactory(factory.django.DjangoModelFactory):
class UserFactory(factory.django.DjangoModelFactory):
"""User factory."""
username = factory.LazyAttribute(lambda x: faker.simple_profile()['username'])
username = factory.LazyAttribute(
lambda x: faker.simple_profile()['username'])
first_name = factory.LazyAttribute(lambda x: faker.first_name())
last_name = factory.LazyAttribute(lambda x: faker.last_name())
email = factory.LazyAttribute(lambda x: faker.email())
@@ -65,7 +65,8 @@ class UserFactory(factory.django.DjangoModelFactory):
return
if extracted:
us = UserSpace.objects.create(space=self.space, user=self, active=True)
us = UserSpace.objects.create(
space=self.space, user=self, active=True)
us.groups.add(Group.objects.get(name=extracted))
@factory.post_generation
@@ -75,10 +76,12 @@ class UserFactory(factory.django.DjangoModelFactory):
if extracted:
for prefs in extracted:
self.userpreference[prefs] = extracted[prefs]/0 # intentionally break so it can be debugged later
# intentionally break so it can be debugged later
self.userpreference[prefs] = extracted[prefs] / 0
class Meta:
model = User
django_get_or_create = ('username', 'space',)
@register
@@ -98,18 +101,22 @@ class SupermarketCategoryFactory(factory.django.DjangoModelFactory):
class FoodFactory(factory.django.DjangoModelFactory):
"""Food factory."""
name = factory.LazyAttribute(lambda x: faker.sentence(nb_words=10)[:128])
plural_name = factory.LazyAttribute(lambda x: faker.sentence(nb_words=3, variable_nb_words=False))
plural_name = factory.LazyAttribute(
lambda x: faker.sentence(nb_words=3, variable_nb_words=False))
description = factory.LazyAttribute(lambda x: faker.sentence(nb_words=10))
supermarket_category = factory.Maybe(
factory.LazyAttribute(lambda x: x.has_category),
yes_declaration=factory.SubFactory(SupermarketCategoryFactory, space=factory.SelfAttribute('..space')),
factory.LazyAttribute(lambda x: x.has_category),
yes_declaration=factory.SubFactory(
SupermarketCategoryFactory, space=factory.SelfAttribute('..space')),
no_declaration=None
)
recipe = factory.Maybe(
factory.LazyAttribute(lambda x: x.has_recipe),
yes_declaration=factory.SubFactory('cookbook.tests.factories.RecipeFactory', space=factory.SelfAttribute('..space')),
factory.LazyAttribute(lambda x: x.has_recipe),
yes_declaration=factory.SubFactory(
'cookbook.tests.factories.RecipeFactory', space=factory.SelfAttribute('..space')),
no_declaration=None
)
path = factory.LazyAttribute(lambda x: faker.numerify(text='%###'))
space = factory.SubFactory(SpaceFactory)
@factory.post_generation
@@ -127,17 +134,19 @@ class FoodFactory(factory.django.DjangoModelFactory):
class Meta:
model = 'cookbook.Food'
django_get_or_create = ('name', 'plural_name', 'space',)
django_get_or_create = ('name', 'plural_name', 'path', 'space',)
@register
class RecipeBookFactory(factory.django.DjangoModelFactory):
"""RecipeBook factory."""
name = factory.LazyAttribute(lambda x: faker.sentence(nb_words=3, variable_nb_words=False))
name = factory.LazyAttribute(lambda x: faker.sentence(
nb_words=3, variable_nb_words=False))
description = factory.LazyAttribute(lambda x: faker.sentence(nb_words=10))
icon = None
# shared = factory.SubFactory(UserFactory, space=factory.SelfAttribute('..space'))
created_by = factory.SubFactory(UserFactory, space=factory.SelfAttribute('..space'))
created_by = factory.SubFactory(
UserFactory, space=factory.SelfAttribute('..space'))
filter = None
space = factory.SubFactory(SpaceFactory)
@@ -149,7 +158,8 @@ class RecipeBookFactory(factory.django.DjangoModelFactory):
@register
class RecipeBookEntryFactory(factory.django.DjangoModelFactory):
"""RecipeBookEntry factory."""
book = factory.SubFactory(RecipeBookFactory, space=factory.SelfAttribute('..recipe.space'))
book = factory.SubFactory(
RecipeBookFactory, space=factory.SelfAttribute('..recipe.space'))
recipe = None
class Meta:
@@ -173,7 +183,8 @@ class UnitFactory(factory.django.DjangoModelFactory):
@register
class KeywordFactory(factory.django.DjangoModelFactory):
"""Keyword factory."""
name = factory.LazyAttribute(lambda x: faker.sentence(nb_words=2, variable_nb_words=False))
name = factory.LazyAttribute(lambda x: faker.sentence(
nb_words=2, variable_nb_words=False))
# icon = models.CharField(max_length=16, blank=True, null=True)
description = factory.LazyAttribute(lambda x: faker.sentence(nb_words=10))
space = factory.SubFactory(SpaceFactory)
@@ -184,15 +195,17 @@ class KeywordFactory(factory.django.DjangoModelFactory):
class Meta:
model = 'cookbook.Keyword'
django_get_or_create = ('name', 'space',)
django_get_or_create = ('name', 'space')
exclude = ('num')
@register
class IngredientFactory(factory.django.DjangoModelFactory):
"""Ingredient factory."""
food = factory.SubFactory(FoodFactory, space=factory.SelfAttribute('..space'))
unit = factory.SubFactory(UnitFactory, space=factory.SelfAttribute('..space'))
food = factory.SubFactory(
FoodFactory, space=factory.SelfAttribute('..space'))
unit = factory.SubFactory(
UnitFactory, space=factory.SelfAttribute('..space'))
amount = factory.LazyAttribute(lambda x: faker.random_int(min=1, max=10))
note = factory.LazyAttribute(lambda x: faker.sentence(nb_words=8))
is_header = False
@@ -210,7 +223,8 @@ class MealTypeFactory(factory.django.DjangoModelFactory):
# icon =
color = factory.LazyAttribute(lambda x: faker.safe_hex_color())
default = False
created_by = factory.SubFactory(UserFactory, space=factory.SelfAttribute('..space'))
created_by = factory.SubFactory(
UserFactory, space=factory.SelfAttribute('..space'))
space = factory.SubFactory(SpaceFactory)
class Meta:
@@ -220,14 +234,18 @@ class MealTypeFactory(factory.django.DjangoModelFactory):
@register
class MealPlanFactory(factory.django.DjangoModelFactory):
recipe = factory.Maybe(
factory.LazyAttribute(lambda x: x.has_recipe),
yes_declaration=factory.SubFactory('cookbook.tests.factories.RecipeFactory', space=factory.SelfAttribute('..space')),
factory.LazyAttribute(lambda x: x.has_recipe),
yes_declaration=factory.SubFactory(
'cookbook.tests.factories.RecipeFactory', space=factory.SelfAttribute('..space')),
no_declaration=None
)
servings = factory.LazyAttribute(lambda x: Decimal(faker.random_int(min=1, max=1000)/100))
servings = factory.LazyAttribute(
lambda x: Decimal(faker.random_int(min=1, max=1000) / 100))
title = factory.LazyAttribute(lambda x: faker.sentence(nb_words=5))
created_by = factory.SubFactory(UserFactory, space=factory.SelfAttribute('..space'))
meal_type = factory.SubFactory(MealTypeFactory, space=factory.SelfAttribute('..space'))
created_by = factory.SubFactory(
UserFactory, space=factory.SelfAttribute('..space'))
meal_type = factory.SubFactory(
MealTypeFactory, space=factory.SelfAttribute('..space'))
note = factory.LazyAttribute(lambda x: faker.paragraph())
date = factory.LazyAttribute(lambda x: faker.future_date())
space = factory.SubFactory(SpaceFactory)
@@ -243,12 +261,14 @@ class MealPlanFactory(factory.django.DjangoModelFactory):
class ShoppingListRecipeFactory(factory.django.DjangoModelFactory):
name = factory.LazyAttribute(lambda x: faker.sentence(nb_words=5))
recipe = factory.Maybe(
factory.LazyAttribute(lambda x: x.has_recipe),
yes_declaration=factory.SubFactory('cookbook.tests.factories.RecipeFactory', space=factory.SelfAttribute('..space')),
factory.LazyAttribute(lambda x: x.has_recipe),
yes_declaration=factory.SubFactory(
'cookbook.tests.factories.RecipeFactory', space=factory.SelfAttribute('..space')),
no_declaration=None
)
servings = factory.LazyAttribute(lambda x: faker.random_int(min=1, max=10))
mealplan = factory.SubFactory(MealPlanFactory, space=factory.SelfAttribute('..space'))
mealplan = factory.SubFactory(
MealPlanFactory, space=factory.SelfAttribute('..space'))
space = factory.SubFactory(SpaceFactory)
class Params:
@@ -263,26 +283,33 @@ class ShoppingListEntryFactory(factory.django.DjangoModelFactory):
"""ShoppingListEntry factory."""
list_recipe = factory.Maybe(
factory.LazyAttribute(lambda x: x.has_mealplan),
yes_declaration=factory.SubFactory(ShoppingListRecipeFactory, space=factory.SelfAttribute('..space')),
factory.LazyAttribute(lambda x: x.has_mealplan),
yes_declaration=factory.SubFactory(
ShoppingListRecipeFactory, space=factory.SelfAttribute('..space')),
no_declaration=None
)
food = factory.SubFactory(FoodFactory, space=factory.SelfAttribute('..space'))
unit = factory.SubFactory(UnitFactory, space=factory.SelfAttribute('..space'))
food = factory.SubFactory(
FoodFactory, space=factory.SelfAttribute('..space'))
unit = factory.SubFactory(
UnitFactory, space=factory.SelfAttribute('..space'))
# # ingredient = factory.SubFactory(IngredientFactory)
amount = factory.LazyAttribute(lambda x: Decimal(faker.random_int(min=1, max=100))/10)
amount = factory.LazyAttribute(
lambda x: Decimal(faker.random_int(min=1, max=100)) / 10)
order = factory.Sequence(int)
checked = False
created_by = factory.SubFactory(UserFactory, space=factory.SelfAttribute('..space'))
created_by = factory.SubFactory(
UserFactory, space=factory.SelfAttribute('..space'))
created_at = factory.LazyAttribute(lambda x: faker.past_date())
completed_at = None
delay_until = None
space = factory.SubFactory(SpaceFactory)
@classmethod
def _create(cls, target_class, *args, **kwargs): # override create to prevent auto_add_now from changing the created_at date
# override create to prevent auto_add_now from changing the created_at date
def _create(cls, target_class, *args, **kwargs):
created_at = kwargs.pop('created_at', None)
obj = super(ShoppingListEntryFactory, cls)._create(target_class, *args, **kwargs)
obj = super(ShoppingListEntryFactory, cls)._create(
target_class, *args, **kwargs)
if created_at is not None:
obj.created_at = created_at
obj.save()
@@ -298,7 +325,8 @@ class ShoppingListEntryFactory(factory.django.DjangoModelFactory):
@register
class StepFactory(factory.django.DjangoModelFactory):
name = factory.LazyAttribute(lambda x: faker.sentence(nb_words=5))
instruction = factory.LazyAttribute(lambda x: ''.join(faker.paragraphs(nb=5)))
instruction = factory.LazyAttribute(
lambda x: ''.join(faker.paragraphs(nb=5)))
# TODO add optional recipe food, make dependent on recipe, make number of recipes a Params
ingredients__count = 10 # default number of ingredients to add
ingredients__header = 0
@@ -330,14 +358,16 @@ class StepFactory(factory.django.DjangoModelFactory):
for i in range(num_ing):
if num_food_recipe > 0:
has_recipe = True
num_food_recipe = num_food_recipe-1
num_food_recipe = num_food_recipe - 1
else:
has_recipe = False
self.ingredients.add(IngredientFactory(space=self.space, food__has_recipe=has_recipe))
self.ingredients.add(IngredientFactory(
space=self.space, food__has_recipe=has_recipe))
num_header = kwargs.get('header', 0)
if num_header > 0:
for i in range(num_header):
self.ingredients.add(IngredientFactory(food=None, unit=None, amount=0, is_header=True, space=self.space))
self.ingredients.add(IngredientFactory(
food=None, unit=None, amount=0, is_header=True, space=self.space))
elif extracted:
for ing in extracted:
self.ingredients.add(ing)
@@ -351,20 +381,27 @@ class RecipeFactory(factory.django.DjangoModelFactory):
name = factory.LazyAttribute(lambda x: faker.sentence(nb_words=7))
description = factory.LazyAttribute(lambda x: faker.sentence(nb_words=10))
servings = factory.LazyAttribute(lambda x: faker.random_int(min=1, max=20))
servings_text = factory.LazyAttribute(lambda x: faker.sentence(nb_words=1)) # TODO generate list of expected servings text that can be iterated through
# TODO generate list of expected servings text that can be iterated through
servings_text = factory.LazyAttribute(lambda x: faker.sentence(nb_words=1))
keywords__count = 5 # default number of keywords to generate
steps__count = 1 # default number of steps to create
steps__recipe_count = 0 # default number of step recipes to create
steps__food_recipe_count = {} # by default, don't create food recipes, to override {'steps__food_recipe_count': {'step': 0, 'count': 1}}
working_time = factory.LazyAttribute(lambda x: faker.random_int(min=0, max=360))
waiting_time = factory.LazyAttribute(lambda x: faker.random_int(min=0, max=360))
# by default, don't create food recipes, to override {'steps__food_recipe_count': {'step': 0, 'count': 1}}
steps__food_recipe_count = {}
working_time = factory.LazyAttribute(
lambda x: faker.random_int(min=0, max=360))
waiting_time = factory.LazyAttribute(
lambda x: faker.random_int(min=0, max=360))
internal = False
created_by = factory.SubFactory(UserFactory, space=factory.SelfAttribute('..space'))
created_at = factory.LazyAttribute(lambda x: faker.date_between_dates(date_start=date(2000, 1, 1), date_end=date(2020, 12, 31)))
created_by = factory.SubFactory(
UserFactory, space=factory.SelfAttribute('..space'))
created_at = factory.LazyAttribute(lambda x: faker.date_between_dates(
date_start=date(2000, 1, 1), date_end=date(2020, 12, 31)))
space = factory.SubFactory(SpaceFactory)
@classmethod
def _create(cls, target_class, *args, **kwargs): # override create to prevent auto_add_now from changing the created_at date
# override create to prevent auto_add_now from changing the created_at date
def _create(cls, target_class, *args, **kwargs):
created_at = kwargs.pop('created_at', None)
# updated_at = kwargs.pop('updated_at', None)
obj = super(RecipeFactory, cls)._create(target_class, *args, **kwargs)
@@ -401,11 +438,13 @@ class RecipeFactory(factory.django.DjangoModelFactory):
ing_recipe_count = 0
if food_recipe_count.get('step', None) == i:
ing_recipe_count = food_recipe_count.get('count', 0)
self.steps.add(StepFactory(space=self.space, ingredients__food_recipe_count=ing_recipe_count, ingredients__header=num_ing_headers))
num_ing_headers+-1
self.steps.add(StepFactory(
space=self.space, ingredients__food_recipe_count=ing_recipe_count, ingredients__header=num_ing_headers))
num_ing_headers + - 1
if num_recipe_steps > 0:
for j in range(num_recipe_steps):
self.steps.add(StepFactory(space=self.space, step_recipe__has_recipe=True, ingredients__count=0))
self.steps.add(StepFactory(
space=self.space, step_recipe__has_recipe=True, ingredients__count=0))
if extracted and (num_steps + num_recipe_steps == 0):
for step in extracted:
self.steps.add(step)
@@ -428,15 +467,18 @@ class RecipeFactory(factory.django.DjangoModelFactory):
@register
class CookLogFactory(factory.django.DjangoModelFactory):
"""CookLog factory."""
recipe = factory.SubFactory(RecipeFactory, space=factory.SelfAttribute('..space'))
created_by = factory.SubFactory(UserFactory, space=factory.SelfAttribute('..space'))
recipe = factory.SubFactory(
RecipeFactory, space=factory.SelfAttribute('..space'))
created_by = factory.SubFactory(
UserFactory, space=factory.SelfAttribute('..space'))
created_at = factory.LazyAttribute(lambda x: faker.date_this_decade())
rating = factory.LazyAttribute(lambda x: faker.random_int(min=1, max=5))
servings = factory.LazyAttribute(lambda x: faker.random_int(min=1, max=32))
space = factory.SubFactory(SpaceFactory)
@classmethod
def _create(cls, target_class, *args, **kwargs): # override create to prevent auto_add_now from changing the created_at date
# override create to prevent auto_add_now from changing the created_at date
def _create(cls, target_class, *args, **kwargs):
created_at = kwargs.pop('created_at', None)
obj = super(CookLogFactory, cls)._create(target_class, *args, **kwargs)
if created_at is not None:
@@ -451,13 +493,17 @@ class CookLogFactory(factory.django.DjangoModelFactory):
@register
class ViewLogFactory(factory.django.DjangoModelFactory):
"""ViewLog factory."""
recipe = factory.SubFactory(RecipeFactory, space=factory.SelfAttribute('..space'))
created_by = factory.SubFactory(UserFactory, space=factory.SelfAttribute('..space'))
created_at = factory.LazyAttribute(lambda x: faker.past_datetime(start_date='-365d'))
recipe = factory.SubFactory(
RecipeFactory, space=factory.SelfAttribute('..space'))
created_by = factory.SubFactory(
UserFactory, space=factory.SelfAttribute('..space'))
created_at = factory.LazyAttribute(
lambda x: faker.past_datetime(start_date='-365d'))
space = factory.SubFactory(SpaceFactory)
@classmethod
def _create(cls, target_class, *args, **kwargs): # override create to prevent auto_add_now from changing the created_at date
# override create to prevent auto_add_now from changing the created_at date
def _create(cls, target_class, *args, **kwargs):
created_at = kwargs.pop('created_at', None)
obj = super(ViewLogFactory, cls)._create(target_class, *args, **kwargs)
if created_at is not None:

View File

@@ -11,6 +11,11 @@ from cookbook.tests.factories import FoodFactory, RecipeFactory
# TODO returns recipes with all ingredients via child substitute
# TODO returns recipes with all ingredients via sibling substitute
if (Food.node_order_by):
node_location = 'sorted-child'
else:
node_location = 'last-child'
@pytest.fixture
def recipes(space_1):
@@ -19,7 +24,8 @@ def recipes(space_1):
@pytest.fixture
def makenow_recipe(request, space_1):
onhand_user = auth.get_user(request.getfixturevalue(request.param.get('onhand_users', 'u1_s1')))
onhand_user = auth.get_user(request.getfixturevalue(
request.param.get('onhand_users', 'u1_s1')))
recipe = RecipeFactory.create(space=space_1)
for food in Food.objects.filter(ingredient__step__recipe=recipe.id):
@@ -55,13 +61,16 @@ def test_makenow_ignoreshopping(recipes, makenow_recipe, user1, space_1):
request = type('', (object,), {'space': space_1, 'user': user1})()
search = RecipeSearch(request, makenow='true')
with scope(space=space_1):
food = Food.objects.filter(ingredient__step__recipe=makenow_recipe.id).first()
food = Food.objects.filter(
ingredient__step__recipe=makenow_recipe.id).first()
food.onhand_users.clear()
assert search.get_queryset(Recipe.objects.all()).count() == 0
food.ignore_shopping = True
food.save()
assert Food.objects.filter(ingredient__step__recipe=makenow_recipe.id, onhand_users__isnull=False).count() == 9
assert Food.objects.filter(ingredient__step__recipe=makenow_recipe.id, ignore_shopping=True).count() == 1
assert Food.objects.filter(
ingredient__step__recipe=makenow_recipe.id, onhand_users__isnull=False).count() == 9
assert Food.objects.filter(
ingredient__step__recipe=makenow_recipe.id, ignore_shopping=True).count() == 1
search = search.get_queryset(Recipe.objects.all())
assert search.count() == 1
assert search.first().id == makenow_recipe.id
@@ -74,13 +83,17 @@ def test_makenow_substitute(recipes, makenow_recipe, user1, space_1):
request = type('', (object,), {'space': space_1, 'user': user1})()
search = RecipeSearch(request, makenow='true')
with scope(space=space_1):
food = Food.objects.filter(ingredient__step__recipe=makenow_recipe.id).first()
food = Food.objects.filter(
ingredient__step__recipe=makenow_recipe.id).first()
onhand_user = food.onhand_users.first()
food.onhand_users.clear()
assert search.get_queryset(Recipe.objects.all()).count() == 0
food.substitute.add(FoodFactory.create(space=space_1, onhand_users=[onhand_user]))
assert Food.objects.filter(ingredient__step__recipe=makenow_recipe.id, onhand_users__isnull=False).count() == 9
assert Food.objects.filter(ingredient__step__recipe=makenow_recipe.id, substitute__isnull=False).count() == 1
food.substitute.add(FoodFactory.create(
space=space_1, onhand_users=[onhand_user]))
assert Food.objects.filter(
ingredient__step__recipe=makenow_recipe.id, onhand_users__isnull=False).count() == 9
assert Food.objects.filter(
ingredient__step__recipe=makenow_recipe.id, substitute__isnull=False).count() == 1
search = search.get_queryset(Recipe.objects.all())
assert search.count() == 1
@@ -94,16 +107,20 @@ def test_makenow_child_substitute(recipes, makenow_recipe, user1, space_1):
request = type('', (object,), {'space': space_1, 'user': user1})()
search = RecipeSearch(request, makenow='true')
with scope(space=space_1):
food = Food.objects.filter(ingredient__step__recipe=makenow_recipe.id).first()
food = Food.objects.filter(
ingredient__step__recipe=makenow_recipe.id).first()
onhand_user = food.onhand_users.first()
food.onhand_users.clear()
food.substitute_children = True
food.save()
assert search.get_queryset(Recipe.objects.all()).count() == 0
new_food = FoodFactory.create(space=space_1, onhand_users=[onhand_user])
new_food.move(food, 'first-child')
assert Food.objects.filter(ingredient__step__recipe=makenow_recipe.id, onhand_users__isnull=False).count() == 9
assert Food.objects.filter(ingredient__step__recipe=makenow_recipe.id, numchild__gt=0).count() == 1
new_food = FoodFactory.create(
space=space_1, onhand_users=[onhand_user])
new_food.move(food, node_location)
assert Food.objects.filter(
ingredient__step__recipe=makenow_recipe.id, onhand_users__isnull=False).count() == 9
assert Food.objects.filter(
ingredient__step__recipe=makenow_recipe.id, numchild__gt=0).count() == 1
search = search.get_queryset(Recipe.objects.all())
assert search.count() == 1
assert search.first().id == makenow_recipe.id
@@ -116,18 +133,22 @@ def test_makenow_sibling_substitute(recipes, makenow_recipe, user1, space_1):
request = type('', (object,), {'space': space_1, 'user': user1})()
search = RecipeSearch(request, makenow='true')
with scope(space=space_1):
food = Food.objects.filter(ingredient__step__recipe=makenow_recipe.id).first()
food = Food.objects.filter(
ingredient__step__recipe=makenow_recipe.id).first()
onhand_user = food.onhand_users.first()
food.onhand_users.clear()
food.substitute_siblings = True
food.save()
assert search.get_queryset(Recipe.objects.all()).count() == 0
new_parent = FoodFactory.create(space=space_1)
new_sibling = FoodFactory.create(space=space_1, onhand_users=[onhand_user])
new_sibling.move(new_parent, 'first-child')
food.move(new_parent, 'first-child')
assert Food.objects.filter(ingredient__step__recipe=makenow_recipe.id, onhand_users__isnull=False).count() == 9
assert Food.objects.filter(ingredient__step__recipe=makenow_recipe.id, depth=2).count() == 1
new_sibling = FoodFactory.create(
space=space_1, onhand_users=[onhand_user])
new_sibling.move(new_parent, node_location)
food.move(new_parent, node_location)
assert Food.objects.filter(
ingredient__step__recipe=makenow_recipe.id, onhand_users__isnull=False).count() == 9
assert Food.objects.filter(
ingredient__step__recipe=makenow_recipe.id, depth=2).count() == 1
search = search.get_queryset(Recipe.objects.all())
assert search.count() == 1
assert search.first().id == makenow_recipe.id

View File

@@ -7,9 +7,9 @@ from django.conf import settings
from django.contrib import auth
from django.urls import reverse
from django.utils import timezone
from django_scopes import scope, scopes_disabled
from django_scopes import scope
from cookbook.models import Food, Recipe, SearchFields
from cookbook.models import Recipe, SearchFields
from cookbook.tests.conftest import transpose
from cookbook.tests.factories import (CookLogFactory, FoodFactory, IngredientFactory,
KeywordFactory, RecipeBookEntryFactory, RecipeFactory,
@@ -23,7 +23,8 @@ from cookbook.tests.factories import (CookLogFactory, FoodFactory, IngredientFac
# TODO makenow with above filters
# TODO test search food/keywords including/excluding children
LIST_URL = 'api:recipe-list'
sqlite = settings.DATABASES['default']['ENGINE'] not in ['django.db.backends.postgresql_psycopg2', 'django.db.backends.postgresql']
sqlite = settings.DATABASES['default']['ENGINE'] not in [
'django.db.backends.postgresql_psycopg2', 'django.db.backends.postgresql']
@pytest.fixture
@@ -50,26 +51,43 @@ def user1(request, space_1, u1_s1, unaccent):
if params.get('fuzzy_lookups', False):
user.searchpreference.lookup = True
misspelled_result = 1
else:
user.searchpreference.lookup = False
if params.get('fuzzy_search', False):
user.searchpreference.trigram.set(SearchFields.objects.all())
misspelled_result = 1
else:
user.searchpreference.trigram.set([])
if params.get('icontains', False):
user.searchpreference.icontains.set(SearchFields.objects.all())
search_term = 'ghijklmn'
else:
user.searchpreference.icontains.set([])
if params.get('istartswith', False):
user.searchpreference.istartswith.set(SearchFields.objects.all())
search_term = 'abcdef'
else:
user.searchpreference.istartswith.set([])
if params.get('unaccent', False):
user.searchpreference.unaccent.set(SearchFields.objects.all())
misspelled_result *= 2
result *= 2
else:
user.searchpreference.unaccent.set([])
# full text vectors are hard coded to use unaccent - put this after unaccent to override result
if params.get('fulltext', False):
user.searchpreference.fulltext.set(SearchFields.objects.all())
# user.searchpreference.search = 'websearch'
search_term = 'ghijklmn uvwxyz'
result = 2
else:
user.searchpreference.fulltext.set([])
user.searchpreference.save()
misspelled_term = transpose(search_term, number=3)
return (u1_s1, result, misspelled_result, search_term, misspelled_term, params)
@@ -104,7 +122,8 @@ def found_recipe(request, space_1, accent, unaccent, u1_s1, u2_s1):
obj2 = FoodFactory.create(name=accent, space=space_1)
recipe1.steps.first().ingredients.add(IngredientFactory.create(food=obj1))
recipe2.steps.first().ingredients.add(IngredientFactory.create(food=obj2))
recipe3.steps.first().ingredients.add(IngredientFactory.create(food=obj1), IngredientFactory.create(food=obj2))
recipe3.steps.first().ingredients.add(IngredientFactory.create(
food=obj1), IngredientFactory.create(food=obj2))
if request.param.get('keyword', None):
obj1 = KeywordFactory.create(name=unaccent, space=space_1)
obj2 = KeywordFactory.create(name=accent, space=space_1)
@@ -125,7 +144,8 @@ def found_recipe(request, space_1, accent, unaccent, u1_s1, u2_s1):
obj2 = UnitFactory.create(name=accent, space=space_1)
recipe1.steps.first().ingredients.add(IngredientFactory.create(unit=obj1))
recipe2.steps.first().ingredients.add(IngredientFactory.create(unit=obj2))
recipe3.steps.first().ingredients.add(IngredientFactory.create(unit=obj1), IngredientFactory.create(unit=obj2))
recipe3.steps.first().ingredients.add(IngredientFactory.create(
unit=obj1), IngredientFactory.create(unit=obj2))
if request.param.get('name', None):
recipe1.name = unaccent
recipe2.name = accent
@@ -145,21 +165,32 @@ def found_recipe(request, space_1, accent, unaccent, u1_s1, u2_s1):
i2.save()
if request.param.get('viewedon', None):
ViewLogFactory.create(recipe=recipe1, created_by=user1, created_at=days_3, space=space_1)
ViewLogFactory.create(recipe=recipe2, created_by=user1, created_at=days_30, space=space_1)
ViewLogFactory.create(recipe=recipe3, created_by=user2, created_at=days_15, space=space_1)
ViewLogFactory.create(recipe=recipe1, created_by=user1,
created_at=days_3, space=space_1)
ViewLogFactory.create(recipe=recipe2, created_by=user1,
created_at=days_30, space=space_1)
ViewLogFactory.create(recipe=recipe3, created_by=user2,
created_at=days_15, space=space_1)
if request.param.get('cookedon', None):
CookLogFactory.create(recipe=recipe1, created_by=user1, created_at=days_3, space=space_1)
CookLogFactory.create(recipe=recipe2, created_by=user1, created_at=days_30, space=space_1)
CookLogFactory.create(recipe=recipe3, created_by=user2, created_at=days_15, space=space_1)
CookLogFactory.create(recipe=recipe1, created_by=user1,
created_at=days_3, space=space_1)
CookLogFactory.create(recipe=recipe2, created_by=user1,
created_at=days_30, space=space_1)
CookLogFactory.create(recipe=recipe3, created_by=user2,
created_at=days_15, space=space_1)
if request.param.get('timescooked', None):
CookLogFactory.create_batch(5, recipe=recipe1, created_by=user1, space=space_1)
CookLogFactory.create(recipe=recipe2, created_by=user1, space=space_1)
CookLogFactory.create_batch(3, recipe=recipe3, created_by=user2, space=space_1)
CookLogFactory.create_batch(
5, recipe=recipe1, created_by=user1, space=space_1)
CookLogFactory.create(recipe=recipe2, created_by=user1, space=space_1)
CookLogFactory.create_batch(
3, recipe=recipe3, created_by=user2, space=space_1)
if request.param.get('rating', None):
CookLogFactory.create(recipe=recipe1, created_by=user1, rating=5.0, space=space_1)
CookLogFactory.create(recipe=recipe2, created_by=user1, rating=1.0, space=space_1)
CookLogFactory.create(recipe=recipe3, created_by=user2, rating=3.0, space=space_1)
CookLogFactory.create(
recipe=recipe1, created_by=user1, rating=5.0, space=space_1)
CookLogFactory.create(
recipe=recipe2, created_by=user1, rating=1.0, space=space_1)
CookLogFactory.create(
recipe=recipe3, created_by=user2, rating=3.0, space=space_1)
return (recipe1, recipe2, recipe3, obj1, obj2, request.param)
@@ -188,7 +219,8 @@ def test_search_or_and_not(found_recipe, param_type, operator, recipes, u1_s1, s
assert found_recipe[1].id in [x['id'] for x in r['results']]
assert found_recipe[2].id in [x['id'] for x in r['results']]
r = json.loads(u1_s1.get(reverse(LIST_URL) + f'?{param1}&{param2}').content)
r = json.loads(u1_s1.get(reverse(LIST_URL) +
f'?{param1}&{param2}').content)
assert r['count'] == operator[1]
assert found_recipe[2].id in [x['id'] for x in r['results']]
@@ -203,7 +235,8 @@ def test_search_or_and_not(found_recipe, param_type, operator, recipes, u1_s1, s
assert found_recipe[1].id not in [x['id'] for x in r['results']]
assert found_recipe[2].id not in [x['id'] for x in r['results']]
r = json.loads(u1_s1.get(reverse(LIST_URL) + f'?{param1_not}&{param2_not}').content)
r = json.loads(u1_s1.get(reverse(LIST_URL) +
f'?{param1_not}&{param2_not}').content)
assert r['count'] == 10 + operator[2]
assert found_recipe[2].id not in [x['id'] for x in r['results']]
@@ -227,13 +260,14 @@ def test_search_units(found_recipe, recipes, u1_s1, space_1):
assert found_recipe[1].id in [x['id'] for x in r['results']]
assert found_recipe[2].id in [x['id'] for x in r['results']]
r = json.loads(u1_s1.get(reverse(LIST_URL) + f'?{param1}&{param2}').content)
r = json.loads(u1_s1.get(reverse(LIST_URL) +
f'?{param1}&{param2}').content)
assert r['count'] == 3
assert found_recipe[2].id in [x['id'] for x in r['results']]
@pytest.mark.skipif(sqlite, reason="requires PostgreSQL")
@pytest.mark.parametrize("user1", itertools.product(
@pytest.mark.parametrize("user1", itertools.product(
[
('fuzzy_search', True), ('fuzzy_search', False),
('fuzzy_lookups', True), ('fuzzy_lookups', False)
@@ -245,22 +279,26 @@ def test_search_units(found_recipe, recipes, u1_s1, space_1):
({'keyword': True}, 'keyword'),
({'food': True}, 'food'),
], indirect=['found_recipe'])
def test_fuzzy_lookup(found_recipe, recipes, param_type, user1, space_1):
def test_fuzzy_lookup(found_recipe, recipes, param_type, user1, space_1):
with scope(space=space_1):
list_url = f'api:{param_type}-list'
param1 = f"query={user1[3]}"
param2 = f"query={user1[4]}"
r = json.loads(user1[0].get(reverse(list_url) + f'?{param1}&limit=2').content)
assert len([x['id'] for x in r['results'] if x['id'] in [found_recipe[3].id, found_recipe[4].id]]) == user1[1]
r = json.loads(user1[0].get(reverse(list_url) +
f'?{param1}&limit=2').content)
assert len([x['id'] for x in r['results'] if x['id'] in [
found_recipe[3].id, found_recipe[4].id]]) == user1[1]
r = json.loads(user1[0].get(reverse(list_url) + f'?{param2}&limit=10').content)
assert len([x['id'] for x in r['results'] if x['id'] in [found_recipe[3].id, found_recipe[4].id]]) == user1[2]
r = json.loads(user1[0].get(reverse(list_url) +
f'?{param2}&limit=10').content)
assert len([x['id'] for x in r['results'] if x['id'] in [
found_recipe[3].id, found_recipe[4].id]]) == user1[2]
# commenting this out for general use - it is really slow
# it should be run on occasion to ensure everything still works
# @pytest.mark.skipif(sqlite and True, reason="requires PostgreSQL")
# @pytest.mark.parametrize("user1", itertools.product(
# @pytest.mark.parametrize("user1", itertools.product(
# [
# ('fuzzy_search', True), ('fuzzy_search', False),
# ('fulltext', True), ('fulltext', False),
@@ -276,29 +314,35 @@ def test_fuzzy_lookup(found_recipe, recipes, param_type, user1, space_1):
# ({'keyword': True}),
# ({'food': True}),
# ], indirect=['found_recipe'])
# def test_search_string(found_recipe, recipes, user1, space_1):
# # user array contains: user client, expected count of search, expected count of mispelled search, search string, mispelled search string, user search preferences
# def test_search_string(found_recipe, recipes, user1, space_1):
# with scope(space=space_1):
# param1 = f"query={user1[3]}"
# param2 = f"query={user1[4]}"
# r = json.loads(user1[0].get(reverse(LIST_URL) + f'?{param1}').content)
# assert len([x['id'] for x in r['results'] if x['id'] in [found_recipe[0].id, found_recipe[1].id]]) == user1[1]
# assert len([x['id'] for x in r['results'] if x['id'] in [
# found_recipe[0].id, found_recipe[1].id]]) == user1[1]
# r = json.loads(user1[0].get(reverse(LIST_URL) + f'?{param2}').content)
# assert len([x['id'] for x in r['results'] if x['id'] in [found_recipe[0].id, found_recipe[1].id]]) == user1[2]
# assert len([x['id'] for x in r['results'] if x['id'] in [
# found_recipe[0].id, found_recipe[1].id]]) == user1[2]
@pytest.mark.parametrize("found_recipe, param_type, result", [
({'viewedon': True}, 'viewedon', (1, 1)),
({'cookedon': True}, 'cookedon', (1, 1)),
({'createdon': True}, 'createdon', (2, 12)), # created dates are not filtered by user
({'createdon': True}, 'updatedon', (2, 12)), # updated dates are not filtered by user
# created dates are not filtered by user
({'createdon': True}, 'createdon', (2, 12)),
# updated dates are not filtered by user
({'createdon': True}, 'updatedon', (2, 12)),
], indirect=['found_recipe'])
def test_search_date(found_recipe, recipes, param_type, result, u1_s1, u2_s1, space_1):
# force updated_at to equal created_at datetime
with scope(space=space_1):
for recipe in Recipe.objects.all():
Recipe.objects.filter(id=recipe.id).update(updated_at=recipe.created_at)
Recipe.objects.filter(id=recipe.id).update(
updated_at=recipe.created_at)
date = (timezone.now() - timedelta(days=15)).strftime("%Y-%m-%d")
param1 = f"?{param_type}={date}"
@@ -321,34 +365,34 @@ def test_search_date(found_recipe, recipes, param_type, result, u1_s1, u2_s1, sp
assert found_recipe[2].id in [x['id'] for x in r['results']]
# TODO this is somehow screwed, probably the search itself, dont want to fix it for now
# @pytest.mark.parametrize("found_recipe, param_type", [
# ({'rating': True}, 'rating'),
# ({'timescooked': True}, 'timescooked'),
# ], indirect=['found_recipe'])
# def test_search_count(found_recipe, recipes, param_type, u1_s1, u2_s1, space_1):
# param1 = f'?{param_type}=3'
# param2 = f'?{param_type}=-3'
# param3 = f'?{param_type}=0'
#
# r = json.loads(u1_s1.get(reverse(LIST_URL) + param1).content)
# assert r['count'] == 1
# assert found_recipe[0].id in [x['id'] for x in r['results']]
#
# r = json.loads(u1_s1.get(reverse(LIST_URL) + param2).content)
# assert r['count'] == 1
# assert found_recipe[1].id in [x['id'] for x in r['results']]
#
# # test search for not rated/cooked
# r = json.loads(u1_s1.get(reverse(LIST_URL) + param3).content)
# assert r['count'] == 11
# assert (found_recipe[0].id or found_recipe[1].id) not in [x['id'] for x in r['results']]
#
# # test matched returns for lte and gte searches
# r = json.loads(u2_s1.get(reverse(LIST_URL) + param1).content)
# assert r['count'] == 1
# assert found_recipe[2].id in [x['id'] for x in r['results']]
#
# r = json.loads(u2_s1.get(reverse(LIST_URL) + param2).content)
# assert r['count'] == 1
# assert found_recipe[2].id in [x['id'] for x in r['results']]
@pytest.mark.parametrize("found_recipe, param_type", [
({'rating': True}, 'rating'),
({'timescooked': True}, 'timescooked'),
], indirect=['found_recipe'])
def test_search_count(found_recipe, recipes, param_type, u1_s1, u2_s1, space_1):
param1 = f'?{param_type}=3'
param2 = f'?{param_type}=-3'
param3 = f'?{param_type}=0'
r = json.loads(u1_s1.get(reverse(LIST_URL) + param1).content)
assert r['count'] == 1
assert found_recipe[0].id in [x['id'] for x in r['results']]
r = json.loads(u1_s1.get(reverse(LIST_URL) + param2).content)
assert r['count'] == 1
assert found_recipe[1].id in [x['id'] for x in r['results']]
# test search for not rated/cooked
r = json.loads(u1_s1.get(reverse(LIST_URL) + param3).content)
assert r['count'] == 11
assert (found_recipe[0].id or found_recipe[1].id) not in [
x['id'] for x in r['results']]
# test matched returns for lte and gte searches
r = json.loads(u2_s1.get(reverse(LIST_URL) + param1).content)
assert r['count'] == 1
assert found_recipe[2].id in [x['id'] for x in r['results']]
r = json.loads(u2_s1.get(reverse(LIST_URL) + param2).content)
assert r['count'] == 1
assert found_recipe[2].id in [x['id'] for x in r['results']]

View File

@@ -1,6 +1,7 @@
import io
import json
import mimetypes
import pathlib
import re
import threading
import traceback
@@ -56,7 +57,7 @@ from cookbook.helper.permission_helper import (CustomIsAdmin, CustomIsOwner,
CustomIsSpaceOwner, CustomIsUser, group_required,
is_space_owner, switch_user_active_space, above_space_limit, CustomRecipePermission, CustomUserPermission, CustomTokenHasReadWriteScope, CustomTokenHasScope, has_group_permission)
from cookbook.helper.recipe_search import RecipeFacet, RecipeSearch
from cookbook.helper.recipe_url_import import get_from_youtube_scraper, get_images_from_soup
from cookbook.helper.recipe_url_import import get_from_youtube_scraper, get_images_from_soup, clean_dict
from cookbook.helper.scrapers.scrapers import text_scraper
from cookbook.helper.shopping_helper import RecipeShoppingEditor, shopping_helper
from cookbook.models import (Automation, BookmarkletImport, CookLog, CustomFilter, ExportLog, Food,
@@ -87,7 +88,7 @@ from cookbook.serializer import (AutomationSerializer, BookmarkletImportListSeri
SupermarketCategorySerializer, SupermarketSerializer,
SyncLogSerializer, SyncSerializer, UnitSerializer,
UserFileSerializer, UserSerializer, UserPreferenceSerializer,
UserSpaceSerializer, ViewLogSerializer, AccessTokenSerializer)
UserSpaceSerializer, ViewLogSerializer, AccessTokenSerializer, FoodSimpleSerializer, RecipeExportSerializer)
from cookbook.views.import_export import get_integration
from recipes import settings
@@ -533,6 +534,11 @@ class FoodViewSet(viewsets.ModelViewSet, TreeMixin):
.prefetch_related('onhand_users', 'inherit_fields', 'child_inherit_fields', 'substitute') \
.select_related('recipe', 'supermarket_category')
def get_serializer_class(self):
if self.request and self.request.query_params.get('simple', False):
return FoodSimpleSerializer
return self.serializer_class
@decorators.action(detail=True, methods=['PUT'], serializer_class=FoodShoppingUpdateSerializer, )
# TODO DRF only allows one action in a decorator action without overriding get_operation_id_base() this should be PUT and DELETE probably
def shopping(self, request, pk):
@@ -655,7 +661,7 @@ class IngredientViewSet(viewsets.ModelViewSet):
def get_serializer_class(self):
if self.request and self.request.query_params.get('simple', False):
return IngredientSimpleSerializer
return IngredientSerializer
return self.serializer_class
def get_queryset(self):
queryset = self.queryset.filter(step__recipe__space=self.request.space)
@@ -1169,6 +1175,18 @@ def recipe_from_source(request):
# 'recipe_html': '',
'recipe_images': [],
}, status=status.HTTP_200_OK)
if re.match('^(.)*/view/recipe/[0-9]+/[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$', url):
recipe_json = requests.get(url.replace('/view/recipe/', '/api/recipe/').replace(re.split('/view/recipe/[0-9]+', url)[1], '') + '?share=' + re.split('/view/recipe/[0-9]+', url)[1].replace('/', '')).json()
recipe_json = clean_dict(recipe_json, 'id')
serialized_recipe = RecipeExportSerializer(data=recipe_json, context={'request': request})
if serialized_recipe.is_valid():
recipe = serialized_recipe.save()
recipe.image = File(handle_image(request, File(io.BytesIO(requests.get(recipe_json['image']).content), name='image'), filetype=pathlib.Path(recipe_json['image']).suffix),
name=f'{uuid.uuid4()}_{recipe.pk}{pathlib.Path(recipe_json["image"]).suffix}')
recipe.save()
return Response({
'link': request.build_absolute_uri(reverse('view_recipe', args={recipe.pk}))
}, status=status.HTTP_201_CREATED)
else:
try:
if validators.url(url, public=True):
@@ -1383,17 +1401,17 @@ def sync_all(request):
return redirect('list_recipe_import')
@api_view(['GET'])
# @schema(AutoSchema()) #TODO add proper schema
@permission_classes([CustomIsUser & CustomTokenHasReadWriteScope])
def share_link(request, pk):
if request.user.is_authenticated:
if request.space.allow_sharing and has_group_permission(request.user, ('user',)):
recipe = get_object_or_404(Recipe, pk=pk, space=request.space)
link = ShareLink.objects.create(recipe=recipe, created_by=request.user, space=request.space)
return JsonResponse({'pk': pk, 'share': link.uuid,
'link': request.build_absolute_uri(reverse('view_recipe', args=[pk, link.uuid]))})
else:
return JsonResponse({'error': 'sharing_disabled'}, status=403)
return JsonResponse({'error': 'not_authenticated'}, status=403)
if request.space.allow_sharing and has_group_permission(request.user, ('user',)):
recipe = get_object_or_404(Recipe, pk=pk, space=request.space)
link = ShareLink.objects.create(recipe=recipe, created_by=request.user, space=request.space)
return JsonResponse({'pk': pk, 'share': link.uuid,
'link': request.build_absolute_uri(reverse('view_recipe', args=[pk, link.uuid]))})
else:
return JsonResponse({'error': 'sharing_disabled'}, status=403)
@group_required('user')

View File

@@ -69,25 +69,28 @@ def space_overview(request):
if request.POST:
create_form = SpaceCreateForm(request.POST, prefix='create')
join_form = SpaceJoinForm(request.POST, prefix='join')
if create_form.is_valid():
created_space = Space.objects.create(
name=create_form.cleaned_data['name'],
created_by=request.user,
max_file_storage_mb=settings.SPACE_DEFAULT_MAX_FILES,
max_recipes=settings.SPACE_DEFAULT_MAX_RECIPES,
max_users=settings.SPACE_DEFAULT_MAX_USERS,
allow_sharing=settings.SPACE_DEFAULT_ALLOW_SHARING,
)
if settings.HOSTED and request.user.username == 'demo':
messages.add_message(request, messages.WARNING, _('This feature is not available in the demo version!'))
else:
if create_form.is_valid():
created_space = Space.objects.create(
name=create_form.cleaned_data['name'],
created_by=request.user,
max_file_storage_mb=settings.SPACE_DEFAULT_MAX_FILES,
max_recipes=settings.SPACE_DEFAULT_MAX_RECIPES,
max_users=settings.SPACE_DEFAULT_MAX_USERS,
allow_sharing=settings.SPACE_DEFAULT_ALLOW_SHARING,
)
user_space = UserSpace.objects.create(space=created_space, user=request.user, active=False)
user_space.groups.add(Group.objects.filter(name='admin').get())
user_space = UserSpace.objects.create(space=created_space, user=request.user, active=False)
user_space.groups.add(Group.objects.filter(name='admin').get())
messages.add_message(request, messages.SUCCESS,
_('You have successfully created your own recipe space. Start by adding some recipes or invite other people to join you.'))
return HttpResponseRedirect(reverse('view_switch_space', args=[user_space.space.pk]))
messages.add_message(request, messages.SUCCESS,
_('You have successfully created your own recipe space. Start by adding some recipes or invite other people to join you.'))
return HttpResponseRedirect(reverse('view_switch_space', args=[user_space.space.pk]))
if join_form.is_valid():
return HttpResponseRedirect(reverse('view_invite', args=[join_form.cleaned_data['token']]))
if join_form.is_valid():
return HttpResponseRedirect(reverse('view_invite', args=[join_form.cleaned_data['token']]))
else:
if settings.SOCIAL_DEFAULT_ACCESS and len(request.user.userspace_set.all()) == 0:
user_space = UserSpace.objects.create(space=Space.objects.first(), user=request.user, active=False)

View File

@@ -1,5 +1,5 @@
There are several questions and issues that come up from time to time. Here are some answers.
Please note that the existence of some questions is due the application not being perfect in some parts.
There are several questions and issues that come up from time to time, here are some answers:
please note that the existence of some questions is due the application not being perfect in some parts.
Many of those shortcomings are planned to be fixed in future release but simply could not be addressed yet due to time limits.
## Is there a Tandoor app?
@@ -22,14 +22,14 @@ Open Tandoor, open the menu behind the three vertical dots at the top right, sel
Open Tandoor, open the menu behind the three horizontal dots at the top right, select `Apps > Install Tandoor Recipes`
## Why is Tandoor not working correctly?
If you just set up your Tandoor instance and you're having issues like...
If you just set up your Tandoor instance and you're having issues like;
- Links not working
- CSRF errors
- CORS errors
- No recipes are loading
... then make sure, that you have set [all required headers](install/docker.md#required-headers) in your reverse proxy correctly.
then make sure you have set [all required headers](install/docker.md#required-headers) in your reverse proxy correctly.
If that doesn't fix it, you can also refer to the appropriate sub section in the [reverse proxy documentation](install/docker.md#reverse-proxy) and verify your general webserver configuration.
## Why am I getting CSRF Errors?
@@ -62,7 +62,7 @@ The markdown renderer follows this markdown specification https://daringfireball
Please refer to [here](install/docker.md#setup-issues-on-raspberry-pi).
## How can I create users?
To create a new user click on your name (top right corner) and select 'space settings'. There under invites click create.
To create a new user click on your name (top right corner) and select 'space settings'. Click create listed below invites.
It is not possible to create users through the admin because users must be assigned a default group and space.
@@ -72,8 +72,8 @@ If you use an external auth provider or proxy authentication make sure to specif
environment configuration.
## What are spaces?
Spaces are a feature used to separate one installation of Tandoor into several parts.
In technical terms it is a multi tenant system.
Spaces are is a type of feature used to separate one installation of Tandoor into several parts.
In technical terms it is a multi-tenant system.
You can compare a space to something like google drive or dropbox.
There is only one installation of the Dropbox system, but it handles multiple users without them noticing each other.
@@ -83,7 +83,7 @@ If you want to host the collection of your friends, family, or neighbor you can
Sharing between spaces is currently not possible but is planned for future releases.
## How can I reset passwords?
To reset a lost password if access to the container is lost you need to
To reset a lost password if access to the container is lost you need to:
1. execute into the container using `docker-compose exec web_recipes sh`
2. activate the virtual environment `source venv/bin/activate`
@@ -95,3 +95,14 @@ To create a superuser you need to
1. execute into the container using `docker-compose exec web_recipes sh`
2. activate the virtual environment `source venv/bin/activate`
3. run `python manage.py createsuperuser` and follow the steps shown.
## Why cant I get support for my manual setup?
Even tough I would love to help everyone get tandoor up and running I have only so much time
that I can spend on this project besides work, family and other life things.
Due to the countless problems that can occur when manually installing I simply do not have
the time to help solving each one.
You can install Tandoor manually but please do not expect me or anyone to help you with that.
As a general advice: If you do it manually do NOT change anything at first and slowly work yourself
to your dream setup.

View File

@@ -96,6 +96,7 @@ AUTH_LDAP_USER_SEARCH_FILTER_STR=(uid=%(user)s)
AUTH_LDAP_USER_ATTR_MAP={'first_name': 'givenName', 'last_name': 'sn', 'email': 'mail'}
AUTH_LDAP_ALWAYS_UPDATE_USER=1
AUTH_LDAP_CACHE_TIMEOUT=3600
AUTH_LDAP_START_TLS=1
AUTH_LDAP_TLS_CACERTFILE=/etc/ssl/certs/own-ca.pem
```

View File

@@ -31,6 +31,7 @@ Overview of the capabilities of the different integrations.
| ChefTap | ✔️ | ❌ | ❌ |
| Pepperplate | ✔️ | ⌚ | ❌ |
| RecipeSage | ✔️ | ✔️ | ✔️ |
| Rezeptsuite.de | ✔️ | ❌ | ✔️ |
| Domestica | ✔️ | ⌚ | ✔️ |
| MealMaster | ✔️ | ❌ | ❌ |
| RezKonv | ✔️ | ❌ | ❌ |
@@ -177,7 +178,7 @@ This zip file can simply be imported into Tandoor.
OpenEats does not provide any way to export the data using the interface. Luckily it is relatively easy to export it from the command line.
You need to run the command `python manage.py dumpdata recipe ingredient` inside of the application api container.
If you followed the default installation method you can use the following command `docker-compose -f docker-prod.yml run --rm --entrypoint 'sh' api ./manage.py dumpdata recipe ingredient`.
This command might also work `docker exec -it openeats_api_1 ./manage.py dumpdata recipe ingredient > recipe_ingredients.json`
This command might also work `docker exec -it openeats_api_1 ./manage.py dumpdata recipe ingredient rating recipe_groups > recipe_ingredients.json`
Store the outputted json string in a `.json` file and simply import it using the importer. The file should look something like this
```json
@@ -215,6 +216,8 @@ Store the outputted json string in a `.json` file and simply import it using the
```
To import your images you'll need to create the folder `openeats-import` in your Tandoor's `recipes` media folder (which is usually found inside `/opt/recipes/mediafiles`). After that you'll need to copy the `/code/site-media/upload` folder from the openeats API docker container to the `openeats` folder you created. You should now have the file path `/opt/recipes/mediafiles/recipes/openeats-import/upload/...` in Tandoor.
## Plantoeat
Plan to eat allows you to export a text file containing all your recipes. Simply upload that text file to Tandoor to import all recipes
@@ -233,6 +236,9 @@ Cookmate allows you to export a `.mcb` file which you can simply upload to tando
## RecetteTek
RecetteTek exports are `.rtk` files which can simply be uploaded to tandoor to import all your recipes.
## Rezeptsuite.de
Rezeptsuite.de exports are `.xml` files which can simply be uploaded to tandoor to import all your recipes.
## Melarecipes
Melarecipes provides multiple export formats but only the `MelaRecipes` format can export the complete collection.

View File

@@ -49,7 +49,7 @@ spec:
secretKeyRef:
name: recipes
key: postgresql-postgres-password
image: vabene1111/recipes:1.0.1
image: vabene1111/recipes
imagePullPolicy: Always
resources:
requests:
@@ -110,7 +110,7 @@ spec:
subPath: nginx-config
readOnly: true
- name: recipes
image: vabene1111/recipes:1.0.1
image: vabene1111/recipes
imagePullPolicy: IfNotPresent
command:
- /opt/recipes/venv/bin/gunicorn
@@ -159,6 +159,8 @@ spec:
secretKeyRef:
name: recipes
key: secret-key
- name: GUNICORN_MEDIA
value: "0"
- name: DB_ENGINE
value: django.db.backends.postgresql_psycopg2
- name: POSTGRES_HOST

View File

@@ -61,6 +61,14 @@ The deployment first fires up a init container to do the database migrations and
The deployment then runs two containers, the recipes-nginx and the recipes container which runs the gunicorn app. The nginx container gets it's nginx.conf via config map to deliver static content `/static` and `/media`. The guincorn container gets it's secret key and the database password from the secret `recipes`. `gunicorn` runs as user `nobody`.
Currently, this deployment is using the `latest` image. You may want to explicitly set the tag, e.g.
~~~
image: vabene1111/recipes:1.4.7
~~~
It is **extremely important** to use the same image in both the initialization `init-chmod-data` and the main `recipes` containers.
### 60-service.yaml
Creating the app service.
@@ -91,7 +99,9 @@ I don't know how this check works, but this warning is simply wrong! ;-) Media a
## Updates
These manifests are tested against Release 1.0.1. Newer versions may not work without changes.
These manifests have been tested for several releases. Newer versions may not work without changes.
If everything works as expected, the `init-chmod-data` initialization container performs the database migration and the update procedure is transparent. However, it is recommended to use specific tags to increase stability and avoid unnecessary migrations.
## Apply the manifets

50
docs/install/wsl.md Normal file
View File

@@ -0,0 +1,50 @@
# Ubuntu Installation on Windows (WSL) and Docker Desktop
Install Docker from https://docs.docker.com/desktop/install/windows-install/
Be sure to select the Use WSL 2 instead of Hyper-V option on the configuration page when prompted
Follow the instructions to install Tandoor on Docker. Tandoor installation instructions using Docker is gotten from https://docs.tandoor.dev/install/docker/
You may get the error below if you are using Docker Desktop:
/usr/bin/docker-credential-desktop.exe: Invalid argument
This indicates that Docker Compose is not able to pull authentication credentials that are needed to pull recipe files.
Run the command:
export DOCKER_CONFIG=/non-existent-directory
"non-existent-directory" could be an arbitrary directory of your choosing. It could be empty,
we are just giving docker a file to point to. You can create a credentials file at a later date to add security to your application.
After you run the command docker-compose up -d, you may encounter an error similar to the one below:
fixing permissions on existing directory /var/lib/postgresql/data ... 2023-03-01T15:38:27.140501700Z chmod: /var/lib/postgresql/data: Operation not permitted
This indicates that the postgresql user 'postgres' does not have the necessary permissions to
change the permissions of the /var/lib/postgresql/data directory.
Note: This issue does not occuer in the Powershell terminal, so it might be easier to install Tandoor in powershell and continue development using WSL.
Steps to fix this error:
Since the permissions have to be changed within the docker container, we will need to create a file that runs as soon as the container starts up. This container will change the permissions of the /var/lib/postgresql/data directory before the db_recipes-1 container is started up. This container sets up the database to accept connections.
Docker allows us to set up an entrypoint in the docker-compose.yml file. This is where we will set the commands to change the permissions of the postgres user.
Steps to set up entry-point file:
1. Create a new file docker-entrypoint.sh in the same directory as your docker-compose.yml file. This will be a bash file.
2. Add the following commands to the file
a. #!/bin/sh (This is called a shebang. It tells the OS the shell to use which is the sh shell in this case)
b. chmod 777 /var/lib/postgresql/data (Gives read, write and execute permissions on the directory to all users, you may change these permissions as you wish)
c. exec “@” (Runs the script with the commands above)
Your folder structure should look like this with docker-compose.yml and docker-entrypoint.sh in the same directory:
![image](https://user-images.githubusercontent.com/100102599/225214709-322417a1-1cab-47a6-83dd-555a4234e72a.png)
The docker-entrypoint.sh file should look like this:
![image](https://user-images.githubusercontent.com/100102599/225214795-102c9e53-b790-498a-a6d6-ad0bcc980b2f.png)
3. Open the docker-compose.yml file
4. Add an entrypoint configuration to the db_recipes service
entrypoint:
- docker-entrypoint.sh
This command makes sure that the docker-entrypoint.sh file is run first before the db_recipes services is started. Using this, we set the database user permission before they are needed, so it gets rid of the error.
Your docker-compose.yml file should look like this:
![image](https://user-images.githubusercontent.com/100102599/225214865-869c9b24-61cf-4069-aa98-a7e18a165105.png)
5. Run docker-compose up -d, all the containers should run!

View File

@@ -33,6 +33,7 @@ nav:
- Synology: install/synology.md
- Kubernetes: install/kubernetes.md
- KubeSail or PiBox: install/kubesail.md
- WSL: install/wsl.md
- Manual: install/manual.md
- Other setups: install/other.md
- Features:

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-01-19 19:14+0100\n"
"POT-Creation-Date: 2023-04-26 07:46+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -18,62 +18,66 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: .\recipes\settings.py:382
#: .\recipes\settings.py:436
msgid "Armenian "
msgstr ""
#: .\recipes\settings.py:383
#: .\recipes\settings.py:437
msgid "Bulgarian"
msgstr ""
#: .\recipes\settings.py:384
#: .\recipes\settings.py:438
msgid "Catalan"
msgstr ""
#: .\recipes\settings.py:385
#: .\recipes\settings.py:439
msgid "Czech"
msgstr ""
#: .\recipes\settings.py:386
#: .\recipes\settings.py:440
msgid "Danish"
msgstr ""
#: .\recipes\settings.py:387
#: .\recipes\settings.py:441
msgid "Dutch"
msgstr ""
#: .\recipes\settings.py:388
#: .\recipes\settings.py:442
msgid "English"
msgstr ""
#: .\recipes\settings.py:389
#: .\recipes\settings.py:443
msgid "French"
msgstr ""
#: .\recipes\settings.py:390
#: .\recipes\settings.py:444
msgid "German"
msgstr ""
#: .\recipes\settings.py:391
#: .\recipes\settings.py:445
msgid "Hungarian"
msgstr ""
#: .\recipes\settings.py:446
msgid "Italian"
msgstr ""
#: .\recipes\settings.py:392
#: .\recipes\settings.py:447
msgid "Latvian"
msgstr ""
#: .\recipes\settings.py:393
#: .\recipes\settings.py:448
msgid "Polish"
msgstr ""
#: .\recipes\settings.py:394
#: .\recipes\settings.py:449
msgid "Russian"
msgstr ""
#: .\recipes\settings.py:395
#: .\recipes\settings.py:450
msgid "Spanish"
msgstr ""
#: .\recipes\settings.py:396
#: .\recipes\settings.py:451
msgid "Swedish"
msgstr ""

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-01-19 19:14+0100\n"
"POT-Creation-Date: 2023-04-26 07:46+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -18,64 +18,68 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: .\recipes\settings.py:382
#: .\recipes\settings.py:436
msgid "Armenian "
msgstr ""
#: .\recipes\settings.py:383
#: .\recipes\settings.py:437
msgid "Bulgarian"
msgstr ""
#: .\recipes\settings.py:384
#: .\recipes\settings.py:438
msgid "Catalan"
msgstr ""
#: .\recipes\settings.py:385
#: .\recipes\settings.py:439
msgid "Czech"
msgstr ""
#: .\recipes\settings.py:386
#: .\recipes\settings.py:440
msgid "Danish"
msgstr ""
#: .\recipes\settings.py:387
#: .\recipes\settings.py:441
msgid "Dutch"
msgstr ""
#: .\recipes\settings.py:388
#: .\recipes\settings.py:442
msgid "English"
msgstr "Englisch"
#: .\recipes\settings.py:389
#: .\recipes\settings.py:443
msgid "French"
msgstr ""
#: .\recipes\settings.py:390
#: .\recipes\settings.py:444
msgid "German"
msgstr "Deutsch"
#: .\recipes\settings.py:391
#: .\recipes\settings.py:445
msgid "Hungarian"
msgstr ""
#: .\recipes\settings.py:446
msgid "Italian"
msgstr ""
#: .\recipes\settings.py:392
#: .\recipes\settings.py:447
msgid "Latvian"
msgstr ""
#: .\recipes\settings.py:393
#: .\recipes\settings.py:448
#, fuzzy
#| msgid "English"
msgid "Polish"
msgstr "Englisch"
#: .\recipes\settings.py:394
#: .\recipes\settings.py:449
msgid "Russian"
msgstr ""
#: .\recipes\settings.py:395
#: .\recipes\settings.py:450
msgid "Spanish"
msgstr ""
#: .\recipes\settings.py:396
#: .\recipes\settings.py:451
msgid "Swedish"
msgstr ""

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-01-19 19:14+0100\n"
"POT-Creation-Date: 2023-04-26 07:46+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -18,62 +18,66 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: .\recipes\settings.py:382
#: .\recipes\settings.py:436
msgid "Armenian "
msgstr ""
#: .\recipes\settings.py:383
#: .\recipes\settings.py:437
msgid "Bulgarian"
msgstr ""
#: .\recipes\settings.py:384
#: .\recipes\settings.py:438
msgid "Catalan"
msgstr ""
#: .\recipes\settings.py:385
#: .\recipes\settings.py:439
msgid "Czech"
msgstr ""
#: .\recipes\settings.py:386
#: .\recipes\settings.py:440
msgid "Danish"
msgstr ""
#: .\recipes\settings.py:387
#: .\recipes\settings.py:441
msgid "Dutch"
msgstr ""
#: .\recipes\settings.py:388
#: .\recipes\settings.py:442
msgid "English"
msgstr ""
#: .\recipes\settings.py:389
#: .\recipes\settings.py:443
msgid "French"
msgstr ""
#: .\recipes\settings.py:390
#: .\recipes\settings.py:444
msgid "German"
msgstr ""
#: .\recipes\settings.py:391
#: .\recipes\settings.py:445
msgid "Hungarian"
msgstr ""
#: .\recipes\settings.py:446
msgid "Italian"
msgstr ""
#: .\recipes\settings.py:392
#: .\recipes\settings.py:447
msgid "Latvian"
msgstr ""
#: .\recipes\settings.py:393
#: .\recipes\settings.py:448
msgid "Polish"
msgstr ""
#: .\recipes\settings.py:394
#: .\recipes\settings.py:449
msgid "Russian"
msgstr ""
#: .\recipes\settings.py:395
#: .\recipes\settings.py:450
msgid "Spanish"
msgstr ""
#: .\recipes\settings.py:396
#: .\recipes\settings.py:451
msgid "Swedish"
msgstr ""

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-01-19 19:14+0100\n"
"POT-Creation-Date: 2023-04-26 07:46+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -18,62 +18,66 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: .\recipes\settings.py:382
#: .\recipes\settings.py:436
msgid "Armenian "
msgstr ""
#: .\recipes\settings.py:383
#: .\recipes\settings.py:437
msgid "Bulgarian"
msgstr ""
#: .\recipes\settings.py:384
#: .\recipes\settings.py:438
msgid "Catalan"
msgstr ""
#: .\recipes\settings.py:385
#: .\recipes\settings.py:439
msgid "Czech"
msgstr ""
#: .\recipes\settings.py:386
#: .\recipes\settings.py:440
msgid "Danish"
msgstr ""
#: .\recipes\settings.py:387
#: .\recipes\settings.py:441
msgid "Dutch"
msgstr ""
#: .\recipes\settings.py:388
#: .\recipes\settings.py:442
msgid "English"
msgstr ""
#: .\recipes\settings.py:389
#: .\recipes\settings.py:443
msgid "French"
msgstr ""
#: .\recipes\settings.py:390
#: .\recipes\settings.py:444
msgid "German"
msgstr ""
#: .\recipes\settings.py:391
#: .\recipes\settings.py:445
msgid "Hungarian"
msgstr ""
#: .\recipes\settings.py:446
msgid "Italian"
msgstr ""
#: .\recipes\settings.py:392
#: .\recipes\settings.py:447
msgid "Latvian"
msgstr ""
#: .\recipes\settings.py:393
#: .\recipes\settings.py:448
msgid "Polish"
msgstr ""
#: .\recipes\settings.py:394
#: .\recipes\settings.py:449
msgid "Russian"
msgstr ""
#: .\recipes\settings.py:395
#: .\recipes\settings.py:450
msgid "Spanish"
msgstr ""
#: .\recipes\settings.py:396
#: .\recipes\settings.py:451
msgid "Swedish"
msgstr ""

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-01-19 19:14+0100\n"
"POT-Creation-Date: 2023-04-26 07:46+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -18,62 +18,66 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: .\recipes\settings.py:382
#: .\recipes\settings.py:436
msgid "Armenian "
msgstr ""
#: .\recipes\settings.py:383
#: .\recipes\settings.py:437
msgid "Bulgarian"
msgstr ""
#: .\recipes\settings.py:384
#: .\recipes\settings.py:438
msgid "Catalan"
msgstr ""
#: .\recipes\settings.py:385
#: .\recipes\settings.py:439
msgid "Czech"
msgstr ""
#: .\recipes\settings.py:386
#: .\recipes\settings.py:440
msgid "Danish"
msgstr ""
#: .\recipes\settings.py:387
#: .\recipes\settings.py:441
msgid "Dutch"
msgstr ""
#: .\recipes\settings.py:388
#: .\recipes\settings.py:442
msgid "English"
msgstr ""
#: .\recipes\settings.py:389
#: .\recipes\settings.py:443
msgid "French"
msgstr ""
#: .\recipes\settings.py:390
#: .\recipes\settings.py:444
msgid "German"
msgstr ""
#: .\recipes\settings.py:391
#: .\recipes\settings.py:445
msgid "Hungarian"
msgstr ""
#: .\recipes\settings.py:446
msgid "Italian"
msgstr ""
#: .\recipes\settings.py:392
#: .\recipes\settings.py:447
msgid "Latvian"
msgstr ""
#: .\recipes\settings.py:393
#: .\recipes\settings.py:448
msgid "Polish"
msgstr ""
#: .\recipes\settings.py:394
#: .\recipes\settings.py:449
msgid "Russian"
msgstr ""
#: .\recipes\settings.py:395
#: .\recipes\settings.py:450
msgid "Spanish"
msgstr ""
#: .\recipes\settings.py:396
#: .\recipes\settings.py:451
msgid "Swedish"
msgstr ""

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-01-19 19:14+0100\n"
"POT-Creation-Date: 2023-04-26 07:46+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,62 +17,66 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: .\recipes\settings.py:382
#: .\recipes\settings.py:436
msgid "Armenian "
msgstr ""
#: .\recipes\settings.py:383
#: .\recipes\settings.py:437
msgid "Bulgarian"
msgstr ""
#: .\recipes\settings.py:384
#: .\recipes\settings.py:438
msgid "Catalan"
msgstr ""
#: .\recipes\settings.py:385
#: .\recipes\settings.py:439
msgid "Czech"
msgstr ""
#: .\recipes\settings.py:386
#: .\recipes\settings.py:440
msgid "Danish"
msgstr ""
#: .\recipes\settings.py:387
#: .\recipes\settings.py:441
msgid "Dutch"
msgstr ""
#: .\recipes\settings.py:388
#: .\recipes\settings.py:442
msgid "English"
msgstr ""
#: .\recipes\settings.py:389
#: .\recipes\settings.py:443
msgid "French"
msgstr ""
#: .\recipes\settings.py:390
#: .\recipes\settings.py:444
msgid "German"
msgstr ""
#: .\recipes\settings.py:391
#: .\recipes\settings.py:445
msgid "Hungarian"
msgstr ""
#: .\recipes\settings.py:446
msgid "Italian"
msgstr ""
#: .\recipes\settings.py:392
#: .\recipes\settings.py:447
msgid "Latvian"
msgstr ""
#: .\recipes\settings.py:393
#: .\recipes\settings.py:448
msgid "Polish"
msgstr ""
#: .\recipes\settings.py:394
#: .\recipes\settings.py:449
msgid "Russian"
msgstr ""
#: .\recipes\settings.py:395
#: .\recipes\settings.py:450
msgid "Spanish"
msgstr ""
#: .\recipes\settings.py:396
#: .\recipes\settings.py:451
msgid "Swedish"
msgstr ""

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-01-19 19:14+0100\n"
"POT-Creation-Date: 2023-04-26 07:46+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -18,62 +18,66 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: .\recipes\settings.py:382
#: .\recipes\settings.py:436
msgid "Armenian "
msgstr ""
#: .\recipes\settings.py:383
#: .\recipes\settings.py:437
msgid "Bulgarian"
msgstr ""
#: .\recipes\settings.py:384
#: .\recipes\settings.py:438
msgid "Catalan"
msgstr ""
#: .\recipes\settings.py:385
#: .\recipes\settings.py:439
msgid "Czech"
msgstr ""
#: .\recipes\settings.py:386
#: .\recipes\settings.py:440
msgid "Danish"
msgstr ""
#: .\recipes\settings.py:387
#: .\recipes\settings.py:441
msgid "Dutch"
msgstr ""
#: .\recipes\settings.py:388
#: .\recipes\settings.py:442
msgid "English"
msgstr ""
#: .\recipes\settings.py:389
#: .\recipes\settings.py:443
msgid "French"
msgstr ""
#: .\recipes\settings.py:390
#: .\recipes\settings.py:444
msgid "German"
msgstr ""
#: .\recipes\settings.py:391
#: .\recipes\settings.py:445
msgid "Hungarian"
msgstr ""
#: .\recipes\settings.py:446
msgid "Italian"
msgstr ""
#: .\recipes\settings.py:392
#: .\recipes\settings.py:447
msgid "Latvian"
msgstr ""
#: .\recipes\settings.py:393
#: .\recipes\settings.py:448
msgid "Polish"
msgstr ""
#: .\recipes\settings.py:394
#: .\recipes\settings.py:449
msgid "Russian"
msgstr ""
#: .\recipes\settings.py:395
#: .\recipes\settings.py:450
msgid "Spanish"
msgstr ""
#: .\recipes\settings.py:396
#: .\recipes\settings.py:451
msgid "Swedish"
msgstr ""

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-01-19 19:14+0100\n"
"POT-Creation-Date: 2023-04-26 07:46+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -19,62 +19,66 @@ msgstr ""
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : "
"2);\n"
#: .\recipes\settings.py:382
#: .\recipes\settings.py:436
msgid "Armenian "
msgstr ""
#: .\recipes\settings.py:383
#: .\recipes\settings.py:437
msgid "Bulgarian"
msgstr ""
#: .\recipes\settings.py:384
#: .\recipes\settings.py:438
msgid "Catalan"
msgstr ""
#: .\recipes\settings.py:385
#: .\recipes\settings.py:439
msgid "Czech"
msgstr ""
#: .\recipes\settings.py:386
#: .\recipes\settings.py:440
msgid "Danish"
msgstr ""
#: .\recipes\settings.py:387
#: .\recipes\settings.py:441
msgid "Dutch"
msgstr ""
#: .\recipes\settings.py:388
#: .\recipes\settings.py:442
msgid "English"
msgstr ""
#: .\recipes\settings.py:389
#: .\recipes\settings.py:443
msgid "French"
msgstr ""
#: .\recipes\settings.py:390
#: .\recipes\settings.py:444
msgid "German"
msgstr ""
#: .\recipes\settings.py:391
#: .\recipes\settings.py:445
msgid "Hungarian"
msgstr ""
#: .\recipes\settings.py:446
msgid "Italian"
msgstr ""
#: .\recipes\settings.py:392
#: .\recipes\settings.py:447
msgid "Latvian"
msgstr ""
#: .\recipes\settings.py:393
#: .\recipes\settings.py:448
msgid "Polish"
msgstr ""
#: .\recipes\settings.py:394
#: .\recipes\settings.py:449
msgid "Russian"
msgstr ""
#: .\recipes\settings.py:395
#: .\recipes\settings.py:450
msgid "Spanish"
msgstr ""
#: .\recipes\settings.py:396
#: .\recipes\settings.py:451
msgid "Swedish"
msgstr ""

Some files were not shown because too many files have changed in this diff Show More