Compare commits

...

577 Commits

Author SHA1 Message Date
vabene1111
6c22fb0ef4 Merge branch 'develop' 2021-08-12 15:12:55 +02:00
vabene1111
f869fc85ae fixed broken share links 2021-08-12 15:12:08 +02:00
vabene1111
f435110810 updated and compiled messages 2021-08-12 15:09:34 +02:00
Afaren
36a0693b49 Translated using Weblate (French)
Currently translated at 2.5% (2 of 78 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/fr/
2021-08-11 16:51:30 +00:00
Afaren
32a565c1e0 Translated using Weblate (French)
Currently translated at 90.8% (428 of 471 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/fr/
2021-08-11 16:51:30 +00:00
Afaren
f3fd087b81 Added translation using Weblate (French) 2021-08-10 15:08:26 +00:00
Danny Tsui
8e8d25071c Translated using Weblate (Chinese (Simplified))
Currently translated at 73.0% (57 of 78 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/zh_Hans/
2021-08-10 08:51:29 +00:00
Danny Tsui
129cc76624 Translated using Weblate (Chinese (Simplified))
Currently translated at 15.9% (75 of 471 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/zh_Hans/
2021-08-10 08:51:28 +00:00
Danny Tsui
0e48ee60cb Translated using Weblate (Chinese (Simplified))
Currently translated at 57.6% (45 of 78 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/zh_Hans/
2021-08-04 21:51:26 +00:00
Danny Tsui
a784421b5c Translated using Weblate (Chinese (Simplified))
Currently translated at 9.3% (44 of 471 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/zh_Hans/
2021-08-04 21:51:26 +00:00
Danny Tsui
314d8d41d1 Added translation using Weblate (Chinese (Simplified)) 2021-08-03 16:27:47 +00:00
Danny Tsui
02fd73f43e Added translation using Weblate (Chinese (Traditional)) 2021-08-03 15:59:53 +00:00
Danny Tsui
f12c47603d Added translation using Weblate (Chinese (Traditional)) 2021-08-03 15:59:19 +00:00
vabene1111
e341b96249 synology 2021-07-29 17:55:21 +02:00
vabene1111
7ed5606e9d Merge pull request #782 from vabene1111/dependabot/pip/boto3-1.18.9
Bump boto3 from 1.18.4 to 1.18.9
2021-07-29 17:11:33 +02:00
vabene1111
f3fffc1a3b Merge pull request #774 from vabene1111/dependabot/pip/recipe-scrapers-13.3.5
Bump recipe-scrapers from 13.3.4 to 13.3.5
2021-07-29 17:11:21 +02:00
vabene1111
c5a3e22542 Merge pull request #772 from vabene1111/dependabot/pip/python-dotenv-0.19.0
Bump python-dotenv from 0.18.0 to 0.19.0
2021-07-29 17:11:16 +02:00
vabene1111
c6990ef2d8 fixed fraction issue 2021-07-29 17:11:01 +02:00
vabene1111
12a438752b fixed old search made new search default 2021-07-29 16:55:57 +02:00
vabene1111
8642298eda recipe book context menu 2021-07-29 16:32:15 +02:00
dependabot[bot]
6260aba668 Bump boto3 from 1.18.4 to 1.18.9
Bumps [boto3](https://github.com/boto/boto3) from 1.18.4 to 1.18.9.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.18.4...1.18.9)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-29 00:03:37 +00:00
dependabot[bot]
c56489cfa0 Bump recipe-scrapers from 13.3.4 to 13.3.5
Bumps [recipe-scrapers](https://github.com/hhursev/recipe-scrapers) from 13.3.4 to 13.3.5.
- [Release notes](https://github.com/hhursev/recipe-scrapers/releases)
- [Commits](https://github.com/hhursev/recipe-scrapers/compare/13.3.4...13.3.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-26 00:17:52 +00:00
dependabot[bot]
33b84c3d6a Bump python-dotenv from 0.18.0 to 0.19.0
Bumps [python-dotenv](https://github.com/theskumar/python-dotenv) from 0.18.0 to 0.19.0.
- [Release notes](https://github.com/theskumar/python-dotenv/releases)
- [Changelog](https://github.com/theskumar/python-dotenv/blob/master/CHANGELOG.md)
- [Commits](https://github.com/theskumar/python-dotenv/compare/v0.18.0...v0.19.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-26 00:17:30 +00:00
vabene1111
45454eb27b test create pinned recipe component 2021-07-22 16:53:20 +02:00
vabene1111
f628823ab2 Merge pull request #751 from tandy-1000/patch-1
Update manual setup
2021-07-22 16:42:16 +02:00
vabene1111
781cbc16f7 space create initial name and markup 2021-07-22 16:39:42 +02:00
vabene1111
28e6c9d922 increased default file upload limit 2021-07-22 16:07:32 +02:00
vabene1111
d96bac47c4 Merge pull request #760 from vabene1111/dependabot/pip/requests-2.26.0
Bump requests from 2.25.1 to 2.26.0
2021-07-22 16:04:30 +02:00
vabene1111
1dafeb4db9 Merge pull request #762 from vabene1111/dependabot/pip/bleach-3.3.1
Bump bleach from 3.3.0 to 3.3.1
2021-07-22 16:04:25 +02:00
vabene1111
c02cdf6e68 Merge pull request #763 from vabene1111/dependabot/pip/recipe-scrapers-13.3.4
Bump recipe-scrapers from 13.3.2 to 13.3.4
2021-07-22 16:04:20 +02:00
vabene1111
3628835fd4 Merge pull request #767 from vabene1111/dependabot/pip/whitenoise-5.3.0
Bump whitenoise from 5.2.0 to 5.3.0
2021-07-22 16:04:16 +02:00
vabene1111
747b5937eb Merge pull request #770 from vabene1111/dependabot/pip/boto3-1.18.4
Bump boto3 from 1.17.110 to 1.18.4
2021-07-22 16:04:10 +02:00
dependabot[bot]
2fde8f9b52 Bump boto3 from 1.17.110 to 1.18.4
Bumps [boto3](https://github.com/boto/boto3) from 1.17.110 to 1.18.4.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.17.110...1.18.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-22 00:02:59 +00:00
tandy1000
7c06da89f0 simplify, add some fixes re static / media files 2021-07-21 09:59:14 +01:00
Jesse
2b17b12252 Translated using Weblate (Dutch)
Currently translated at 100.0% (76 of 76 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/nl/
2021-07-19 19:53:09 +00:00
Jesse
07afa7957a Translated using Weblate (Dutch)
Currently translated at 100.0% (471 of 471 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/nl/
2021-07-19 16:40:51 +00:00
dependabot[bot]
f0488c93d2 Bump whitenoise from 5.2.0 to 5.3.0
Bumps [whitenoise](https://github.com/evansd/whitenoise) from 5.2.0 to 5.3.0.
- [Release notes](https://github.com/evansd/whitenoise/releases)
- [Changelog](https://github.com/evansd/whitenoise/blob/master/docs/changelog.rst)
- [Commits](https://github.com/evansd/whitenoise/compare/v5.2.0...v5.3.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-19 00:40:33 +00:00
Jesse
86a3d87276 Translated using Weblate (Dutch)
Currently translated at 93.8% (442 of 471 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/nl/
2021-07-16 09:53:08 +00:00
dependabot[bot]
fd14d79c12 Bump recipe-scrapers from 13.3.2 to 13.3.4
Bumps [recipe-scrapers](https://github.com/hhursev/recipe-scrapers) from 13.3.2 to 13.3.4.
- [Release notes](https://github.com/hhursev/recipe-scrapers/releases)
- [Commits](https://github.com/hhursev/recipe-scrapers/compare/13.3.2...13.3.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-15 00:03:06 +00:00
dependabot[bot]
4e852374cc Bump bleach from 3.3.0 to 3.3.1
Bumps [bleach](https://github.com/mozilla/bleach) from 3.3.0 to 3.3.1.
- [Release notes](https://github.com/mozilla/bleach/releases)
- [Changelog](https://github.com/mozilla/bleach/blob/master/CHANGES)
- [Commits](https://github.com/mozilla/bleach/compare/v3.3.0...v3.3.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-15 00:03:01 +00:00
dependabot[bot]
898b1699b7 Bump requests from 2.25.1 to 2.26.0
Bumps [requests](https://github.com/psf/requests) from 2.25.1 to 2.26.0.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.25.1...v2.26.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-14 00:03:01 +00:00
vabene1111
e92dbcd63e compiled javascript 2021-07-13 16:47:45 +02:00
vabene1111
0c28e7e1b4 recipes as part of recipes/steps 2021-07-13 16:47:39 +02:00
vabene1111
f8c1411e4d Merge pull request #755 from vabene1111/dependabot/pip/simplejson-3.17.3
Bump simplejson from 3.17.2 to 3.17.3
2021-07-13 10:27:29 +02:00
vabene1111
f1a194e166 Merge pull request #757 from vabene1111/dependabot/pip/recipe-scrapers-13.3.2
Bump recipe-scrapers from 13.3.1 to 13.3.2
2021-07-13 10:27:18 +02:00
dependabot[bot]
f374e0cb27 Bump recipe-scrapers from 13.3.1 to 13.3.2
Bumps [recipe-scrapers](https://github.com/hhursev/recipe-scrapers) from 13.3.1 to 13.3.2.
- [Release notes](https://github.com/hhursev/recipe-scrapers/releases)
- [Commits](https://github.com/hhursev/recipe-scrapers/compare/13.3.1...13.3.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-13 08:27:13 +00:00
vabene1111
6f7a41f3b8 Merge pull request #758 from vabene1111/dependabot/pip/boto3-1.17.110
Bump boto3 from 1.17.108 to 1.17.110
2021-07-13 10:27:10 +02:00
vabene1111
a562b571b5 Merge pull request #754 from vabene1111/dependabot/pip/django-allauth-0.45.0
Bump django-allauth from 0.44.0 to 0.45.0
2021-07-13 10:26:42 +02:00
dependabot[bot]
d71420484c Bump boto3 from 1.17.108 to 1.17.110
Bumps [boto3](https://github.com/boto/boto3) from 1.17.108 to 1.17.110.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.17.108...1.17.110)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-13 00:02:31 +00:00
dependabot[bot]
bc7758e233 Bump simplejson from 3.17.2 to 3.17.3
Bumps [simplejson](https://github.com/simplejson/simplejson) from 3.17.2 to 3.17.3.
- [Release notes](https://github.com/simplejson/simplejson/releases)
- [Changelog](https://github.com/simplejson/simplejson/blob/master/CHANGES.txt)
- [Commits](https://github.com/simplejson/simplejson/compare/v3.17.2...v3.17.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-12 00:13:21 +00:00
dependabot[bot]
0f5185c677 Bump django-allauth from 0.44.0 to 0.45.0
Bumps [django-allauth](https://github.com/pennersr/django-allauth) from 0.44.0 to 0.45.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.44.0...0.45.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>
2021-07-12 00:13:14 +00:00
vabene1111
1e6096d5c8 Merge pull request #753 from vabene1111/dependabot/pip/boto3-1.17.108
Bump boto3 from 1.17.106 to 1.17.108
2021-07-09 08:08:20 +02:00
dependabot[bot]
bc2a092e79 Bump boto3 from 1.17.106 to 1.17.108
Bumps [boto3](https://github.com/boto/boto3) from 1.17.106 to 1.17.108.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.17.106...1.17.108)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-09 00:03:25 +00:00
vabene1111
9809f58c28 supermarket view done 2021-07-08 19:00:23 +02:00
tandy1000
589302a87d Add guidance on what to edit in .env 2021-07-07 19:23:00 +01:00
tandy1000
173eaf44a0 Add fix for no image on recipe page
https://github.com/vabene1111/recipes/issues/470#issuecomment-787210414
2021-07-07 19:10:19 +01:00
tandy1000
576c62b8a1 Update manual setup
I just went through a manual install on DietPi / Debian Unstable, and found that the manual needed some improving, this method works, whereas following the original manual was not a success for me.

The only line I would say I am unsure about is this one:
"Give the user permissions: `chown -R recipes:www-data /var/www/recipes`"
As I am not sure whether these permissions are necessary for this to work.

Hope this is useful, let me know if I can make further improvements.
2021-07-07 16:49:04 +01:00
vabene1111
da57e656eb several search related improvements 2021-07-07 17:45:05 +02:00
vabene1111
b42e6ac0f6 fixed cook log creation in old search 2021-07-07 17:21:14 +02:00
vabene1111
cebcf266fc Merge pull request #750 from vabene1111/dependabot/pip/pillow-8.3.1
Bump pillow from 8.3.0 to 8.3.1
2021-07-07 16:31:35 +02:00
vabene1111
d5ebb0047d Merge pull request #749 from vabene1111/dependabot/pip/boto3-1.17.106
Bump boto3 from 1.17.104 to 1.17.106
2021-07-07 16:31:31 +02:00
vabene1111
6d553035db Merge pull request #748 from vabene1111/dependabot/pip/recipe-scrapers-13.3.1
Bump recipe-scrapers from 13.3.0 to 13.3.1
2021-07-07 16:31:26 +02:00
dependabot[bot]
0f57dc9c8a Bump pillow from 8.3.0 to 8.3.1
Bumps [pillow](https://github.com/python-pillow/Pillow) from 8.3.0 to 8.3.1.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/master/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/8.3.0...8.3.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-07 00:02:44 +00:00
dependabot[bot]
31a4bc7747 Bump boto3 from 1.17.104 to 1.17.106
Bumps [boto3](https://github.com/boto/boto3) from 1.17.104 to 1.17.106.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.17.104...1.17.106)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-07 00:02:37 +00:00
dependabot[bot]
0eed67b5aa Bump recipe-scrapers from 13.3.0 to 13.3.1
Bumps [recipe-scrapers](https://github.com/hhursev/recipe-scrapers) from 13.3.0 to 13.3.1.
- [Release notes](https://github.com/hhursev/recipe-scrapers/releases)
- [Commits](https://github.com/hhursev/recipe-scrapers/compare/13.3.0...13.3.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-05 00:18:45 +00:00
vabene1111
3dbf40ff44 Merge pull request #746 from vabene1111/dependabot/pip/pillow-8.3.0
Bump pillow from 8.2.0 to 8.3.0
2021-07-03 10:31:32 +02:00
vabene1111
16459c1ec1 Merge pull request #745 from vabene1111/dependabot/pip/django-3.2.5
Bump django from 3.2.4 to 3.2.5
2021-07-03 10:31:20 +02:00
vabene1111
ba575ff79b Merge pull request #744 from vabene1111/dependabot/pip/boto3-1.17.104
Bump boto3 from 1.17.102 to 1.17.104
2021-07-03 10:31:02 +02:00
dependabot[bot]
2f9e407f49 Bump pillow from 8.2.0 to 8.3.0
Bumps [pillow](https://github.com/python-pillow/Pillow) from 8.2.0 to 8.3.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/master/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/8.2.0...8.3.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-02 00:02:44 +00:00
dependabot[bot]
1779c1ac14 Bump django from 3.2.4 to 3.2.5
Bumps [django](https://github.com/django/django) from 3.2.4 to 3.2.5.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/3.2.4...3.2.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-02 00:02:32 +00:00
dependabot[bot]
ca1c353575 Bump boto3 from 1.17.102 to 1.17.104
Bumps [boto3](https://github.com/boto/boto3) from 1.17.102 to 1.17.104.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.17.102...1.17.104)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-02 00:02:24 +00:00
Kaibu
cac643266b Merge branch 'develop' of https://github.com/vabene1111/recipes into develop 2021-06-30 15:37:18 +02:00
Kaibu
5518199f64 search and car styling 2021-06-30 15:36:56 +02:00
vabene1111
a508fa81c0 Merge pull request #740 from vabene1111/dependabot/pip/boto3-1.17.102
Bump boto3 from 1.17.101 to 1.17.102
2021-06-30 14:48:16 +02:00
vabene1111
c5bec8b69e fixed rendering of recipe cards without descriptions 2021-06-30 14:42:48 +02:00
Kaibu
c4905d39c1 minor ui/ux improvements 2021-06-30 04:12:52 +02:00
dependabot[bot]
5275e5eba7 Bump boto3 from 1.17.101 to 1.17.102
Bumps [boto3](https://github.com/boto/boto3) from 1.17.101 to 1.17.102.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.17.101...1.17.102)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-29 00:02:39 +00:00
vabene1111
272341f1dc further improvements to search view 2021-06-28 18:35:20 +02:00
vabene1111
78885987f0 small recipe card tweaks 2021-06-28 16:41:45 +02:00
vabene1111
cdbcc971b1 fixed old search rating 2021-06-28 16:31:48 +02:00
vabene1111
5378b4c577 Merge pull request #720 from Forceu/develop
Fixed Install URL in readme and documentation, added link to Docker Hub
2021-06-28 16:24:09 +02:00
vabene1111
269593cd98 Merge branch 'develop' into develop 2021-06-28 16:24:04 +02:00
vabene1111
82c83f4b8d Merge pull request #727 from vabene1111/dependabot/pip/django-webpack-loader-1.1.0
Bump django-webpack-loader from 1.0.0 to 1.1.0
2021-06-28 16:18:59 +02:00
vabene1111
42885cefc9 Merge pull request #739 from vabene1111/dependabot/pip/boto3-1.17.101
Bump boto3 from 1.17.97 to 1.17.101
2021-06-28 16:18:53 +02:00
dependabot[bot]
54a5009f98 Bump boto3 from 1.17.97 to 1.17.101
Bumps [boto3](https://github.com/boto/boto3) from 1.17.97 to 1.17.101.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.17.97...1.17.101)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-28 00:20:10 +00:00
Hrachya Kocharyan
7c49164387 Added translation using Weblate (Armenian) 2021-06-26 08:52:51 +00:00
Maximilian J
1b8d4e4494 Translated using Weblate (German)
Currently translated at 98.6% (73 of 74 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/de/
2021-06-24 15:49:37 +00:00
Maximilian J
932211e7f6 Translated using Weblate (German)
Currently translated at 94.4% (445 of 471 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/de/
2021-06-24 15:49:37 +00:00
vabene1111
9658993163 admin filter options and timestamp fields 2021-06-22 18:21:14 +02:00
vabene1111
13e3c98fac actually implemented setting 2021-06-22 17:55:18 +02:00
Jesse
9a9644dc6c Translated using Weblate (Dutch)
Currently translated at 92.3% (435 of 471 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/nl/
2021-06-22 09:12:37 +00:00
Kaibu
cc43b2a9b0 minor ui fixes 2021-06-22 01:03:26 +02:00
Kaibu
91c0dbd8d2 demo url will login filled 2021-06-22 00:10:27 +02:00
vabene1111
3271ec6867 fixed cookie name env 2021-06-21 17:29:00 +02:00
dependabot[bot]
d39b779db9 Bump django-webpack-loader from 1.0.0 to 1.1.0
Bumps [django-webpack-loader](https://github.com/django-webpack/django-webpack-loader) from 1.0.0 to 1.1.0.
- [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/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-21 13:31:03 +00:00
vabene1111
536b0bad20 Merge pull request #728 from vabene1111/dependabot/npm_and_yarn/vue/postcss-7.0.36
Bump postcss from 7.0.35 to 7.0.36 in /vue
2021-06-21 15:30:28 +02:00
vabene1111
5c2020b8dd Merge pull request #725 from vabene1111/dependabot/pip/python-dotenv-0.18.0
Bump python-dotenv from 0.17.1 to 0.18.0
2021-06-21 15:30:08 +02:00
vabene1111
5851d061a2 Merge pull request #726 from vabene1111/dependabot/pip/recipe-scrapers-13.3.0
Bump recipe-scrapers from 13.2.8 to 13.3.0
2021-06-21 15:30:01 +02:00
dependabot[bot]
a8bcc1457d Bump python-dotenv from 0.17.1 to 0.18.0
Bumps [python-dotenv](https://github.com/theskumar/python-dotenv) from 0.17.1 to 0.18.0.
- [Release notes](https://github.com/theskumar/python-dotenv/releases)
- [Changelog](https://github.com/theskumar/python-dotenv/blob/master/CHANGELOG.md)
- [Commits](https://github.com/theskumar/python-dotenv/compare/v0.17.1...v0.18.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-21 13:29:47 +00:00
dependabot[bot]
6ba9cb8b55 Bump postcss from 7.0.35 to 7.0.36 in /vue
Bumps [postcss](https://github.com/postcss/postcss) from 7.0.35 to 7.0.36.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/7.0.35...7.0.36)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-21 13:29:45 +00:00
vabene1111
8e53cce3b2 Merge pull request #712 from vabene1111/dependabot/pip/boto3-1.17.97
Bump boto3 from 1.17.93 to 1.17.97
2021-06-21 15:29:08 +02:00
vabene1111
7f3a4ada75 Merge pull request #713 from vabene1111/dependabot/pip/psycopg2-binary-2.9.1
Bump psycopg2-binary from 2.8.6 to 2.9.1
2021-06-21 15:29:03 +02:00
vabene1111
0163988593 fixed loading of complex social account settings 2021-06-21 15:28:22 +02:00
vabene1111
bcf78aed0a fixed unit test 2021-06-21 13:51:47 +02:00
vabene1111
a7c89cc32e build javascript dependencies 2021-06-21 13:32:26 +02:00
vabene1111
e66502ee8f updated settings env variables 2021-06-21 13:15:21 +02:00
vabene1111
40a12f35d7 allow modifying session cookie behavior 2021-06-21 13:08:04 +02:00
vabene1111
fd1a399d03 more improvements to the ingredient parser + tests 2021-06-21 13:00:03 +02:00
vabene1111
538e45d20c fixed enable signup parameter for social auth 2021-06-21 12:43:52 +02:00
dependabot[bot]
0304e2a1ed Bump recipe-scrapers from 13.2.8 to 13.3.0
Bumps [recipe-scrapers](https://github.com/hhursev/recipe-scrapers) from 13.2.8 to 13.3.0.
- [Release notes](https://github.com/hhursev/recipe-scrapers/releases)
- [Commits](https://github.com/hhursev/recipe-scrapers/compare/13.2.8...13.3.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>
2021-06-21 00:17:39 +00:00
Kaibu
65245234d8 Merge branch 'develop' of https://github.com/vabene1111/recipes into develop 2021-06-20 14:59:03 +02:00
Kaibu
a88d7625dc social login buttons 2021-06-20 14:58:56 +02:00
Marc Ole Bulling
1af06b6480 Fixed Installation link in docs 2021-06-20 13:50:50 +02:00
vabene1111
48270197fa Merge pull request #719 from vabene1111/master
Master
2021-06-20 13:50:26 +02:00
Marc Ole Bulling
86cea901b4 Fixed Install link in Readme, added link to Docker badge 2021-06-20 13:49:30 +02:00
vabene1111
f5312496e3 fixed url image import 2021-06-20 13:35:05 +02:00
vabene1111
7f57e7ab56 Fixed recipe create space 2021-06-19 14:44:49 +02:00
Oliver Cervera
c8d8dd581e Translated using Weblate (Italian)
Currently translated at 76.8% (362 of 471 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/it/
2021-06-18 23:12:35 +00:00
vabene1111
256c1a7d41 improved ingredient parser 2021-06-18 17:36:31 +02:00
vabene1111
7aa71dc744 layering fix 2021-06-18 16:29:46 +02:00
vabene1111
07c34ea7b5 account and social logic/templates 2021-06-18 16:13:28 +02:00
dependabot[bot]
2d2582b449 Bump psycopg2-binary from 2.8.6 to 2.9.1
Bumps [psycopg2-binary](https://github.com/psycopg/psycopg2) from 2.8.6 to 2.9.1.
- [Release notes](https://github.com/psycopg/psycopg2/releases)
- [Changelog](https://github.com/psycopg/psycopg2/blob/master/NEWS)
- [Commits](https://github.com/psycopg/psycopg2/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-18 00:02:50 +00:00
dependabot[bot]
4f81cb10de Bump boto3 from 1.17.93 to 1.17.97
Bumps [boto3](https://github.com/boto/boto3) from 1.17.93 to 1.17.97.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.17.93...1.17.97)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-18 00:02:43 +00:00
vabene1111
0256864904 social auth stuff 2021-06-17 22:40:33 +02:00
vabene1111
7725665aa4 django needs two files 2021-06-17 16:05:18 +02:00
vabene1111
74e3d09065 moved to new migration 2021-06-17 15:23:39 +02:00
vabene1111
0522fa0236 formatting 2021-06-17 15:15:42 +02:00
vabene1111
38aeb285c5 fixes space migration fo I/N/S 2021-06-17 15:02:06 +02:00
vabene1111
a9a0716c45 import response improvements 2021-06-17 14:08:03 +02:00
vabene1111
afc31b313f Merge branch 'develop' of https://github.com/vabene1111/recipes into develop 2021-06-17 13:38:59 +02:00
vabene1111
151f43b0d5 lots of importer adjustments 2021-06-17 13:38:57 +02:00
Kaibu
a695261b9c share intend 2021-06-17 03:01:22 +02:00
Sander
1229a37d74 Translated using Weblate (Dutch)
Currently translated at 80.8% (381 of 471 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/nl/
2021-06-16 20:12:34 +00:00
Kaibu
ef200a4283 ui fixes 2021-06-16 19:13:03 +02:00
vabene1111
018fcf27ea migrated space to ingredient, step and nutritional value 2021-06-15 22:56:25 +02:00
vabene1111
b3504699b1 allow disable sharing for spaces 2021-06-15 21:12:43 +02:00
vabene1111
cdf4476345 recipe share link in modal 2021-06-15 20:57:25 +02:00
vabene1111
0edc9f48c9 fixed invite link signup 2021-06-15 20:13:25 +02:00
vabene1111
41885f7d05 Merge branch 'develop' of https://github.com/vabene1111/recipes into develop 2021-06-15 09:04:10 +02:00
vabene1111
2b7769e92f fixed report abuse button showing even if not shared 2021-06-15 09:04:05 +02:00
vabene1111
6a47d56da4 fixed latest shopping list view 2021-06-14 20:50:02 +02:00
vabene1111
d456d4ae64 disable email verification for social accounts 2021-06-14 19:06:01 +02:00
vabene1111
7b55bcb045 indicate adv. settings set by button color search view 2021-06-14 19:03:53 +02:00
vabene1111
bee1d717c5 added support for multiple image types 2021-06-14 18:53:51 +02:00
vabene1111
c91fc096b3 Merge pull request #673 from MaxJa4/develop
Create image_processing.py
2021-06-14 17:48:00 +02:00
vabene1111
2297210a3f Merge pull request #696 from vabene1111/dependabot/pip/django-crispy-forms-1.12.0
Bump django-crispy-forms from 1.11.2 to 1.12.0
2021-06-14 17:35:15 +02:00
vabene1111
d59f14001c Merge pull request #697 from vabene1111/dependabot/pip/recipe-scrapers-13.2.8
Bump recipe-scrapers from 13.2.7 to 13.2.8
2021-06-14 17:35:09 +02:00
vabene1111
5e5941397b Merge pull request #698 from vabene1111/dependabot/pip/boto3-1.17.93
Bump boto3 from 1.17.90 to 1.17.93
2021-06-14 17:35:04 +02:00
dependabot[bot]
3ca71c6847 Bump boto3 from 1.17.90 to 1.17.93
Bumps [boto3](https://github.com/boto/boto3) from 1.17.90 to 1.17.93.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.17.90...1.17.93)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-14 06:47:21 +00:00
dependabot[bot]
2c381eb870 Bump recipe-scrapers from 13.2.7 to 13.2.8
Bumps [recipe-scrapers](https://github.com/hhursev/recipe-scrapers) from 13.2.7 to 13.2.8.
- [Release notes](https://github.com/hhursev/recipe-scrapers/releases)
- [Commits](https://github.com/hhursev/recipe-scrapers/compare/13.2.7...13.2.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-14 06:47:10 +00:00
dependabot[bot]
230a368d38 Bump django-crispy-forms from 1.11.2 to 1.12.0
Bumps [django-crispy-forms](https://github.com/django-crispy-forms/django-crispy-forms) from 1.11.2 to 1.12.0.
- [Release notes](https://github.com/django-crispy-forms/django-crispy-forms/releases)
- [Changelog](https://github.com/django-crispy-forms/django-crispy-forms/blob/main/CHANGELOG.md)
- [Commits](https://github.com/django-crispy-forms/django-crispy-forms/compare/1.11.2...1.12.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-14 06:46:56 +00:00
vabene1111
5db7267a7d actual meal plan fixes 2021-06-13 18:11:31 +02:00
vabene1111
528da111f9 Revert "meal plan fixes"
This reverts commit 926097a699.
2021-06-13 18:11:22 +02:00
vabene1111
926097a699 meal plan fixes 2021-06-13 18:11:05 +02:00
vabene1111
0b3e86f6fd imprioved recipe print view 2021-06-13 17:04:52 +02:00
vabene1111
24e4ea354d catch all exception image import 2021-06-13 16:55:27 +02:00
vabene1111
08bc87960b added abuse prevention for share links 2021-06-12 21:15:23 +02:00
vabene1111
9751821f76 updated base language files 2021-06-12 20:30:41 +02:00
vabene1111
fa12d02a3d fixed tests 2021-06-12 20:22:30 +02:00
vabene1111
9856857c51 updated openeats importer 2021-06-11 15:28:11 +02:00
Kaibu
c52cd359a1 mockup updated 2021-06-09 19:04:14 +02:00
vabene1111
5e9ce955bc minor fixes 2021-06-09 18:53:20 +02:00
vabene1111
f7d85bb4b8 improvements to recipekeeper importer 2021-06-09 17:23:14 +02:00
vabene1111
46db6d4186 Merge pull request #591 from itsmegb/importer-reciepekeeper
New Importer - Reciepe Keeper
2021-06-09 16:42:49 +02:00
vabene1111
6724328b51 Merge branch 'develop' into importer-reciepekeeper 2021-06-09 16:42:28 +02:00
vabene1111
0da39f2e1f Merge pull request #674 from smilerz/fix_666
fix url import
2021-06-09 15:54:36 +02:00
vabene1111
99fbc5e97c added openeats importer 2021-06-09 15:52:36 +02:00
vabene1111
a0b6261275 importer openeats basics 2021-06-09 15:12:12 +02:00
vabene1111
061aefd233 new file system updates 2021-06-09 14:02:33 +02:00
vabene1111
d4e332456b Merge pull request #675 from vabene1111/dependabot/pip/boto3-1.17.90
Bump boto3 from 1.17.89 to 1.17.90
2021-06-09 12:39:23 +02:00
vabene1111
500bb3af72 Merge pull request #655 from vabene1111/dependabot/npm_and_yarn/vue/ws-6.2.2
Bump ws from 6.2.1 to 6.2.2 in /vue
2021-06-09 12:39:19 +02:00
dependabot[bot]
888106bb6f Bump boto3 from 1.17.89 to 1.17.90
Bumps [boto3](https://github.com/boto/boto3) from 1.17.89 to 1.17.90.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.17.89...1.17.90)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-09 05:26:57 +00:00
smilerz
8daa0ada9b removed if statement checking if ingredient name exists from ingredient_from_text parser 2021-06-08 15:48:02 -05:00
MaxJa4
98711619ff Create image_processing.py
Added central function to rescale and compress images for recipes (or in general).
Switched from previously used PNG format to 75% JPEG format for a 5-10x file size reduction with hardly any quality loss.
2021-06-08 22:39:45 +02:00
vabene1111
9eb17df575 added basic support for files 2021-06-08 20:17:48 +02:00
vabene1111
c71a7dad24 updated javascript dependencies 2021-06-08 17:26:39 +02:00
Kaibu
b92e51c0c7 login form style fixes 2021-06-08 14:55:18 +02:00
vabene1111
87e8268a43 build sources 2021-06-08 13:12:40 +02:00
vabene1111
5b79db0725 Merge branch 'develop' of https://github.com/vabene1111/recipes into develop
# Conflicts:
#	cookbook/static/vue/js/recipe_search_view.js
#	cookbook/static/vue/js/recipe_view.js
#	vue/webpack-stats.json
2021-06-08 13:12:22 +02:00
vabene1111
3aade540c1 file view 2021-06-08 13:12:04 +02:00
Kaibu
74f155b6f5 Merge branch 'develop' of https://github.com/vabene1111/recipes into develop 2021-06-08 12:22:16 +02:00
Kaibu
2539d19ff4 minor theme fixes 2021-06-08 12:22:08 +02:00
Jesse
166f4c5f6b Translated using Weblate (Dutch)
Currently translated at 100.0% (55 of 55 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/nl/
2021-06-08 10:19:35 +00:00
vabene1111
ed313cbf9a temporary fix to merge ingredients without recipes 2021-06-07 18:28:16 +02:00
vabene1111
b1db591e9f fixed importer description overflow 2021-06-07 17:17:34 +02:00
vabene1111
94c51f90cd fixed recipe book entry remove 2021-06-07 17:12:00 +02:00
vabene1111
3074d916dc many signup and space management fixes 2021-06-07 16:46:28 +02:00
vabene1111
bf467b1ec0 manage link for hosted version 2021-06-07 16:09:26 +02:00
vabene1111
348c1c78f1 split signup forms working again 2021-06-07 16:03:10 +02:00
vabene1111
913e896906 fixed invite link system 2021-06-05 19:01:05 +02:00
vabene1111
a0a673a0c9 uncoment debug code 2021-06-05 18:41:48 +02:00
Kaibu
3d60379ed0 style fixes 2021-06-05 18:10:10 +02:00
vabene1111
fd7e20a46b signup captcha support + privacy/terms support 2021-06-05 16:40:28 +02:00
vabene1111
a970f0c00e made tandoor theme default 2021-06-05 16:38:38 +02:00
vabene1111
297dd6244a model metrics 2021-06-05 15:06:54 +02:00
dependabot[bot]
c9fcbc9ff0 Bump ws from 6.2.1 to 6.2.2 in /vue
Bumps [ws](https://github.com/websockets/ws) from 6.2.1 to 6.2.2.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/commits)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-05 12:42:19 +00:00
vabene1111
c83eb1a42b prometheus basics and aws fix 2021-06-05 14:41:32 +02:00
vabene1111
8181a6d416 s3 signature version default 2021-06-05 14:14:53 +02:00
vabene1111
4a8b50aeba enable caching for signed s3 urls 2021-06-05 13:43:10 +02:00
vabene1111
388ef32475 actually apply limits everywhere 2021-06-04 17:05:03 +02:00
vabene1111
bfe72210df fixed recipe creation broke with new max_recipes setting 2021-06-04 17:01:58 +02:00
vabene1111
02c5aed0a3 moved demo to space setting 2021-06-04 16:56:18 +02:00
vabene1111
6fc0c02674 started work on supermarket edit view 2021-05-31 18:40:59 +02:00
vabene1111
040af330cc Merge pull request #637 from vabene1111/dependabot/pip/boto3-1.17.84
Bump boto3 from 1.17.83 to 1.17.84
2021-05-31 17:06:56 +02:00
dependabot[bot]
05caad5cfe Bump boto3 from 1.17.83 to 1.17.84
Bumps [boto3](https://github.com/boto/boto3) from 1.17.83 to 1.17.84.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.17.83...1.17.84)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-31 06:14:35 +00:00
Kaibu
7aa1c7b53b minor theme fixes 2021-05-31 01:02:46 +02:00
Kaibu
ad24a44588 new tandoor theme added, minor ux fixes 2021-05-31 00:47:59 +02:00
vabene1111
9f4eb91287 fixed search settinggs cookie 2021-05-30 21:02:32 +02:00
vabene1111
9982cae7c3 persistent search settings 2021-05-30 20:40:46 +02:00
vabene1111
6d065cb939 fixed order 2021-05-30 19:56:34 +02:00
vabene1111
b10163e309 recently viewed 2021-05-30 19:40:46 +02:00
vabene1111
28b8973259 fixed snyc log 2021-05-30 18:37:53 +02:00
vabene1111
4f09970130 fixed frontend localization 2021-05-30 17:12:59 +02:00
vabene1111
e05019d2b1 prevent account spam 2021-05-30 16:16:42 +02:00
vabene1111
3c778927e2 email settings 2021-05-30 15:53:16 +02:00
vabene1111
505b60cb14 fixed recipe tests paths and edit max switch 2021-05-30 09:27:20 +02:00
vabene1111
14ca61b11f Merge pull request #632 from vabene1111/dependabot/pip/boto3-1.17.83
Bump boto3 from 1.17.80 to 1.17.83
2021-05-30 08:58:31 +02:00
vabene1111
22900dc460 Merge pull request #630 from vabene1111/dependabot/pip/drf-writable-nested-0.6.3
Bump drf-writable-nested from 0.6.2 to 0.6.3
2021-05-30 08:58:26 +02:00
vabene1111
28806e6857 Merge pull request #633 from smilerz/fix_url_import
bumped recipe_scrapers and updated expected results
2021-05-29 14:02:15 +02:00
vabene1111
dbf1334ec0 Merge pull request #634 from vabene1111/dependabot/npm_and_yarn/vue/dns-packet-1.3.4
Bump dns-packet from 1.3.1 to 1.3.4 in /vue
2021-05-29 13:57:59 +02:00
dependabot[bot]
7e0d9bfe49 Bump dns-packet from 1.3.1 to 1.3.4 in /vue
Bumps [dns-packet](https://github.com/mafintosh/dns-packet) from 1.3.1 to 1.3.4.
- [Release notes](https://github.com/mafintosh/dns-packet/releases)
- [Changelog](https://github.com/mafintosh/dns-packet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mafintosh/dns-packet/compare/v1.3.1...v1.3.4)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-29 04:34:13 +00:00
smilerz
56f80acede bumped recipe_scrapers and updated expected results 2021-05-28 12:53:09 -05:00
vabene1111
46a8a9f60d disable password reset if no mail is set 2021-05-28 18:41:30 +02:00
vabene1111
71fdfe6acb ugly space management hack - will be improved later 2021-05-28 18:19:53 +02:00
vabene1111
50572e9a36 space features 2021-05-28 17:48:09 +02:00
vabene1111
c8054349b2 reworked invite system 2021-05-28 16:49:03 +02:00
dependabot[bot]
0ec5d669dd Bump boto3 from 1.17.80 to 1.17.83
Bumps [boto3](https://github.com/boto/boto3) from 1.17.80 to 1.17.83.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.17.80...1.17.83)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-28 05:29:38 +00:00
dependabot[bot]
6dd778112a Bump drf-writable-nested from 0.6.2 to 0.6.3
Bumps [drf-writable-nested](https://github.com/beda-software/drf-writable-nested) from 0.6.2 to 0.6.3.
- [Release notes](https://github.com/beda-software/drf-writable-nested/releases)
- [Changelog](https://github.com/beda-software/drf-writable-nested/blob/master/CHANGELOG.md)
- [Commits](https://github.com/beda-software/drf-writable-nested/compare/v0.6.2...v0.6.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-27 05:46:43 +00:00
vabene1111
a14e33973c signup, reset and other account stuff 2021-05-26 22:36:53 +02:00
vabene1111
a8d01f4d5a fixed test directory finding 2021-05-26 21:34:49 +02:00
vabene1111
58f841a770 s3 support for images 2021-05-26 16:35:48 +02:00
Jesse
c851b54a22 Translated using Weblate (Dutch)
Currently translated at 100.0% (51 of 51 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/nl/
2021-05-25 07:17:01 +00:00
vabene1111
df53fdeb03 Update README.md 2021-05-24 16:54:31 +02:00
vabene1111
18333563f2 WIP fixing path issues on diffrent systems
relative paths do not appear to work on windows or at least the setup i have
2021-05-22 12:03:37 +02:00
vabene1111
286118093c Merge pull request #622 from smilerz/fix_url_import
updated url import and test due to updated recipe_scraper
2021-05-21 08:25:00 +02:00
smilerz
066ca27712 updated url import and test due to updated recipe_scraper 2021-05-20 11:57:05 -05:00
vabene1111
03c78f539d fixed ordering 2021-05-20 17:16:25 +02:00
vabene1111
be225d2b8c added ignore duplication option in import again 2021-05-20 17:03:47 +02:00
vabene1111
3340ef9ca4 small importer fix 2021-05-20 16:52:51 +02:00
vabene1111
fe3e611dd1 show recently added recipes in search 2021-05-20 16:45:41 +02:00
vabene1111
61d1528911 small improvements 2021-05-20 14:50:23 +02:00
vabene1111
88524b0411 Merge pull request #565 from smilerz/login_redirect
login redirect to intended page
2021-05-20 14:47:24 +02:00
vabene1111
e774845ade fixed and updates openapi shema 2021-05-20 11:43:31 +02:00
vabene1111
9a8049f71b fixed nextcloud importer ignoring certain recipes 2021-05-20 11:17:45 +02:00
vabene1111
d67bb9de25 fixed mealplan update non recipe entries 2021-05-19 13:12:12 +02:00
vabene1111
4b7896f7d1 auto open/close shopping list when checked 2021-05-19 12:58:34 +02:00
vabene1111
66ce1a88f6 Merge pull request #620 from vabene1111/dependabot/pip/jinja2-3.0.1
Bump jinja2 from 3.0.0 to 3.0.1
2021-05-19 08:49:10 +02:00
vabene1111
9ad42ae869 Merge pull request #619 from vabene1111/dependabot/pip/recipe-scrapers-13.2.5
Bump recipe-scrapers from 13.2.3 to 13.2.5
2021-05-19 08:49:00 +02:00
dependabot[bot]
1e72893c84 Bump jinja2 from 3.0.0 to 3.0.1
Bumps [jinja2](https://github.com/pallets/jinja) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.0.0...3.0.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-19 05:46:08 +00:00
dependabot[bot]
a21755cf81 Bump recipe-scrapers from 13.2.3 to 13.2.5
Bumps [recipe-scrapers](https://github.com/hhursev/recipe-scrapers) from 13.2.3 to 13.2.5.
- [Release notes](https://github.com/hhursev/recipe-scrapers/releases)
- [Commits](https://github.com/hhursev/recipe-scrapers/compare/13.2.3...13.2.5)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-19 05:46:02 +00:00
vabene1111
f0ba8eb788 recettetek importer 2021-05-18 18:47:53 +02:00
vabene1111
149020f930 fixed shopping list escaping issue 2021-05-18 18:20:41 +02:00
vabene1111
200adb2fcf fixed zero rating issue 2021-05-18 18:20:08 +02:00
vabene1111
bbd4d20210 uniqueness fixes 2021-05-18 18:20:08 +02:00
vabene1111
8aa11836a3 fixed webpack update and added documentation for new env variable 2021-05-18 18:20:08 +02:00
vabene1111
35338e2765 Merge pull request #578 from itsmegb/importer-recetteke
New Importer - RecetteTek
2021-05-18 18:20:02 +02:00
vabene1111
ddc91d910f Merge pull request #425 from tourn/database-url
Add support for DATABASE_URL env var
2021-05-18 16:30:54 +02:00
vabene1111
34085fc949 Merge pull request #616 from lbarnett83/patch-1
Update authentication.md
2021-05-18 10:10:21 +02:00
vabene1111
4ab56ef9f7 Merge pull request #618 from vabene1111/dependabot/pip/django-tables2-2.4.0
Bump django-tables2 from 2.3.4 to 2.4.0
2021-05-18 10:09:46 +02:00
vabene1111
47b873a2af Merge pull request #604 from sebimarkgraf/fix/rtl-input
Fix servings input field text direction
2021-05-18 10:07:33 +02:00
dependabot[bot]
34128ba3a3 Bump django-tables2 from 2.3.4 to 2.4.0
Bumps [django-tables2](https://github.com/jieter/django-tables2) from 2.3.4 to 2.4.0.
- [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.3.4...v2.4.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-18 07:14:00 +00:00
vabene1111
fae25b83fa Merge pull request #609 from vabene1111/dependabot/pip/recipe-scrapers-13.2.3
Bump recipe-scrapers from 13.2.1 to 13.2.3
2021-05-18 08:53:47 +02:00
vabene1111
a2322c18eb Merge pull request #610 from vabene1111/dependabot/pip/jinja2-3.0.0
Bump jinja2 from 2.11.3 to 3.0.0
2021-05-18 08:53:42 +02:00
vabene1111
f99793fc1a Merge branch 'develop' into dependabot/pip/jinja2-3.0.0 2021-05-18 08:53:38 +02:00
vabene1111
b10b811550 Merge pull request #612 from vabene1111/dependabot/pip/django-webpack-loader-1.0.0
Bump django-webpack-loader from 0.7.0 to 1.0.0
2021-05-18 08:53:13 +02:00
vabene1111
792ee43377 Merge pull request #614 from vabene1111/dependabot/pip/django-3.2.3
Bump django from 3.2.2 to 3.2.3
2021-05-18 08:53:08 +02:00
vabene1111
157beb3376 Merge pull request #617 from vabene1111/dependabot/pip/pytest-django-4.3.0
Bump pytest-django from 4.2.0 to 4.3.0
2021-05-18 08:52:57 +02:00
dependabot[bot]
1313c962fa Bump pytest-django from 4.2.0 to 4.3.0
Bumps [pytest-django](https://github.com/pytest-dev/pytest-django) from 4.2.0 to 4.3.0.
- [Release notes](https://github.com/pytest-dev/pytest-django/releases)
- [Changelog](https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst)
- [Commits](https://github.com/pytest-dev/pytest-django/compare/v4.2.0...v4.3.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-17 06:29:50 +00:00
Master_of_Pants
17c18c6d08 Update authentication.md
Added a semi-colon that while missing would cause a reverse proxy failure.
2021-05-16 23:47:11 -06:00
tourn
7650edfdc8 Merge remote-tracking branch 'upstream/develop' into database-url 2021-05-15 11:19:52 +02:00
tourn
46e48cd3a5 Parse DATABASE_URL with regex 2021-05-15 11:17:14 +02:00
dependabot[bot]
223f899e88 Bump django from 3.2.2 to 3.2.3
Bumps [django](https://github.com/django/django) from 3.2.2 to 3.2.3.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/3.2.2...3.2.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-14 05:37:29 +00:00
vabene1111
d56c8c283c Merge pull request #613 from jdtimmerman/patch-1
Fix nginx_proxy docker-compose example
2021-05-13 13:54:51 +02:00
Joost Timmerman
67cd74860f Fix nginx_proxy docker-compose example
A copy/paste error probably?
2021-05-13 11:15:31 +02:00
dependabot[bot]
4df87bc7c7 Bump django-webpack-loader from 0.7.0 to 1.0.0
Bumps [django-webpack-loader](https://github.com/django-webpack/django-webpack-loader) from 0.7.0 to 1.0.0.
- [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/0.7.0...1.0.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-13 05:50:47 +00:00
dependabot[bot]
16237866a1 Bump jinja2 from 2.11.3 to 3.0.0
Bumps [jinja2](https://github.com/pallets/jinja) from 2.11.3 to 3.0.0.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/2.11.3...3.0.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-12 05:16:06 +00:00
dependabot[bot]
79cc8cc905 Bump recipe-scrapers from 13.2.1 to 13.2.3
Bumps [recipe-scrapers](https://github.com/hhursev/recipe-scrapers) from 13.2.1 to 13.2.3.
- [Release notes](https://github.com/hhursev/recipe-scrapers/releases)
- [Commits](https://github.com/hhursev/recipe-scrapers/compare/13.2.1...13.2.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-10 07:06:23 +00:00
vabene1111
3e2f3effeb Merge pull request #607 from vabene1111/dependabot/pip/django-3.2.2
Bump django from 3.2.1 to 3.2.2
2021-05-07 07:57:30 +02:00
dependabot[bot]
5623879919 Bump django from 3.2.1 to 3.2.2
Bumps [django](https://github.com/django/django) from 3.2.1 to 3.2.2.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/3.2.1...3.2.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-07 05:53:59 +00:00
vabene1111
b1b1373d65 Merge pull request #606 from vabene1111/dependabot/pip/six-1.16.0
Bump six from 1.15.0 to 1.16.0
2021-05-06 07:57:34 +02:00
dependabot[bot]
3270f56744 Bump six from 1.15.0 to 1.16.0
Bumps [six](https://github.com/benjaminp/six) from 1.15.0 to 1.16.0.
- [Release notes](https://github.com/benjaminp/six/releases)
- [Changelog](https://github.com/benjaminp/six/blob/master/CHANGES)
- [Commits](https://github.com/benjaminp/six/compare/1.15.0...1.16.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-06 05:53:28 +00:00
Sebastian Markgraf
36df86c26c Change minimum of input field to be 0. 2021-05-05 18:11:30 +02:00
Sebastian Markgraf
532d6e2867 Fix rtl input field. 2021-05-05 17:09:31 +02:00
vabene1111
7c6d32456a Merge pull request #603 from vabene1111/dependabot/pip/pytest-6.2.4
Bump pytest from 6.2.3 to 6.2.4
2021-05-05 11:55:24 +02:00
vabene1111
6b8aa99b24 Merge pull request #602 from vabene1111/dependabot/pip/django-3.2.1
Bump django from 3.2 to 3.2.1
2021-05-05 11:55:14 +02:00
dependabot[bot]
65a6c08015 Bump pytest from 6.2.3 to 6.2.4
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.3 to 6.2.4.
- [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/6.2.3...6.2.4)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-05 05:52:46 +00:00
dependabot[bot]
22f4612d12 Bump django from 3.2 to 3.2.1
Bumps [django](https://github.com/django/django) from 3.2 to 3.2.1.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/3.2...3.2.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-05 05:52:39 +00:00
Jesse
f65a5a9ad7 Translated using Weblate (Dutch)
Currently translated at 100.0% (50 of 50 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/nl/
2021-05-04 09:02:55 +00:00
Jesse
02b2d953ce Translated using Weblate (Dutch)
Currently translated at 100.0% (371 of 371 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/nl/
2021-05-04 09:02:54 +00:00
vabene1111
19cdf3a919 Merge pull request #600 from smilerz/develop
minor bug fix in bookmarklet
2021-05-03 19:00:03 +02:00
smilerz
6dfe737ec5 minor bug fix in bookmarklet 2021-05-03 08:40:09 -05:00
vabene1111
6110c75f59 Merge pull request #598 from smilerz/develop
updated to handle new behavior of recipe_scrapers
2021-05-03 07:49:37 +02:00
smilerz
984d5aae11 misc cleanup 2021-05-02 20:06:53 -05:00
smilerz
e345d2eb39 updated to handle new behavior of recipe_scrapers 2021-05-02 15:44:27 -05:00
vabene1111
90e1e69dac Merge pull request #515 from smilerz/bookmarklet
Bookmarklet
2021-05-02 17:41:46 +02:00
vabene1111
c4880bf5b0 Merge branch 'develop' into bookmarklet 2021-05-02 17:41:38 +02:00
vabene1111
3baa03396c tweaks to the importer 2021-05-02 17:33:52 +02:00
vabene1111
373df5d99f updated python in ci 2021-05-02 13:44:59 +02:00
vabene1111
d36274066a some fixed for the new importer + bumped python to 3.9 2021-05-02 13:42:14 +02:00
smilerz
59c33798b8 Fix after rebase 2021-05-01 16:30:33 -05:00
smilerz
d7afbc5745 truncate query params on url 2021-05-01 16:30:23 -05:00
smilerz
c62a88d032 include script name prefix in bookmarklet 2021-05-01 16:30:23 -05:00
smilerz
ed76f020c5 fix loading bookmarklet 2021-05-01 16:30:23 -05:00
smilerz
8b61d8c504 no_perm 2021-05-01 16:30:23 -05:00
smilerz
82abdd0144 removed unnecessary console message 2021-05-01 16:30:23 -05:00
smilerz
04d131f534 removed commented out settings 2021-05-01 16:30:22 -05:00
smilerz
8cc74f3dcd removed unused cors_headers 2021-05-01 16:30:22 -05:00
smilerz
bd46962b71 removed line breaks 2021-05-01 16:30:22 -05:00
smilerz
059987fd9f removed console.log() 2021-05-01 16:30:22 -05:00
smilerz
2ecc0ab680 Fix after rebase 2021-05-01 16:30:22 -05:00
smilerz
a69fb4922d updated model 2021-05-01 16:30:22 -05:00
smilerz
358ba5120d convert servings to number on import 2021-05-01 16:30:22 -05:00
smilerz
254267c2a7 update tests to handle url decoding 2021-05-01 16:30:22 -05:00
smilerz
a701437548 bring parser inline with json_import branch 2021-05-01 16:30:22 -05:00
smilerz
25f6adba1f unescape html document 2021-05-01 16:30:22 -05:00
smilerz
018fa0a62f updated bookmarklet to work with updated import process 2021-05-01 16:30:22 -05:00
smilerz
faf458e8ef Squashed commit of the following:
commit 707d862e01a7497a1f22879d314b865a35e0e85b
Author: smilerz <smilerz@gmail.com>
Date:   Wed Apr 14 10:35:00 2021 -0500

    works now

commit 3942a445ed4f2ccec57de25eacd86ea4e4dd6bdb
Author: smilerz <smilerz@gmail.com>
Date:   Wed Apr 14 10:25:24 2021 -0500

    updated serializer and api

commit 10dc746eb175c7f805a8a8ffa7ce49977a7ce97e
Author: smilerz <smilerz@gmail.com>
Date:   Wed Apr 14 10:20:19 2021 -0500

    fixed bookmarklet

commit 9779104902d3be0258c95cd2eeebcba0d5d48892
Merge: bb8262c 0cb3928
Author: smilerz <smilerz@gmail.com>
Date:   Wed Apr 14 09:56:27 2021 -0500

    Merge branch 'bookmarklet' into json_import

commit 0cb39284bb835ffc6cfee3e4306aadc4a64a25be
Author: smilerz <smilerz@gmail.com>
Date:   Wed Apr 14 09:42:53 2021 -0500

    retrieve bookmarklet ID from get

commit e89e0218de684d40b2e2bfb6ba833891206c828e
Author: smilerz <smilerz@gmail.com>
Date:   Wed Apr 14 09:29:33 2021 -0500

    Revert "fixed broken tab"

    This reverts commit ca0a1aede3cc6cb3912bc1fe30c0aa22e3f481a6.

commit bb8262ccabb93c56fbc18c407d5a0653b8b3ca79
Merge: b1e73aa 35a7f62
Author: smilerz <smilerz@gmail.com>
Date:   Sun Apr 11 20:35:57 2021 -0500

    Merge branch 'main_fork' into json_import
2021-05-01 16:30:22 -05:00
smilerz
2c5348fcb4 added missing bookmarklet 2021-05-01 16:30:22 -05:00
smilerz
2b16f966a2 Revert "bug fix url import"
This reverts commit 4ab8ca51e812d02911f4da801767612e52953a23.
2021-05-01 16:30:22 -05:00
smilerz
c2931137bb removed extra string normalization 2021-05-01 16:30:22 -05:00
smilerz
461d53671c updated migration 2021-05-01 16:30:22 -05:00
smilerz
3e4e55e9c5 updated recipe targets in tests to reflect html decoding 2021-05-01 16:30:22 -05:00
smilerz
11fa23f3da fixes #527 2021-05-01 16:30:22 -05:00
smilerz
6de128757f bug fix url import 2021-05-01 16:30:22 -05:00
smilerz
7c682ebab3 url import bug fixes 2021-05-01 16:30:22 -05:00
smilerz
ee165ef0f1 bug fix tests 2021-05-01 16:30:22 -05:00
smilerz
4bc4ce0d7c bug fix url import 2021-05-01 16:30:22 -05:00
smilerz
c50bd039ef recipe import tests 2021-05-01 16:30:22 -05:00
smilerz
5fff5b97da simplified url import 2021-05-01 16:30:21 -05:00
smilerz
2c27e06bfb add data for url_import test 2021-05-01 16:30:21 -05:00
smilerz
e4044016c3 added all ATK sites to custom scraper 2021-05-01 16:30:21 -05:00
smilerz
52df886372 added cooksillustrated custom scraper 2021-05-01 16:30:21 -05:00
smilerz
c7949edb18 ensure time is always a number 2021-05-01 16:30:21 -05:00
smilerz
342a261017 added ability to create custom scrapers 2021-05-01 16:30:21 -05:00
smilerz
e5984abd97 removed old json importer 2021-05-01 16:30:21 -05:00
smilerz
2ea3e4f8f3 updated import from source to use text scraper 2021-05-01 16:30:21 -05:00
smilerz
98b3b002f9 remove old html_import function 2021-05-01 16:30:21 -05:00
smilerz
d2a1a0ac32 wrapper for recipe_scrapers to parse text input 2021-05-01 16:30:21 -05:00
smilerz
2ceefdd9b0 fixed broken tab 2021-05-01 16:30:21 -05:00
smilerz
b22392726f delete bookmarklet on import 2021-05-01 16:30:21 -05:00
smilerz
b89fedd07f removed console message 2021-05-01 16:30:21 -05:00
smilerz
a263771383 fixed ingredient display on preview 2021-05-01 16:30:21 -05:00
smilerz
7cc757ac33 redirect to import url for processing 2021-05-01 16:30:21 -05:00
smilerz
6acbd6d308 added hack to fix scopes & CORS for bookmarklet 2021-05-01 16:30:21 -05:00
smilerz
30a357e27f added CORS middleware 2021-05-01 16:30:21 -05:00
smilerz
7bc3292301 added bookmarklet model and api 2021-05-01 16:30:21 -05:00
smilerz
7fb440a855 bookmarklet passing data to form 2021-05-01 16:30:21 -05:00
smilerz
0e27ddab74 added bookmarklet that doesn't work yet 2021-05-01 16:30:21 -05:00
smilerz
0a38049ce4 Squashed commit of the following:
commit 81a8734fac
Merge: abcef54 f67bb3c
Author: vabene1111 <vabene1111@users.noreply.github.com>
Date:   Sat Mar 20 22:41:13 2021 +0100

    Merge pull request #499 from sebimarkgraf/fix/432-ios-webclip-support

    Add iOS webclip icon support

commit abcef54e72
Merge: e15c92c 7527646
Author: vabene1111 <vabene1111@users.noreply.github.com>
Date:   Sat Mar 20 22:30:43 2021 +0100

    Merge pull request #498 from vabene1111/dependabot/pip/recipe-scrapers-12.2.1

    Bump recipe-scrapers from 12.2.0 to 12.2.1

commit e15c92cda5
Merge: 58fc269 45dba6f
Author: vabene1111 <vabene1111@users.noreply.github.com>
Date:   Sat Mar 20 22:26:06 2021 +0100

    Merge pull request #501 from smilerz/main_fork

    fix json direct import when wrapped in @graph

commit 45dba6fad2
Author: smilerz <smilerz@gmail.com>
Date:   Fri Mar 19 13:23:55 2021 -0500

    fix json direct import when wrapped in @graph

commit f67bb3cb98
Author: Sebastian Markgraf <Sebastian-Markgraf@t-online.de>
Date:   Fri Mar 19 15:49:12 2021 +0100

    Add generated icons from icongenerator.

commit 53b584da56
Author: Sebastian Markgraf <Sebastian-Markgraf@t-online.de>
Date:   Fri Mar 19 12:48:58 2021 +0100

    Fix errors in favicon SVG.

commit 7527646319
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Mar 19 05:51:22 2021 +0000

    Bump recipe-scrapers from 12.2.0 to 12.2.1

    Bumps [recipe-scrapers](https://github.com/hhursev/recipe-scrapers) from 12.2.0 to 12.2.1.
    - [Release notes](https://github.com/hhursev/recipe-scrapers/releases)
    - [Commits](https://github.com/hhursev/recipe-scrapers/compare/12.2.0...12.2.1)

    Signed-off-by: dependabot[bot] <support@github.com>
2021-05-01 16:30:21 -05:00
smilerz
4aaecb4ada updated links to import recipes 2021-05-01 16:30:21 -05:00
smilerz
3f5e64fc4a added collapsable cards 2021-05-01 16:30:21 -05:00
smilerz
154527ef1b cosmetic cleanup 2021-05-01 16:30:21 -05:00
smilerz
788e253749 added image import 2021-05-01 16:30:21 -05:00
smilerz
7c8b489857 consolidated integration imports into url_import 2021-05-01 16:30:21 -05:00
smilerz
cdc25b480d staged app import tabs 2021-05-01 16:30:21 -05:00
smilerz
1568d86143 fixed missing space in keyword when adding recipe 2021-05-01 16:30:21 -05:00
smilerz
adeb360837 removed unused templates 2021-05-01 16:30:20 -05:00
smilerz
9cc6a1dc79 combined json import and source import 2021-05-01 16:30:20 -05:00
smilerz
6a13619bbd more fix from super ugly merge 2021-05-01 16:30:20 -05:00
smilerz
58e33ef31a more cleanup from ugly merge 2021-05-01 16:30:20 -05:00
smilerz
36841d74af fixed ugly merge 2021-05-01 16:30:20 -05:00
smilerz
8094c7d53a added drag and drop to ingredients 2021-05-01 16:30:20 -05:00
smilerz
71e02c0916 manually parse json 2021-05-01 16:30:20 -05:00
smilerz
25fb41baed update urls.py 2021-05-01 16:30:20 -05:00
smilerz
34ff484830 commit merge from Patralos/recipes 2021-05-01 16:30:20 -05:00
smilerz
91e36eb222 updated URL import page with tab interface 2021-05-01 16:30:20 -05:00
smilerz
55ba568f3c import raw json/html 2021-05-01 16:30:20 -05:00
smilerz
8f3f1c230c refactored json parser to create functions for each sub parser 2021-05-01 16:30:20 -05:00
Patrick Pirker
1690abaf47 replace common fractions with their concrete value (else parsing is not possible) 2021-05-01 16:30:20 -05:00
Patrick Pirker
7414033495 Allow recipes to be imported from json directly 2021-05-01 16:30:20 -05:00
vabene1111
d1b9d15816 recipe_scrapers deprectation fix 2021-05-01 22:56:00 +02:00
vabene1111
ff43492265 Merge pull request #505 from smilerz/json_import
Manually Import Recipe
2021-05-01 22:39:27 +02:00
vabene1111
3daebc4170 Merge branch 'develop' into json_import 2021-05-01 22:39:20 +02:00
vabene1111
67485c0ea3 Merge pull request #585 from TimPansino/develop
Fix crash on missing photos in paprika
2021-05-01 22:18:27 +02:00
vabene1111
aafbc497cc search view fixes/updates 2021-05-01 22:16:29 +02:00
vabene1111
0a99791021 Merge branch 'develop' of https://github.com/vabene1111/recipes into develop 2021-05-01 19:20:23 +02:00
vabene1111
7bc4ae9870 fixed paprika importer 2021-05-01 19:19:48 +02:00
vabene1111
84bd33f93e Merge pull request #590 from vabene1111/dependabot/pip/python-dotenv-0.17.1
Bump python-dotenv from 0.17.0 to 0.17.1
2021-05-01 17:26:26 +02:00
its_me_gb
7cd6a7c2a6 Import recipe keywords 2021-05-01 15:02:22 +01:00
Marcel Paluch
c661646f46 Translated using Weblate (German)
Currently translated at 100.0% (50 of 50 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/de/
2021-05-01 13:01:56 +00:00
Marcel Paluch
7a017899ee Translated using Weblate (German)
Currently translated at 99.7% (370 of 371 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/de/
2021-05-01 13:01:55 +00:00
its_me_gb
0ec29636b3 Add original source url to the first recipe step 2021-04-30 09:14:31 +01:00
its_me_gb
5ef5530392 Move the source url back into the step - inline with other importers 2021-04-30 08:40:00 +01:00
dependabot[bot]
689c447b6c Bump python-dotenv from 0.17.0 to 0.17.1
Bumps [python-dotenv](https://github.com/theskumar/python-dotenv) from 0.17.0 to 0.17.1.
- [Release notes](https://github.com/theskumar/python-dotenv/releases)
- [Changelog](https://github.com/theskumar/python-dotenv/blob/master/CHANGELOG.md)
- [Commits](https://github.com/theskumar/python-dotenv/compare/v0.17.0...v0.17.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-30 05:51:53 +00:00
vabene1111
239ba5f861 fixed meal plan notes and recipe links 2021-04-29 17:15:06 +02:00
Timothy Pansino
43c71af2af Fix crash on missing photos in paprika 2021-04-28 20:22:12 -07:00
its_me_gb
b9040cb3a4 parse the servings 2021-04-28 18:41:26 +01:00
its_me_gb
c710d42ccb Add the source url to description not step 2021-04-28 17:50:05 +01:00
its_me_gb
1bc5af1cab import local image, download if fails. 2021-04-28 13:47:51 +01:00
its_me_gb
23415f8a61 Initial importer created. 2021-04-28 13:47:51 +01:00
its_me_gb
d00fa10b9f Import the recipe image from the zip file. 2021-04-28 13:16:55 +01:00
vabene1111
cc34496c00 added missing files last commit 2021-04-28 11:27:28 +02:00
vabene1111
be84e44e43 recipe view enhancements 2021-04-28 11:27:20 +02:00
vabene1111
ae3eb6cfe5 removed one more old bundle render 2021-04-28 09:46:52 +02:00
vabene1111
d06e6c0ab3 updated webpack loader and lots of javscript stuff 2021-04-28 09:41:06 +02:00
its_me_gb
eba3bfa828 Basic import functionality working 2021-04-27 15:32:07 +01:00
vabene1111
5ee718b578 added persistent search settings and tweaked view 2021-04-26 18:00:54 +02:00
its_me_gb
6e91f34779 add RecipeKeeper as an import/export method 2021-04-26 16:55:08 +01:00
vabene1111
dc27f39393 added recently viewed to new search 2021-04-26 17:21:14 +02:00
vabene1111
ec95f8032c fixed recipe url import issue on some pages without images 2021-04-26 16:41:48 +02:00
vabene1111
94b56ff742 Merge pull request #567 from vabene1111/dependabot/pip/django-cleanup-5.2.0
Bump django-cleanup from 5.1.0 to 5.2.0
2021-04-26 16:39:53 +02:00
vabene1111
fd1258f851 Merge pull request #569 from vabene1111/dependabot/npm_and_yarn/vue/ssri-6.0.2
Bump ssri from 6.0.1 to 6.0.2 in /vue
2021-04-26 16:39:40 +02:00
vabene1111
6f104d8aa4 Merge pull request #572 from vabene1111/dependabot/pip/recipe-scrapers-13.1.1
Bump recipe-scrapers from 12.2.2 to 13.1.1
2021-04-26 16:39:25 +02:00
Jesse
d35f8a0ccd Translated using Weblate (Dutch)
Currently translated at 100.0% (46 of 46 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/nl/
2021-04-22 18:29:10 +00:00
Jesse
f2d761f7d9 Translated using Weblate (Dutch)
Currently translated at 100.0% (371 of 371 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/nl/
2021-04-22 18:29:10 +00:00
dependabot[bot]
d9a92fac95 Bump recipe-scrapers from 12.2.2 to 13.1.1
Bumps [recipe-scrapers](https://github.com/hhursev/recipe-scrapers) from 12.2.2 to 13.1.1.
- [Release notes](https://github.com/hhursev/recipe-scrapers/releases)
- [Commits](https://github.com/hhursev/recipe-scrapers/compare/12.2.2...13.1.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-21 05:52:07 +00:00
smilerz
a1572a4809 changed keyword to get_or_create 2021-04-20 09:15:03 -05:00
smilerz
2b5dceee7c WIP 2021-04-20 08:09:42 -05:00
dependabot[bot]
62e9a7f29c Bump ssri from 6.0.1 to 6.0.2 in /vue
Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/npm/ssri/releases)
- [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md)
- [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-20 02:40:53 +00:00
smilerz
66bb5b4328 strip spaces from food, keywords and units 2021-04-19 17:35:53 -05:00
smilerz
0f4cd4b17c fix ATK scraper 2021-04-19 14:37:26 -05:00
smilerz
ae3835b541 update ATK scraper 2021-04-19 14:31:48 -05:00
dependabot[bot]
28fedfda1f Bump django-cleanup from 5.1.0 to 5.2.0
Bumps [django-cleanup](https://github.com/un1t/django-cleanup) from 5.1.0 to 5.2.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/5.1.0...5.2.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-19 07:30:31 +00:00
vabene1111
92c65ec1e8 fixed test meal plan 2021-04-18 21:21:41 +02:00
vabene1111
a376c3a5b6 meal plan random fix 2021-04-18 17:55:48 +02:00
vabene1111
058d705170 meal plan in search 2021-04-18 17:19:11 +02:00
vabene1111
4ad5d6ef2f fixed test + added api doc for new search 2021-04-18 15:01:39 +02:00
vabene1111
e676b4bac3 added api pagination for recipes 2021-04-18 14:05:19 +02:00
vabene1111
04488741c4 adv search mobile styling 2021-04-18 11:11:19 +02:00
vabene1111
99004ad34b new search and setting 2021-04-18 11:03:15 +02:00
vabene1111
f78f7dfc14 search ui improvements and filter 2021-04-18 02:55:50 +02:00
smilerz
49fb1e7183 login redirect to intended page 2021-04-17 18:34:56 -05:00
smilerz
7930c2417c update ATK scrape to handle empty headnote 2021-04-17 17:12:43 -05:00
vabene1111
880db58d38 v2 search filtering 2021-04-17 21:28:29 +02:00
smilerz
2f27413c0a parse multiple ingredientGroups
previous version assumed only a single item in a list - this loops through each item
2021-04-17 14:12:24 -05:00
smilerz
5869a8ad1b fixes to pass tests 2021-04-17 13:43:34 -05:00
smilerz
0640a265fc added test for spruce eats 2021-04-17 13:42:56 -05:00
smilerz
d449fc8fd8 updated normalization to skip removing line breaks 2021-04-17 12:49:42 -05:00
smilerz
b9ee77709b updated ATK scraper to include header notes in instructions 2021-04-17 12:49:06 -05:00
smilerz
f594ba4c69 enable import button after error 2021-04-17 11:12:22 -05:00
vabene1111
d1d65d878c v2 search progress 2021-04-17 14:11:10 +02:00
vabene1111
3194a7580d basics of v2 search working 2021-04-17 12:57:02 +02:00
smilerz
ba061df1b6 catch attribute error on cooktime 2021-04-16 17:30:59 -05:00
smilerz
7cc515bcdf fix manual url import 2021-04-16 17:08:25 -05:00
smilerz
724748d38a corrected api import workflow 2021-04-16 14:09:10 -05:00
smilerz
b2c1c6e301 restored missing manual url scrape 2021-04-16 11:26:26 -05:00
smilerz
987be4b04d Fix after rebase 2021-04-16 09:02:27 -05:00
smilerz
ca84da68c4 catch attibute error when scrape missing schema 2021-04-16 09:02:04 -05:00
smilerz
d75e39fbcd set persistent connections to db 2021-04-16 09:02:04 -05:00
smilerz
eb2593aacd handle text in cook times during import 2021-04-16 09:02:04 -05:00
smilerz
496e04cfc8 convert servings to number on import 2021-04-16 09:02:04 -05:00
smilerz
d814d13d54 custom scraper fails safe 2021-04-16 09:02:03 -05:00
smilerz
d0cedaf7a1 added name parser 2021-04-16 09:02:03 -05:00
smilerz
01f504f7b1 updated tests to handle html decoding 2021-04-16 09:02:03 -05:00
smilerz
c716346f1f flake 2021-04-16 09:02:03 -05:00
smilerz
fef5236931 decode url strings in text_parser 2021-04-16 09:02:03 -05:00
smilerz
b115c37eb8 catch error on scrape.image() 2021-04-16 09:02:03 -05:00
smilerz
1e17f3703a trap error on scrape.title() 2021-04-16 09:02:03 -05:00
smilerz
468b986314 updated tests 2021-04-16 09:02:03 -05:00
smilerz
a531d135b5 remove html tags from description 2021-04-16 09:02:03 -05:00
smilerz
7524609cd0 retrieve bookmarklet ID from get 2021-04-16 09:02:03 -05:00
smilerz
a28f8e65d5 Revert "fixed broken tab"
This reverts commit ca0a1aede3cc6cb3912bc1fe30c0aa22e3f481a6.
2021-04-16 09:02:03 -05:00
smilerz
d193637091 added missing bookmarklet 2021-04-16 09:02:03 -05:00
smilerz
0953af05fc Revert "bug fix url import"
This reverts commit 4ab8ca51e812d02911f4da801767612e52953a23.
2021-04-16 09:02:03 -05:00
smilerz
19e8e5cb5b removed extra string normalization 2021-04-16 09:02:03 -05:00
smilerz
43c808380d updated migration 2021-04-16 09:02:03 -05:00
smilerz
7ab8b84044 updated recipe targets in tests to reflect html decoding 2021-04-16 09:02:03 -05:00
smilerz
d739fe6752 fixes #527 2021-04-16 09:02:03 -05:00
smilerz
a84c41e29f bug fix url import 2021-04-16 09:02:03 -05:00
smilerz
393aba1f31 url import bug fixes 2021-04-16 09:02:03 -05:00
smilerz
436a070730 bug fix tests 2021-04-16 09:02:03 -05:00
smilerz
2fe6788ce5 bug fix url import 2021-04-16 09:02:03 -05:00
smilerz
747d146389 recipe import tests 2021-04-16 09:02:03 -05:00
smilerz
efe4c4043d simplified url import 2021-04-16 09:02:03 -05:00
smilerz
c6739ba8e0 add data for url_import test 2021-04-16 09:02:02 -05:00
smilerz
50140db668 added all ATK sites to custom scraper 2021-04-16 09:02:02 -05:00
smilerz
028b2dfb22 added cooksillustrated custom scraper 2021-04-16 09:02:02 -05:00
smilerz
ec6a10ca0a ensure time is always a number 2021-04-16 09:02:02 -05:00
smilerz
3cf949bf8d added ability to create custom scrapers 2021-04-16 09:02:02 -05:00
smilerz
0a62225797 removed old json importer 2021-04-16 09:02:02 -05:00
smilerz
a54f4e1367 updated import from source to use text scraper 2021-04-16 09:02:02 -05:00
smilerz
bf3c30a8fb remove old html_import function 2021-04-16 09:02:02 -05:00
smilerz
f811f5996e wrapper for recipe_scrapers to parse text input 2021-04-16 09:02:02 -05:00
smilerz
a3490240f4 fixed broken tab 2021-04-16 09:02:02 -05:00
smilerz
b26aea96f4 delete bookmarklet on import 2021-04-16 09:02:02 -05:00
smilerz
4d4af5fdf2 removed console message 2021-04-16 09:02:02 -05:00
smilerz
3da74505d6 fixed ingredient display on preview 2021-04-16 09:02:02 -05:00
smilerz
c8a4861df8 redirect to import url for processing 2021-04-16 09:02:02 -05:00
smilerz
5e27cd606e added hack to fix scopes & CORS for bookmarklet 2021-04-16 09:02:02 -05:00
smilerz
a341fd8ebe added CORS middleware 2021-04-16 09:02:02 -05:00
smilerz
9a62b6e4e7 added bookmarklet model and api 2021-04-16 09:02:02 -05:00
smilerz
f80c44bca3 bookmarklet passing data to form 2021-04-16 09:02:02 -05:00
smilerz
09d2e9f831 added bookmarklet that doesn't work yet 2021-04-16 09:02:02 -05:00
smilerz
4d5a9e446f Squashed commit of the following:
commit 81a8734fac
Merge: abcef54 f67bb3c
Author: vabene1111 <vabene1111@users.noreply.github.com>
Date:   Sat Mar 20 22:41:13 2021 +0100

    Merge pull request #499 from sebimarkgraf/fix/432-ios-webclip-support

    Add iOS webclip icon support

commit abcef54e72
Merge: e15c92c 7527646
Author: vabene1111 <vabene1111@users.noreply.github.com>
Date:   Sat Mar 20 22:30:43 2021 +0100

    Merge pull request #498 from vabene1111/dependabot/pip/recipe-scrapers-12.2.1

    Bump recipe-scrapers from 12.2.0 to 12.2.1

commit e15c92cda5
Merge: 58fc269 45dba6f
Author: vabene1111 <vabene1111@users.noreply.github.com>
Date:   Sat Mar 20 22:26:06 2021 +0100

    Merge pull request #501 from smilerz/main_fork

    fix json direct import when wrapped in @graph

commit 45dba6fad2
Author: smilerz <smilerz@gmail.com>
Date:   Fri Mar 19 13:23:55 2021 -0500

    fix json direct import when wrapped in @graph

commit f67bb3cb98
Author: Sebastian Markgraf <Sebastian-Markgraf@t-online.de>
Date:   Fri Mar 19 15:49:12 2021 +0100

    Add generated icons from icongenerator.

commit 53b584da56
Author: Sebastian Markgraf <Sebastian-Markgraf@t-online.de>
Date:   Fri Mar 19 12:48:58 2021 +0100

    Fix errors in favicon SVG.

commit 7527646319
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Mar 19 05:51:22 2021 +0000

    Bump recipe-scrapers from 12.2.0 to 12.2.1

    Bumps [recipe-scrapers](https://github.com/hhursev/recipe-scrapers) from 12.2.0 to 12.2.1.
    - [Release notes](https://github.com/hhursev/recipe-scrapers/releases)
    - [Commits](https://github.com/hhursev/recipe-scrapers/compare/12.2.0...12.2.1)

    Signed-off-by: dependabot[bot] <support@github.com>
2021-04-16 09:02:02 -05:00
smilerz
6a2c27749f updated links to import recipes 2021-04-16 09:02:02 -05:00
smilerz
de60e12073 added collapsable cards 2021-04-16 09:02:02 -05:00
smilerz
1188ed9227 cosmetic cleanup 2021-04-16 09:02:02 -05:00
smilerz
cb708e7e47 added image import 2021-04-16 09:02:02 -05:00
smilerz
215eadb4a0 consolidated integration imports into url_import 2021-04-16 09:02:02 -05:00
smilerz
4ffc54f720 staged app import tabs 2021-04-16 09:02:02 -05:00
smilerz
21f6c7a21f fixed missing space in keyword when adding recipe 2021-04-16 09:02:02 -05:00
smilerz
ce7c6939d2 removed unused templates 2021-04-16 09:02:02 -05:00
smilerz
40a2f7ff90 combined json import and source import 2021-04-16 09:02:01 -05:00
smilerz
4015517c0a more fix from super ugly merge 2021-04-16 09:02:01 -05:00
smilerz
7c8d41753c more cleanup from ugly merge 2021-04-16 09:02:01 -05:00
smilerz
90670613c5 fixed ugly merge 2021-04-16 09:02:01 -05:00
smilerz
647c1678f1 added drag and drop to ingredients 2021-04-16 09:02:01 -05:00
smilerz
44dee16e0a manually parse json 2021-04-16 09:02:01 -05:00
smilerz
f8fedcac82 update urls.py 2021-04-16 09:02:01 -05:00
smilerz
3a48d0e580 commit merge from Patralos/recipes 2021-04-16 09:02:01 -05:00
smilerz
9930789aa8 updated URL import page with tab interface 2021-04-16 09:02:01 -05:00
smilerz
83fce6461a import raw json/html 2021-04-16 09:02:01 -05:00
smilerz
f0d37244b6 refactored json parser to create functions for each sub parser 2021-04-16 09:02:01 -05:00
Patrick Pirker
386834f409 Allow recipes to be imported from json directly 2021-04-16 09:02:01 -05:00
Jesse
17c5084bc0 Translated using Weblate (Dutch)
Currently translated at 100.0% (38 of 38 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/nl/
2021-04-16 12:22:10 +00:00
vabene1111
e38f50c352 v2 search basic display of recipes 2021-04-15 22:49:30 +02:00
vabene1111
c1abff8da0 v2 search basics 2021-04-15 22:12:31 +02:00
vabene1111
625c04257e added a small faq to the docs 2021-04-15 21:15:26 +02:00
vabene1111
5521c29d43 Merge pull request #550 from comradekingu/patch-1
Spelling: Log out
2021-04-15 18:45:17 +02:00
vabene1111
dc3a530928 Merge pull request #555 from smilerz/deprecation-fixes
Deprecation fixes
2021-04-15 18:43:40 +02:00
vabene1111
48f63b4d9f Merge pull request #552 from smilerz/main_fork
fixed tests to work in batch mode
2021-04-15 18:43:34 +02:00
vabene1111
1604ae51de Merge pull request #553 from vabene1111/dependabot/pip/pytest-django-4.2.0
Bump pytest-django from 4.1.0 to 4.2.0
2021-04-15 18:43:21 +02:00
vabene1111
a1502bffd1 translations doc 2021-04-15 18:43:02 +02:00
Jesse
756e5ec668 Added translation using Weblate (Dutch) 2021-04-15 11:23:53 +00:00
Olle Mineur
b9cf0a7136 Translated using Weblate (Swedish)
Currently translated at 97.3% (37 of 38 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/sv/
2021-04-12 20:22:10 +00:00
Olle Mineur
6bf72c4043 Translated using Weblate (Swedish)
Currently translated at 51.2% (190 of 371 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/sv/
2021-04-12 20:22:10 +00:00
vabene1111
f2f8342b49 Translated using Weblate (German)
Currently translated at 55.2% (21 of 38 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/de/
2021-04-12 20:22:09 +00:00
Jesse
7d82393789 Translated using Weblate (Dutch)
Currently translated at 100.0% (371 of 371 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/nl/
2021-04-12 20:22:08 +00:00
Hrachya Kocharyan
2254d6f072 Translated using Weblate (Armenian)
Currently translated at 100.0% (362 of 362 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/hy/
2021-04-12 20:22:08 +00:00
smilerz
8d02cad7d9 resolved deprecation warnings introduced in django 3.2 2021-04-12 14:12:04 -05:00
dependabot[bot]
5c12d00f49 Bump pytest-django from 4.1.0 to 4.2.0
Bumps [pytest-django](https://github.com/pytest-dev/pytest-django) from 4.1.0 to 4.2.0.
- [Release notes](https://github.com/pytest-dev/pytest-django/releases)
- [Changelog](https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst)
- [Commits](https://github.com/pytest-dev/pytest-django/compare/v4.1.0...v4.2.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-12 07:09:32 +00:00
smilerz
b37fc4e24f fixed tests to work in batch mode 2021-04-11 22:05:27 -05:00
vabene1111
35a7f62837 Added translation using Weblate (Swedish) 2021-04-11 19:15:56 +00:00
vabene1111
ffc1c5a99c Added translation using Weblate (Swedish) 2021-04-11 19:15:43 +00:00
vabene1111
fc2a60a4ba fixed postgres search 2021-04-11 21:02:47 +02:00
vabene1111
fb0f424d82 migrated new vue component system to vue native translations 2021-04-11 18:08:29 +02:00
vabene1111
ffb5291f4b code ql correction 2021-04-11 17:43:15 +02:00
vabene1111
77ba482b79 possible fixed code ql 2021-04-11 17:34:02 +02:00
vabene1111
abb0be69d8 Translated using Weblate (German)
Currently translated at 100.0% (5 of 5 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/de/
2021-04-11 15:29:28 +00:00
Allan Nordhøy
7bb23e8362 Translated using Weblate (Norwegian Bokmål)
Currently translated at 24.7% (92 of 371 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/nb_NO/
2021-04-11 15:23:07 +00:00
Oliver Cervera
cbb659da41 Translated using Weblate (Italian)
Currently translated at 100.0% (371 of 371 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/it/
2021-04-11 15:23:07 +00:00
vabene1111
52b0382243 Translated using Weblate (German)
Currently translated at 100.0% (371 of 371 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/de/
2021-04-11 15:23:07 +00:00
vabene1111
3371dc949a Translated using Weblate (German)
Currently translated at 100.0% (5 of 5 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/de/
2021-04-11 15:22:58 +00:00
vabene1111
49f026f2bd Added translation using Weblate (German) 2021-04-11 15:21:18 +00:00
vabene1111
cce373a522 started migrating frontend localization 2021-04-11 17:03:09 +02:00
Allan Nordhøy
b4b3e659de Spelling: Log out 2021-04-11 16:27:16 +02:00
Allan Nordhøy
f81500ec99 Added translation using Weblate (Norwegian Bokmål) 2021-04-11 14:18:57 +00:00
vabene1111
ecba13e97f added more docs 2021-04-11 16:09:04 +02:00
vabene1111
191a6c0d9b updated translation docs 2021-04-11 16:05:01 +02:00
vabene1111
52ba2be586 Translated using Weblate (German)
Currently translated at 99.4% (369 of 371 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/de/
2021-04-11 13:40:05 +00:00
vabene1111
36129b29b4 made and compiled messages 2021-04-11 15:09:54 +02:00
vabene1111
99e3690a42 Merge pull request #535 from vabene1111/translations_cookbook-locale-en-lc-messages-django-po--develop_hy
Translate '/cookbook/locale/en/LC_MESSAGES/django.po' in 'hy' [manual sync]
2021-04-11 14:09:17 +02:00
vabene1111
c780f81dd8 Merge pull request #536 from vabene1111/translations_cookbook-locale-en-lc-messages-django-po--develop_ca
Translate '/cookbook/locale/en/LC_MESSAGES/django.po' in 'ca' [manual sync]
2021-04-11 14:09:13 +02:00
vabene1111
27f5e85e11 Merge pull request #537 from vabene1111/translations_cookbook-locale-en-lc-messages-django-po--develop_cs
Translate '/cookbook/locale/en/LC_MESSAGES/django.po' in 'cs' [manual sync]
2021-04-11 14:09:09 +02:00
vabene1111
e6d9ffbb9c Merge pull request #538 from vabene1111/translations_cookbook-locale-en-lc-messages-django-po--develop_nl
Translate '/cookbook/locale/en/LC_MESSAGES/django.po' in 'nl' [manual sync]
2021-04-11 14:09:04 +02:00
vabene1111
3b188c3c55 Merge pull request #539 from vabene1111/translations_cookbook-locale-en-lc-messages-django-po--develop_fr
Translate '/cookbook/locale/en/LC_MESSAGES/django.po' in 'fr' [manual sync]
2021-04-11 14:09:00 +02:00
vabene1111
161e70dc9c Merge pull request #540 from vabene1111/translations_cookbook-locale-en-lc-messages-django-po--develop_de
Translate '/cookbook/locale/en/LC_MESSAGES/django.po' in 'de' [manual sync]
2021-04-11 14:08:55 +02:00
vabene1111
1f80df262b Merge pull request #541 from vabene1111/translations_cookbook-locale-en-lc-messages-django-po--develop_hu_HU
Translate '/cookbook/locale/en/LC_MESSAGES/django.po' in 'hu_HU' [manual sync]
2021-04-11 14:08:51 +02:00
vabene1111
9928675f48 Merge pull request #542 from vabene1111/translations_cookbook-locale-en-lc-messages-django-po--develop_it
Translate '/cookbook/locale/en/LC_MESSAGES/django.po' in 'it' [manual sync]
2021-04-11 14:08:47 +02:00
vabene1111
3d925b29c2 Merge pull request #543 from vabene1111/translations_cookbook-locale-en-lc-messages-django-po--develop_lv
Translate '/cookbook/locale/en/LC_MESSAGES/django.po' in 'lv' [manual sync]
2021-04-11 14:08:43 +02:00
vabene1111
4825317a58 Merge pull request #544 from vabene1111/translations_cookbook-locale-en-lc-messages-django-po--develop_pl
Translate '/cookbook/locale/en/LC_MESSAGES/django.po' in 'pl' [manual sync]
2021-04-11 14:08:39 +02:00
vabene1111
9a5408e996 Merge pull request #545 from vabene1111/translations_cookbook-locale-en-lc-messages-django-po--develop_pt
Translate '/cookbook/locale/en/LC_MESSAGES/django.po' in 'pt' [manual sync]
2021-04-11 14:08:34 +02:00
vabene1111
f13c1a2605 Merge pull request #546 from vabene1111/translations_cookbook-locale-en-lc-messages-django-po--develop_es
Translate '/cookbook/locale/en/LC_MESSAGES/django.po' in 'es' [manual sync]
2021-04-11 14:08:30 +02:00
vabene1111
bc8aadbe4e Merge pull request #547 from vabene1111/translations_cookbook-locale-en-lc-messages-django-po--develop_tr
Translate '/cookbook/locale/en/LC_MESSAGES/django.po' in 'tr' [manual sync]
2021-04-11 14:08:27 +02:00
vabene1111
e60843b54c Merge pull request #548 from vabene1111/translations_cookbook-locale-en-lc-messages-django-po--develop_vi
Translate '/cookbook/locale/en/LC_MESSAGES/django.po' in 'vi' [manual sync]
2021-04-11 14:08:23 +02:00
transifex-integration[bot]
46dce472db Apply translations in vi
at least 1% translated for the source file '/cookbook/locale/en/LC_MESSAGES/django.po'
on the 'vi' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
2021-04-11 11:51:07 +00:00
transifex-integration[bot]
556ca1bcb1 Apply translations in tr
at least 1% translated for the source file '/cookbook/locale/en/LC_MESSAGES/django.po'
on the 'tr' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
2021-04-11 11:51:03 +00:00
transifex-integration[bot]
d9b2fcaa87 Apply translations in es
at least 1% translated for the source file '/cookbook/locale/en/LC_MESSAGES/django.po'
on the 'es' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
2021-04-11 11:50:59 +00:00
transifex-integration[bot]
3e950602a7 Apply translations in pt
at least 1% translated for the source file '/cookbook/locale/en/LC_MESSAGES/django.po'
on the 'pt' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
2021-04-11 11:50:55 +00:00
transifex-integration[bot]
1fe0757f6c Apply translations in pl
at least 1% translated for the source file '/cookbook/locale/en/LC_MESSAGES/django.po'
on the 'pl' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
2021-04-11 11:50:51 +00:00
transifex-integration[bot]
b6cf1cf5e6 Apply translations in lv
at least 1% translated for the source file '/cookbook/locale/en/LC_MESSAGES/django.po'
on the 'lv' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
2021-04-11 11:50:47 +00:00
transifex-integration[bot]
ca7d487789 Apply translations in it
at least 1% translated for the source file '/cookbook/locale/en/LC_MESSAGES/django.po'
on the 'it' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
2021-04-11 11:50:43 +00:00
transifex-integration[bot]
cb44136b2e Apply translations in hu_HU
at least 1% translated for the source file '/cookbook/locale/en/LC_MESSAGES/django.po'
on the 'hu_HU' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
2021-04-11 11:50:38 +00:00
transifex-integration[bot]
c92331a79c Apply translations in de
at least 1% translated for the source file '/cookbook/locale/en/LC_MESSAGES/django.po'
on the 'de' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
2021-04-11 11:50:35 +00:00
transifex-integration[bot]
82e7118757 Apply translations in fr
at least 1% translated for the source file '/cookbook/locale/en/LC_MESSAGES/django.po'
on the 'fr' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
2021-04-11 11:50:30 +00:00
transifex-integration[bot]
6d9817183e Apply translations in nl
at least 1% translated for the source file '/cookbook/locale/en/LC_MESSAGES/django.po'
on the 'nl' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
2021-04-11 11:50:25 +00:00
transifex-integration[bot]
0e05d5b18d Apply translations in cs
at least 1% translated for the source file '/cookbook/locale/en/LC_MESSAGES/django.po'
on the 'cs' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
2021-04-11 11:50:17 +00:00
transifex-integration[bot]
da1d88314b Apply translations in ca
at least 1% translated for the source file '/cookbook/locale/en/LC_MESSAGES/django.po'
on the 'ca' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
2021-04-11 11:50:13 +00:00
transifex-integration[bot]
c46f22d71e Apply translations in hy
at least 1% translated for the source file '/cookbook/locale/en/LC_MESSAGES/django.po'
on the 'hy' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
2021-04-11 11:50:09 +00:00
vabene1111
f21de5eddc fixed public share links 2021-04-10 14:36:56 +02:00
vabene1111
e88fb88d8a Merge pull request #534 from smilerz/backend_filter_fix
fix backend detection
2021-04-10 13:59:45 +02:00
smilerz
6eb14daf4d fix backend detection 2021-04-09 13:13:10 -05:00
vabene1111
fad40dab6c client api generation 2021-04-08 22:05:05 +02:00
vabene1111
015e01afb9 cheftap importer improvement 2021-04-08 21:01:07 +02:00
vabene1111
2acdd16d9e Merge pull request #531 from vabene1111/dependabot/pip/django-3.2
Bump django from 3.1.7 to 3.2
2021-04-07 17:50:31 +02:00
dependabot[bot]
d15162337f Bump django from 3.1.7 to 3.2
Bumps [django](https://github.com/django/django) from 3.1.7 to 3.2.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/3.1.7...3.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-07 06:00:38 +00:00
tourn
331d85a993 Add support for DATABASE_URL env var 2021-02-19 11:37:23 +01:00
307 changed files with 113673 additions and 9623 deletions

View File

@@ -20,6 +20,10 @@ POSTGRES_USER=djangouser
POSTGRES_PASSWORD=
POSTGRES_DB=djangodb
# database connection string, when used overrides other database settings.
# format might vary depending on backend
# DATABASE_URL = engine://username:password@host:port/dbname
# the default value for the user preference 'fractions' (enable/disable fraction support)
# default: disabled=0
FRACTION_PREF_DEFAULT=0
@@ -34,7 +38,7 @@ COMMENT_PREF_DEFAULT=1
SHOPPING_MIN_AUTOSYNC_INTERVAL=5
# Default for user setting sticky navbar
#STICKY_NAV_PREF_DEFAULT=1
# STICKY_NAV_PREF_DEFAULT=1
# If staticfiles are stored at a different location uncomment and change accordingly
# STATIC_URL=/static/
@@ -48,11 +52,55 @@ SHOPPING_MIN_AUTOSYNC_INTERVAL=5
# when unset: 1 (true) - this is temporary until an appropriate amount of time has passed for everyone to migrate
GUNICORN_MEDIA=0
# S3 Media settings: store mediafiles in s3 or any compatible storage backend (e.g. minio)
# as long as S3_ACCESS_KEY is not set S3 features are disabled
# S3_ACCESS_KEY=
# S3_SECRET_ACCESS_KEY=
# S3_BUCKET_NAME=
# S3_REGION_NAME= # default none, set your region might be required
# S3_QUERYSTRING_AUTH=1 # default true, set to 0 to serve media from a public bucket without signed urls
# S3_QUERYSTRING_EXPIRE=3600 # number of seconds querystring are valid for
# S3_ENDPOINT_URL= # when using a custom endpoint like minio
# Email Settings, see https://docs.djangoproject.com/en/3.2/ref/settings/#email-host
# Required for email confirmation and password reset (automatically activates if host is set)
# EMAIL_HOST=
# EMAIL_PORT=
# EMAIL_HOST_USER=
# EMAIL_HOST_PASSWORD=
# EMAIL_USE_TLS=0
# EMAIL_USE_SSL=0
# DEFAULT_FROM_EMAIL= # email sender address (default 'webmaster@localhost')
# ACCOUNT_EMAIL_SUBJECT_PREFIX= # prefix used for account related emails (default "[Tandoor Recipes] ")
# allow authentication via reverse proxy (e.g. authelia), leave off if you dont know what you are doing
# see docs for more information https://vabene1111.github.io/recipes/features/authentication/
# when unset: 0 (false)
REVERSE_PROXY_AUTH=0
# Default settings for spaces, apply per space and can be changed in the admin view
# SPACE_DEFAULT_MAX_RECIPES=0 # 0=unlimited recipes
# SPACE_DEFAULT_MAX_USERS=0 # 0=unlimited users per space
# SPACE_DEFAULT_MAX_FILES=0 # Maximum file storage for space in MB. 0 for unlimited, -1 to disable file upload.
# SPACE_DEFAULT_ALLOW_SHARING=1 # Allow users to share recipes with public links
# allow people to create accounts on your application instance (without an invite link)
# when unset: 0 (false)
# ENABLE_SIGNUP=0
# If signup is enabled you might want to add a captcha to it to prevent spam
# HCAPTCHA_SITEKEY=
# HCAPTCHA_SECRET=
# if signup is enabled you might want to provide urls to data protection policies or terms and conditions
# TERMS_URL=
# PRIVACY_URL=
# IMPRINT_URL=
# enable serving of prometheus metrics under the /metrics path
# ATTENTION: view is not secured (as per the prometheus default way) so make sure to secure it
# trough your web server (or leave it open of you dont care if the stats are exposed)
# ENABLE_METRICS=0
# allows you to setup OAuth providers
# see docs for more information https://vabene1111.github.io/recipes/features/authentication/
@@ -64,4 +112,9 @@ REVERSE_PROXY_AUTH=0
# SOCIAL_DEFAULT_ACCESS = 1
# if SOCIAL_DEFAULT_ACCESS is used, which group should be added
# SOCIAL_DEFAULT_GROUP=guest
# SOCIAL_DEFAULT_GROUP=guest
# Django session cookie settings. Can be changed to allow a single django application to authenticate several applications
# when running under the same database
# SESSION_COOKIE_DOMAIN=.example.com
# SESSION_COOKIE_NAME=sessionid # use this only to not interfere with non unified django applications under the same top level domain

View File

@@ -9,14 +9,14 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.8]
python-version: [3.9]
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip

View File

@@ -12,40 +12,42 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
# - name: Autobuild
# uses: github/codeql-action/autobuild@v1
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# Override language selection by uncommenting this and choosing your languages
with:
languages: python, javascript
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
# - name: Autobuild
# uses: github/codeql-action/autobuild@v1
# If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
#- run: |
# make bootstrap
# make release
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
with:
languages: javascript, python

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.8 (recipes)" jdkType="Python SDK" />
<orderEntry type="jdk" jdkName="Python 3.9 (recipes)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TemplatesService">

View File

@@ -9,22 +9,25 @@
<h4 align="center">The recipe manager that allows you to manage your ever growing collection of digital recipes.</h4>
<p align="center">
<img src="https://github.com/vabene1111/recipes/workflows/Continous%20Integration/badge.svg?branch=develop" >
<img src="https://img.shields.io/github/stars/vabene1111/recipes" >
<img src="https://img.shields.io/github/forks/vabene1111/recipes" >
<img src="https://img.shields.io/docker/pulls/vabene1111/recipes" >
<a href="https://github.com/vabene1111/recipes/actions" target="_blank" rel="noopener noreferrer"><img src="https://github.com/vabene1111/recipes/workflows/Continous%20Integration/badge.svg?branch=master" ></a>
<a href="https://github.com/vabene1111/recipes/stargazers" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/github/stars/vabene1111/recipes" ></a>
<a href="https://github.com/vabene1111/recipes/network/members" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/github/forks/vabene1111/recipes" ></a>
<a href="https://hub.docker.com/r/vabene1111/recipes" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/docker/pulls/vabene1111/recipes" ></a>
<a href="https://github.com/vabene1111/recipes/releases/latest" rel="noopener noreferrer"><img src="https://img.shields.io/github/v/release/vabene1111/recipes" ></a>
</p>
<p align="center">
<a href="https://docs.tandoor.dev/install/docker/" target="_blank" rel="noopener noreferrer">Installation</a> •
<a href="https://docs.tandoor.dev/install/docker.html" target="_blank" rel="noopener noreferrer">Installation</a> •
<a href="https://docs.tandoor.dev/" target="_blank" rel="noopener noreferrer">Documentation</a> •
<a href="https://app.tandoor.dev/" target="_blank" rel="noopener noreferrer">Demo</a>
<a href="https://app.tandoor.dev/accounts/login/?demo" target="_blank" rel="noopener noreferrer">Demo</a>
</p>
![Preview](docs/preview.png)
# Your Feedback
Share some information on how you use Tandoor to help me improve the application [Google Survey](https://forms.gle/qNfLK2tWTeWHe9Qd7)
## Features
- 📦 **Sync** files with Dropbox and Nextcloud (more can easily be added)

View File

@@ -7,7 +7,8 @@ from .models import (Comment, CookLog, Food, Ingredient, InviteLink, Keyword,
RecipeBook, RecipeBookEntry, RecipeImport, ShareLink,
ShoppingList, ShoppingListEntry, ShoppingListRecipe,
Space, Step, Storage, Sync, SyncLog, Unit, UserPreference,
ViewLog, Supermarket, SupermarketCategory, SupermarketCategoryRelation, ImportLog, TelegramBot)
ViewLog, Supermarket, SupermarketCategory, SupermarketCategoryRelation,
ImportLog, TelegramBot, BookmarkletImport, UserFile)
class CustomUserAdmin(UserAdmin):
@@ -22,14 +23,20 @@ admin.site.unregister(Group)
class SpaceAdmin(admin.ModelAdmin):
list_display = ('name', 'created_by', 'message')
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'
admin.site.register(Space, SpaceAdmin)
class UserPreferenceAdmin(admin.ModelAdmin):
list_display = ('name', 'space', 'theme', 'nav_color', 'default_page', 'search_style',)
list_display = ('name', 'space', 'theme', 'nav_color', 'default_page', 'search_style',) # TODO add new fields
search_fields = ('user__username', 'space__name')
list_filter = ('theme', 'nav_color', 'default_page', 'search_style')
date_hierarchy = 'created_at'
@staticmethod
def name(obj):
@@ -41,6 +48,7 @@ admin.site.register(UserPreference, UserPreferenceAdmin)
class StorageAdmin(admin.ModelAdmin):
list_display = ('name', 'method')
search_fields = ('name',)
admin.site.register(Storage, StorageAdmin)
@@ -48,6 +56,7 @@ admin.site.register(Storage, StorageAdmin)
class SyncAdmin(admin.ModelAdmin):
list_display = ('storage', 'path', 'active', 'last_checked')
search_fields = ('storage__name', 'path')
admin.site.register(Sync, SyncAdmin)
@@ -76,6 +85,7 @@ admin.site.register(Keyword)
class StepAdmin(admin.ModelAdmin):
list_display = ('name', 'type', 'order')
search_fields = ('name', 'type')
admin.site.register(Step, StepAdmin)
@@ -83,6 +93,9 @@ admin.site.register(Step, StepAdmin)
class RecipeAdmin(admin.ModelAdmin):
list_display = ('name', 'internal', 'created_by', 'storage')
search_fields = ('name', 'created_by__username')
list_filter = ('internal',)
date_hierarchy = 'created_at'
@staticmethod
def created_by(obj):
@@ -97,6 +110,7 @@ admin.site.register(Food)
class IngredientAdmin(admin.ModelAdmin):
list_display = ('food', 'amount', 'unit')
search_fields = ('food__name', 'unit__name')
admin.site.register(Ingredient, IngredientAdmin)
@@ -104,6 +118,8 @@ admin.site.register(Ingredient, IngredientAdmin)
class CommentAdmin(admin.ModelAdmin):
list_display = ('recipe', 'name', 'created_at')
search_fields = ('text', 'user__username')
date_hierarchy = 'created_at'
@staticmethod
def name(obj):
@@ -122,6 +138,7 @@ admin.site.register(RecipeImport, RecipeImportAdmin)
class RecipeBookAdmin(admin.ModelAdmin):
list_display = ('name', 'user_name')
search_fields = ('name', 'created_by__username')
@staticmethod
def user_name(obj):
@@ -151,6 +168,7 @@ admin.site.register(MealPlan, MealPlanAdmin)
class MealTypeAdmin(admin.ModelAdmin):
list_display = ('name', 'created_by', 'order')
search_fields = ('name', 'created_by__username')
admin.site.register(MealType, MealTypeAdmin)
@@ -165,7 +183,7 @@ admin.site.register(ViewLog, ViewLogAdmin)
class InviteLinkAdmin(admin.ModelAdmin):
list_display = (
'username', 'group', 'valid_until',
'group', 'valid_until',
'created_by', 'created_at', 'used_by'
)
@@ -227,3 +245,17 @@ class TelegramBotAdmin(admin.ModelAdmin):
admin.site.register(TelegramBot, TelegramBotAdmin)
class BookmarkletImportAdmin(admin.ModelAdmin):
list_display = ('id', 'url', 'created_by', 'created_at',)
admin.site.register(BookmarkletImport, BookmarkletImportAdmin)
class UserFileAdmin(admin.ModelAdmin):
list_display = ('id', 'name', 'file_size_kb', 'created_at',)
admin.site.register(UserFile, UserFileAdmin)

View File

@@ -49,8 +49,10 @@ with scopes_disabled():
def filter_name(queryset, name, value):
if not name == 'name':
return queryset
if settings.DATABASES['default']['ENGINE'] == 'django.db.backends.postgresql_psycopg2':
queryset = queryset.annotate(similarity=TrigramSimilarity('name', value), ).filter(Q(similarity__gt=0.1) | Q(name__unaccent__icontains=value)).order_by('-similarity')
if settings.DATABASES['default']['ENGINE'] in ['django.db.backends.postgresql_psycopg2',
'django.db.backends.postgresql']:
queryset = queryset.annotate(similarity=TrigramSimilarity('name', value), ).filter(
Q(similarity__gt=0.1) | Q(name__unaccent__icontains=value)).order_by('-similarity')
else:
queryset = queryset.filter(name__icontains=value)
return queryset

View File

@@ -1,8 +1,12 @@
from django import forms
from django.conf import settings
from django.core.exceptions import ValidationError
from django.forms import widgets
from django.utils.translation import gettext_lazy as _
from django_scopes import scopes_disabled
from django_scopes.forms import SafeModelChoiceField, SafeModelMultipleChoiceField
from emoji_picker.widgets import EmojiPickerTextInput
from hcaptcha.fields import hCaptchaField
from .models import (Comment, Food, InviteLink, Keyword, MealPlan, Recipe,
RecipeBook, RecipeBookEntry, Storage, Sync, Unit, User,
@@ -42,10 +46,15 @@ class UserPreferenceForm(forms.ModelForm):
)
help_texts = {
'nav_color': _('Color of the top navigation bar. Not all colors work with all themes, just try them out!'), # noqa: E501
'nav_color': _('Color of the top navigation bar. Not all colors work with all themes, just try them out!'),
# noqa: E501
'default_unit': _('Default Unit to be used when inserting a new ingredient into a recipe.'), # noqa: E501
'use_fractions': _('Enables support for fractions in ingredient amounts (e.g. convert decimals to fractions automatically)'), # noqa: E501
'plan_share': _('Users with whom newly created meal plan/shopping list entries should be shared by default.'), # noqa: E501
'use_fractions': _(
'Enables support for fractions in ingredient amounts (e.g. convert decimals to fractions automatically)'),
# noqa: E501
'plan_share': _(
'Users with whom newly created meal plan/shopping list entries should be shared by default.'),
# noqa: E501
'show_recent': _('Show recently viewed recipes on search page.'), # noqa: E501
'ingredient_decimals': _('Number of decimals to round ingredients.'), # noqa: E501
'comments': _('If you want to be able to create and see comments underneath recipes.'), # noqa: E501
@@ -69,7 +78,7 @@ class UserNameForm(forms.ModelForm):
fields = ('first_name', 'last_name')
help_texts = {
'first_name': _('Both fields are optional. If none are given the username will be displayed instead') # noqa: E501
'first_name': _('Both fields are optional. If none are given the username will be displayed instead')
}
@@ -112,22 +121,28 @@ class ImportExportBase(forms.Form):
SAFRON = 'SAFRON'
CHEFTAP = 'CHEFTAP'
PEPPERPLATE = 'PEPPERPLATE'
RECIPEKEEPER = 'RECIPEKEEPER'
RECETTETEK = 'RECETTETEK'
RECIPESAGE = 'RECIPESAGE'
DOMESTICA = 'DOMESTICA'
MEALMASTER = 'MEALMASTER'
REZKONV = 'REZKONV'
OPENEATS = 'OPENEATS'
type = forms.ChoiceField(choices=(
(DEFAULT, _('Default')), (PAPRIKA, 'Paprika'), (NEXTCLOUD, 'Nextcloud Cookbook'),
(MEALIE, 'Mealie'), (CHOWDOWN, 'Chowdown'), (SAFRON, 'Safron'), (CHEFTAP, 'ChefTap'),
(PEPPERPLATE, 'Pepperplate'), (RECIPESAGE, 'Recipe Sage'), (DOMESTICA, 'Domestica'),
(MEALMASTER, 'MealMaster'), (REZKONV, 'RezKonv'),
(PEPPERPLATE, 'Pepperplate'), (RECETTETEK, 'RecetteTek'), (RECIPESAGE, 'Recipe Sage'), (DOMESTICA, 'Domestica'),
(MEALMASTER, 'MealMaster'), (REZKONV, 'RezKonv'), (OPENEATS, 'Openeats'), (RECIPEKEEPER, 'Recipe Keeper'),
))
class ImportForm(ImportExportBase):
files = forms.FileField(required=True, widget=forms.ClearableFileInput(attrs={'multiple': 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)
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)
class ExportForm(ImportExportBase):
@@ -250,7 +265,8 @@ class StorageForm(forms.ModelForm):
fields = ('name', 'method', 'username', 'password', 'token', 'url', 'path')
help_texts = {
'url': _('Leave empty for dropbox and enter only base url for nextcloud (<code>/remote.php/webdav/</code> is added automatically)'),
'url': _(
'Leave empty for dropbox and enter only base url for nextcloud (<code>/remote.php/webdav/</code> is added automatically)'),
}
@@ -365,7 +381,8 @@ class MealPlanForm(forms.ModelForm):
help_texts = {
'shared': _('You can list default users to share recipes with in the settings.'), # noqa: E501
'note': _('You can use markdown to format this field. See the <a href="/docs/markdown/">docs here</a>') # noqa: E501
'note': _('You can use markdown to format this field. See the <a href="/docs/markdown/">docs here</a>')
# noqa: E501
}
widgets = {
@@ -386,17 +403,62 @@ class InviteLinkForm(forms.ModelForm):
super().__init__(*args, **kwargs)
self.fields['space'].queryset = Space.objects.filter(created_by=user).all()
def clean(self):
space = self.cleaned_data['space']
if space.max_users != 0 and (UserPreference.objects.filter(space=space).count() + InviteLink.objects.filter(space=space).count()) >= space.max_users:
raise ValidationError(_('Maximum number of users for this space reached.'))
def clean_email(self):
email = self.cleaned_data['email']
with scopes_disabled():
if email != '' and User.objects.filter(email=email).exists():
raise ValidationError(_('Email address already taken!'))
return email
class Meta:
model = InviteLink
fields = ('username', 'group', 'valid_until', 'space')
fields = ('email', 'group', 'valid_until', 'space')
help_texts = {
'username': _('A username is not required, if left blank the new user can choose one.') # noqa: E501
'email': _('An email address is not required but if present the invite link will be send to the user.'),
}
field_classes = {
'space': SafeModelChoiceField,
}
class SpaceCreateForm(forms.Form):
prefix = 'create'
name = forms.CharField()
def clean_name(self):
name = self.cleaned_data['name']
with scopes_disabled():
if Space.objects.filter(name=name).exists():
raise ValidationError(_('Name already taken.'))
return name
class SpaceJoinForm(forms.Form):
prefix = 'join'
token = forms.CharField()
class AllAuthSignupForm(forms.Form):
captcha = hCaptchaField()
terms = forms.BooleanField(label=_('Accept Terms and Privacy'))
def __init__(self, **kwargs):
super(AllAuthSignupForm, self).__init__(**kwargs)
if settings.PRIVACY_URL == '' and settings.TERMS_URL == '':
self.fields.pop('terms')
if settings.HCAPTCHA_SECRET == '':
self.fields.pop('captcha')
def signup(self, request, user):
pass
class UserCreateForm(forms.Form):
name = forms.CharField(label='Username')
password = forms.CharField(

View File

@@ -1,6 +1,13 @@
import datetime
from django.conf import settings
from allauth.account.adapter import DefaultAccountAdapter
from django.contrib import messages
from django.core.cache import caches
from gettext import gettext as _
from cookbook.models import InviteLink
class AllAuthCustomAdapter(DefaultAccountAdapter):
@@ -9,11 +16,23 @@ class AllAuthCustomAdapter(DefaultAccountAdapter):
"""
Whether to allow sign ups.
"""
if request.resolver_match.view_name == 'account_signup':
signup_token = False
if 'signup_token' in request.session and InviteLink.objects.filter(valid_until__gte=datetime.datetime.today(), used_by=None, uuid=request.session['signup_token']).exists():
signup_token = True
if (request.resolver_match.view_name == 'account_signup' or request.resolver_match.view_name == 'socialaccount_signup') and not settings.ENABLE_SIGNUP and not signup_token:
return False
else:
return super(AllAuthCustomAdapter, self).is_open_for_signup(request)
# disable password reset for now
def send_mail(self, template_prefix, email, context):
pass
if settings.EMAIL_HOST != '':
default = datetime.datetime.now()
c = caches['default'].get_or_set(email, default, timeout=360)
if c == default:
super(AllAuthCustomAdapter, self).send_mail(template_prefix, email, context)
else:
messages.add_message(self.request, messages.ERROR, _('In order to prevent spam, the requested email was not send. Please wait a few minutes and try again.'))
else:
pass

View File

@@ -0,0 +1,19 @@
import hashlib
from django.conf import settings
from django.core.cache import cache
from storages.backends.s3boto3 import S3Boto3Storage
class CachedS3Boto3Storage(S3Boto3Storage):
def url(self, name, **kwargs):
key = hashlib.md5(f'recipes_media_urls_{name}'.encode('utf-8')).hexdigest()
if result := cache.get(key):
return result
result = super(CachedS3Boto3Storage, self).url(name, **kwargs)
timeout = int(settings.AWS_QUERYSTRING_EXPIRE * .95)
cache.set(key, result, timeout)
return result

View File

@@ -0,0 +1,13 @@
from django.conf import settings
def context_settings(request):
return {
'EMAIL_ENABLED': settings.EMAIL_HOST != '',
'SIGNUP_ENABLED': settings.ENABLE_SIGNUP,
'CAPTCHA_ENABLED': settings.HCAPTCHA_SITEKEY != '',
'HOSTED': settings.HOSTED,
'TERMS_URL': settings.TERMS_URL,
'PRIVACY_URL': settings.PRIVACY_URL,
'IMPRINT_URL': settings.IMPRINT_URL,
}

View File

@@ -0,0 +1,45 @@
import os
import sys
from PIL import Image
from io import BytesIO
def rescale_image_jpeg(image_object, base_width=720):
img = Image.open(image_object)
icc_profile = img.info.get('icc_profile') # remember color profile to not mess up colors
width_percent = (base_width / float(img.size[0]))
height = int((float(img.size[1]) * float(width_percent)))
img = img.resize((base_width, height), Image.ANTIALIAS)
img_bytes = BytesIO()
img.save(img_bytes, 'JPEG', quality=75, optimize=True, icc_profile=icc_profile)
return img_bytes
def rescale_image_png(image_object, base_width=720):
basewidth = 720
wpercent = (basewidth / float(image_object.size[0]))
hsize = int((float(image_object.size[1]) * float(wpercent)))
img = image_object.resize((basewidth, hsize), Image.ANTIALIAS)
im_io = BytesIO()
img.save(im_io, 'PNG', quality=70)
return img
def get_filetype(name):
try:
return os.path.splitext(name)[1]
except:
return '.jpeg'
def handle_image(request, image_object, filetype='.jpeg'):
if sys.getsizeof(image_object) / 8 > 500:
if filetype == '.jpeg':
return rescale_image_jpeg(image_object), filetype
if filetype == '.png':
return rescale_image_png(image_object), filetype
return image_object, filetype

View File

@@ -1,3 +1,4 @@
import re
import string
import unicodedata
@@ -22,20 +23,16 @@ def parse_fraction(x):
def parse_amount(x):
amount = 0
unit = ''
note = ''
did_check_frac = False
end = 0
while (
end < len(x)
and (
x[end] in string.digits
or (
(x[end] == '.' or x[end] == ',' or x[end] == '/')
and end + 1 < len(x)
and x[end + 1] in string.digits
)
)
):
while (end < len(x) and (x[end] in string.digits
or (
(x[end] == '.' or x[end] == ',' or x[end] == '/')
and end + 1 < len(x)
and x[end + 1] in string.digits
))):
end += 1
if end > 0:
if "/" in x[:end]:
@@ -55,7 +52,11 @@ def parse_amount(x):
unit = x[end + 1:]
except ValueError:
unit = x[end:]
return amount, unit
if unit.startswith('(') or unit.startswith('-'): # i dont know any unit that starts with ( or - so its likely an alternative like 1L (500ml) Water or 2-3
unit = ''
note = x
return amount, unit, note
def parse_ingredient_with_comma(tokens):
@@ -106,6 +107,13 @@ def parse(x):
unit = ''
ingredient = ''
note = ''
unit_note = ''
# if the string contains parenthesis early on remove it and place it at the end
# because its likely some kind of note
if re.match('(.){1,6}\s\((.[^\(\)])+\)\s', x):
match = re.search('\((.[^\(])+\)', x)
x = x[:match.start()] + x[match.end():] + ' ' + x[match.start():match.end()]
tokens = x.split()
if len(tokens) == 1:
@@ -114,17 +122,17 @@ def parse(x):
else:
try:
# try to parse first argument as amount
amount, unit = parse_amount(tokens[0])
amount, unit, unit_note = parse_amount(tokens[0])
# only try to parse second argument as amount if there are at least
# three arguments if it already has a unit there can't be
# a fraction for the amount
if len(tokens) > 2:
try:
if not unit == '':
# a unit is already found, no need to try the second argument for a fraction # noqa: E501
# a unit is already found, no need to try the second argument for a fraction
# probably not the best method to do it, but I didn't want to make an if check and paste the exact same thing in the else as already is in the except # noqa: E501
raise ValueError
# try to parse second argument as amount and add that, in case of '2 1/2' or '2 ½' # noqa: E501
# try to parse second argument as amount and add that, in case of '2 1/2' or '2 ½'
amount += parse_fraction(tokens[1])
# assume that units can't end with a comma
if len(tokens) > 3 and not tokens[2].endswith(','):
@@ -142,7 +150,10 @@ def parse(x):
# try to use second argument as unit and everything else as ingredient, use everything as ingredient if it fails # noqa: E501
try:
ingredient, note = parse_ingredient(tokens[2:])
unit = tokens[1]
if unit == '':
unit = tokens[1]
else:
note = tokens[1]
except ValueError:
ingredient, note = parse_ingredient(tokens[1:])
else:
@@ -158,11 +169,16 @@ def parse(x):
ingredient, note = parse_ingredient(tokens)
except ValueError:
ingredient = ' '.join(tokens[1:])
if unit_note not in note:
note += ' ' + unit_note
return amount, unit.strip(), ingredient.strip(), note.strip()
# small utility functions to prevent emtpy unit/food creation
def get_unit(unit, space):
if not unit:
return None
if len(unit) > 0:
u, created = Unit.objects.get_or_create(name=unit, space=space)
return u
@@ -170,6 +186,8 @@ def get_unit(unit, space):
def get_food(food, space):
if not food:
return None
if len(food) > 0:
f, created = Food.objects.get_or_create(name=food, space=space)
return f

View File

@@ -19,7 +19,8 @@ class StyleTreeprocessor(Treeprocessor):
class MarkdownFormatExtension(markdown.Extension):
def extendMarkdown(self, md, md_globals):
# md_ globals deprecated - see here:
def extendMarkdown(self, md):
md.treeprocessors.register(
StyleTreeprocessor(),
'StyleTreeprocessor',

View File

@@ -1,6 +1,8 @@
"""
Source: https://djangosnippets.org/snippets/1703/
"""
from django.conf import settings
from django.core.cache import caches
from django.views.generic.detail import SingleObjectTemplateResponseMixin
from django.views.generic.edit import ModelFormMixin
@@ -90,7 +92,18 @@ def share_link_valid(recipe, share):
:return: true if a share link with the given recipe and uuid exists
"""
try:
return True if ShareLink.objects.filter(recipe=recipe, uuid=share).exists() else False
CACHE_KEY = f'recipe_share_{recipe.pk}_{share}'
if c := caches['default'].get(CACHE_KEY, False):
return c
if link := ShareLink.objects.filter(recipe=recipe, uuid=share, abuse_blocked=False).first():
if 0 < settings.SHARING_LIMIT < link.request_count:
return False
link.request_count += 1
link.save()
caches['default'].set(CACHE_KEY, True, timeout=3)
return True
return False
except ValidationError:
return False
@@ -120,13 +133,19 @@ class GroupRequiredMixin(object):
def dispatch(self, request, *args, **kwargs):
if not has_group_permission(request.user, self.groups_required):
messages.add_message(request, messages.ERROR, _('You do not have the required permissions to view this page!'))
return HttpResponseRedirect(reverse_lazy('index'))
if not request.user.is_authenticated:
messages.add_message(request, messages.ERROR,
_('You are not logged in and therefore cannot view this page!'))
return HttpResponseRedirect(reverse_lazy('account_login') + '?next=' + request.path)
else:
messages.add_message(request, messages.ERROR,
_('You do not have the required permissions to view this page!'))
return HttpResponseRedirect(reverse_lazy('index'))
try:
obj = self.get_object()
if obj.get_space() != request.space:
messages.add_message(request, messages.ERROR, _('You do not have the required permissions to view this page!'))
messages.add_message(request, messages.ERROR,
_('You do not have the required permissions to view this page!'))
return HttpResponseRedirect(reverse_lazy('index'))
except AttributeError:
pass
@@ -138,17 +157,20 @@ class OwnerRequiredMixin(object):
def dispatch(self, request, *args, **kwargs):
if not request.user.is_authenticated:
messages.add_message(request, messages.ERROR, _('You are not logged in and therefore cannot view this page!'))
messages.add_message(request, messages.ERROR,
_('You are not logged in and therefore cannot view this page!'))
return HttpResponseRedirect(reverse_lazy('account_login') + '?next=' + request.path)
else:
if not is_object_owner(request.user, self.get_object()):
messages.add_message(request, messages.ERROR, _('You cannot interact with this object as it is not owned by you!'))
messages.add_message(request, messages.ERROR,
_('You cannot interact with this object as it is not owned by you!'))
return HttpResponseRedirect(reverse('index'))
try:
obj = self.get_object()
if obj.get_space() != request.space:
messages.add_message(request, messages.ERROR, _('You do not have the required permissions to view this page!'))
messages.add_message(request, messages.ERROR,
_('You do not have the required permissions to view this page!'))
return HttpResponseRedirect(reverse_lazy('index'))
except AttributeError:
pass

View File

@@ -0,0 +1,193 @@
import json
import re
from bs4 import BeautifulSoup
from bs4.element import Tag
from cookbook.helper import recipe_url_import as helper
from cookbook.helper.scrapers.scrapers import text_scraper
from json import JSONDecodeError
from recipe_scrapers._utils import get_host_name, normalize_string
from urllib.parse import unquote
def get_recipe_from_source(text, url, space):
def build_node(k, v):
if isinstance(v, dict):
node = {
'name': k,
'value': k,
'children': get_children_dict(v)
}
elif isinstance(v, list):
node = {
'name': k,
'value': k,
'children': get_children_list(v)
}
else:
node = {
'name': k + ": " + normalize_string(str(v)),
'value': normalize_string(str(v))
}
return node
def get_children_dict(children):
kid_list = []
for k, v in children.items():
kid_list.append(build_node(k, v))
return kid_list
def get_children_list(children):
kid_list = []
for kid in children:
if type(kid) == list:
node = {
'name': "unknown list",
'value': "unknown list",
'children': get_children_list(kid)
}
kid_list.append(node)
elif type(kid) == dict:
for k, v in kid.items():
kid_list.append(build_node(k, v))
else:
kid_list.append({
'name': normalize_string(str(kid)),
'value': normalize_string(str(kid))
})
return kid_list
recipe_json = {
'name': '',
'url': '',
'description': '',
'image': '',
'keywords': [],
'recipeIngredient': [],
'recipeInstructions': '',
'servings': '',
'prepTime': '',
'cookTime': ''
}
recipe_tree = []
parse_list = []
html_data = []
images = []
text = unquote(text)
try:
parse_list.append(remove_graph(json.loads(text)))
if not url and 'url' in parse_list[0]:
url = parse_list[0]['url']
scrape = text_scraper("<script type='application/ld+json'>" + text + "</script>", url=url)
except JSONDecodeError:
soup = BeautifulSoup(text, "html.parser")
html_data = get_from_html(soup)
images += get_images_from_source(soup, url)
for el in soup.find_all('script', type='application/ld+json'):
el = remove_graph(el)
if not url and 'url' in el:
url = el['url']
if type(el) == list:
for le in el:
parse_list.append(le)
elif type(el) == dict:
parse_list.append(el)
for el in soup.find_all(type='application/json'):
el = remove_graph(el)
if type(el) == list:
for le in el:
parse_list.append(le)
elif type(el) == dict:
parse_list.append(el)
scrape = text_scraper(text, url=url)
recipe_json = helper.get_from_scraper(scrape, space)
for el in parse_list:
temp_tree = []
if isinstance(el, Tag):
try:
el = json.loads(el.string)
except TypeError:
continue
for k, v in el.items():
if isinstance(v, dict):
node = {
'name': k,
'value': k,
'children': get_children_dict(v)
}
elif isinstance(v, list):
node = {
'name': k,
'value': k,
'children': get_children_list(v)
}
else:
node = {
'name': k + ": " + normalize_string(str(v)),
'value': normalize_string(str(v))
}
temp_tree.append(node)
if '@type' in el and el['@type'] == 'Recipe':
recipe_tree += [{'name': 'ld+json', 'children': temp_tree}]
else:
recipe_tree += [{'name': 'json', 'children': temp_tree}]
return recipe_json, recipe_tree, html_data, images
def get_from_html(soup):
INVISIBLE_ELEMS = ('style', 'script', 'head', 'title')
html = []
for s in soup.strings:
if ((s.parent.name not in INVISIBLE_ELEMS) and (len(s.strip()) > 0)):
html.append(s)
return html
def get_images_from_source(soup, url):
sources = ['src', 'srcset', 'data-src']
images = []
img_tags = soup.find_all('img')
if url:
site = get_host_name(url)
prot = url.split(':')[0]
urls = []
for img in img_tags:
for src in sources:
try:
urls.append(img[src])
except KeyError:
pass
for u in urls:
u = u.split('?')[0]
filename = re.search(r'/([\w_-]+[.](jpg|jpeg|gif|png))$', u)
if filename:
if (('http' not in u) and (url)):
# sometimes an image source can be relative
# if it is provide the base url
u = '{}://{}{}'.format(prot, site, u)
if 'http' in u:
images.append(u)
return images
def remove_graph(el):
# recipes type might be wrapped in @graph type
if isinstance(el, Tag):
try:
el = json.loads(el.string)
if '@graph' in el:
for x in el['@graph']:
if '@type' in x and x['@type'] == 'Recipe':
el = x
except TypeError:
pass
return el

View File

@@ -0,0 +1,76 @@
from datetime import datetime, timedelta
from functools import reduce
from django.contrib.postgres.search import TrigramSimilarity
from django.db.models import Q, Case, When, Value
from django.forms import IntegerField
from cookbook.models import ViewLog
from recipes import settings
def search_recipes(request, queryset, params):
search_string = params.get('query', '')
search_keywords = params.getlist('keywords', [])
search_foods = params.getlist('foods', [])
search_books = params.getlist('books', [])
search_keywords_or = params.get('keywords_or', True)
search_foods_or = params.get('foods_or', True)
search_books_or = params.get('books_or', True)
search_internal = params.get('internal', None)
search_random = params.get('random', False)
search_new = params.get('new', False)
search_last_viewed = int(params.get('last_viewed', 0))
if search_last_viewed > 0:
last_viewed_recipes = ViewLog.objects.filter(created_by=request.user, space=request.space,
created_at__gte=datetime.now() - timedelta(days=14)).order_by('pk').values_list('recipe__pk', flat=True).distinct()
return queryset.filter(pk__in=last_viewed_recipes[len(last_viewed_recipes) - min(len(last_viewed_recipes), search_last_viewed):])
if search_new == 'true':
queryset = queryset.annotate(
new_recipe=Case(When(created_at__gte=(datetime.now() - timedelta(days=7)), then=Value(100)),
default=Value(0), )).order_by('-new_recipe', 'name')
else:
queryset = queryset.order_by('name')
if settings.DATABASES['default']['ENGINE'] in ['django.db.backends.postgresql_psycopg2',
'django.db.backends.postgresql']:
queryset = queryset.annotate(similarity=TrigramSimilarity('name', search_string), ).filter(
Q(similarity__gt=0.1) | Q(name__unaccent__icontains=search_string)).order_by('-similarity')
else:
queryset = queryset.filter(name__icontains=search_string)
if len(search_keywords) > 0:
if search_keywords_or == 'true':
queryset = queryset.filter(keywords__id__in=search_keywords)
else:
for k in search_keywords:
queryset = queryset.filter(keywords__id=k)
if len(search_foods) > 0:
if search_foods_or == 'true':
queryset = queryset.filter(steps__ingredients__food__id__in=search_foods)
else:
for k in search_foods:
queryset = queryset.filter(steps__ingredients__food__id=k)
if len(search_books) > 0:
if search_books_or == 'true':
queryset = queryset.filter(recipebookentry__book__id__in=search_books)
else:
for k in search_books:
queryset = queryset.filter(recipebookentry__book__id=k)
queryset = queryset.distinct()
if search_internal == 'true':
queryset = queryset.filter(internal=True)
if search_random == 'true':
queryset = queryset.order_by("?")
return queryset

View File

@@ -1,269 +1,97 @@
import json
import random
import re
from json import JSONDecodeError
from isodate import parse_duration as iso_parse_duration
from isodate.isoerror import ISO8601Error
from recipe_scrapers._exceptions import ElementNotFoundInHtml
import microdata
from bs4 import BeautifulSoup
from cookbook.helper.ingredient_parser import parse as parse_ingredient
from cookbook.helper.ingredient_parser import parse as parse_single_ingredient
from cookbook.models import Keyword
from django.http import JsonResponse
from django.utils.dateparse import parse_duration
from django.utils.translation import gettext as _
from recipe_scrapers import _utils
def get_from_html(html_text, url, space):
soup = BeautifulSoup(html_text, "html.parser")
# first try finding ld+json as its most common
for ld in soup.find_all('script', type='application/ld+json'):
try:
ld_json = json.loads(ld.string.replace('\n', ''))
if type(ld_json) != list:
ld_json = [ld_json]
for ld_json_item in ld_json:
# recipes type might be wrapped in @graph type
if '@graph' in ld_json_item:
for x in ld_json_item['@graph']:
if '@type' in x and x['@type'] == 'Recipe':
ld_json_item = x
if ('@type' in ld_json_item
and ld_json_item['@type'] == 'Recipe'):
return JsonResponse(find_recipe_json(ld_json_item, url, space))
except JSONDecodeError:
return JsonResponse(
{
'error': True,
'msg': _('The requested site provided malformed data and cannot be read.') # noqa: E501
},
status=400)
# now try to find microdata
items = microdata.get_items(html_text)
for i in items:
md_json = json.loads(i.json())
if 'schema.org/Recipe' in str(md_json['type']):
return JsonResponse(find_recipe_json(md_json['properties'], url, space))
return JsonResponse(
{
'error': True,
'msg': _('The requested site does not provide any recognized data format to import the recipe from.') # noqa: E501
},
status=400)
def find_recipe_json(ld_json, url, space):
if type(ld_json['name']) == list:
try:
ld_json['name'] = ld_json['name'][0]
except Exception:
ld_json['name'] = 'ERROR'
# some sites use ingredients instead of recipeIngredients
if 'recipeIngredient' not in ld_json and 'ingredients' in ld_json:
ld_json['recipeIngredient'] = ld_json['ingredients']
if 'recipeIngredient' in ld_json:
# some pages have comma separated ingredients in a single array entry
if (len(ld_json['recipeIngredient']) == 1
and type(ld_json['recipeIngredient']) == list):
ld_json['recipeIngredient'] = ld_json['recipeIngredient'][0].split(',') # noqa: E501
elif type(ld_json['recipeIngredient']) == str:
ld_json['recipeIngredient'] = ld_json['recipeIngredient'].split(',')
for x in ld_json['recipeIngredient']:
if '\n' in x:
ld_json['recipeIngredient'].remove(x)
for i in x.split('\n'):
ld_json['recipeIngredient'].insert(0, i)
ingredients = []
for x in ld_json['recipeIngredient']:
if x.replace(' ', '') != '':
x = x.replace('&frac12;', "0.5").replace('&frac14;', "0.25").replace('&frac34;', "0.75")
try:
amount, unit, ingredient, note = parse_ingredient(x)
if ingredient:
ingredients.append(
{
'amount': amount,
'unit': {
'text': unit,
'id': random.randrange(10000, 99999)
},
'ingredient': {
'text': ingredient,
'id': random.randrange(10000, 99999)
},
'note': note,
'original': x
}
)
except Exception:
ingredients.append(
{
'amount': 0,
'unit': {
'text': '',
'id': random.randrange(10000, 99999)
},
'ingredient': {
'text': x,
'id': random.randrange(10000, 99999)
},
'note': '',
'original': x
}
)
ld_json['recipeIngredient'] = ingredients
else:
ld_json['recipeIngredient'] = []
if 'keywords' in ld_json:
ld_json['keywords'] = parse_keywords(listify_keywords(ld_json['keywords']), space)
if 'recipeInstructions' in ld_json:
instructions = ''
# flatten instructions if they are in a list
if type(ld_json['recipeInstructions']) == list:
for i in ld_json['recipeInstructions']:
if type(i) == str:
instructions += i
else:
if 'text' in i:
instructions += i['text'] + '\n\n'
elif 'itemListElement' in i:
for ile in i['itemListElement']:
if type(ile) == str:
instructions += ile + '\n\n'
elif 'text' in ile:
instructions += ile['text'] + '\n\n'
else:
instructions += str(i)
ld_json['recipeInstructions'] = instructions
ld_json['recipeInstructions'] = re.sub(r'\n\s*\n', '\n\n', ld_json['recipeInstructions']) # noqa: E501
ld_json['recipeInstructions'] = re.sub(' +', ' ', ld_json['recipeInstructions']) # noqa: E501
ld_json['recipeInstructions'] = ld_json['recipeInstructions'].replace('<p>', '') # noqa: E501
ld_json['recipeInstructions'] = ld_json['recipeInstructions'].replace('</p>', '') # noqa: E501
else:
ld_json['recipeInstructions'] = ''
if url != '':
ld_json['recipeInstructions'] += '\n\n' + _('Imported from') + ' ' + url
if 'image' in ld_json:
# check if list of images is returned, take first if so
if (type(ld_json['image'])) == list:
if type(ld_json['image'][0]) == str:
ld_json['image'] = ld_json['image'][0]
elif 'url' in ld_json['image'][0]:
ld_json['image'] = ld_json['image'][0]['url']
# ignore relative image paths
if 'http' not in ld_json['image']:
ld_json['image'] = ''
if 'cookTime' in ld_json:
try:
if (type(ld_json['cookTime']) == list
and len(ld_json['cookTime']) > 0):
ld_json['cookTime'] = ld_json['cookTime'][0]
ld_json['cookTime'] = round(
parse_duration(
ld_json['cookTime']
).seconds / 60
)
except TypeError:
ld_json['cookTime'] = 0
else:
ld_json['cookTime'] = 0
if 'prepTime' in ld_json:
try:
if (type(ld_json['prepTime']) == list
and len(ld_json['prepTime']) > 0):
ld_json['prepTime'] = ld_json['prepTime'][0]
ld_json['prepTime'] = round(
parse_duration(
ld_json['prepTime']
).seconds / 60
)
except TypeError:
ld_json['prepTime'] = 0
else:
ld_json['prepTime'] = 0
ld_json['servings'] = 1
try:
if 'recipeYield' in ld_json:
if type(ld_json['recipeYield']) == str:
ld_json['servings'] = int(re.findall(r'\b\d+\b', ld_json['recipeYield'])[0])
elif type(ld_json['recipeYield']) == list:
ld_json['servings'] = int(re.findall(r'\b\d+\b', ld_json['recipeYield'][0])[0])
except Exception as e:
print(e)
for key in list(ld_json):
if key not in [
'prepTime', 'cookTime', 'image', 'recipeInstructions',
'keywords', 'name', 'recipeIngredient', 'servings', 'description'
]:
ld_json.pop(key, None)
return ld_json
from html import unescape
from recipe_scrapers._schemaorg import SchemaOrgException
from recipe_scrapers._utils import get_minutes
def get_from_scraper(scrape, space):
# converting the scrape_me object to the existing json format based on ld+json
recipe_json = {}
recipe_json['name'] = scrape.title()
try:
recipe_json['name'] = parse_name(scrape.title() or None)
except Exception:
recipe_json['name'] = None
if not recipe_json['name']:
try:
recipe_json['name'] = scrape.schema.data.get('name') or ''
except Exception:
recipe_json['name'] = ''
try:
description = scrape.schema.data.get("description") or ''
recipe_json['prepTime'] = _utils.get_minutes(scrape.schema.data.get("prepTime")) or 0
recipe_json['cookTime'] = _utils.get_minutes(scrape.schema.data.get("cookTime")) or 0
except AttributeError:
except Exception:
description = ''
recipe_json['prepTime'] = 0
recipe_json['cookTime'] = 0
recipe_json['description'] = description
recipe_json['description'] = parse_description(description)
try:
servings = scrape.yields()
servings = int(re.findall(r'\b\d+\b', servings)[0])
except (AttributeError, ValueError, IndexError):
servings = 1
recipe_json['servings'] = servings
servings = scrape.yields() or None
except Exception:
servings = None
if not servings:
try:
servings = scrape.schema.data.get('recipeYield') or 1
except Exception:
servings = 1
if type(servings) != int:
try:
servings = int(re.findall(r'\b\d+\b', servings)[0])
except Exception:
servings = 1
recipe_json['servings'] = max(servings, 1)
try:
recipe_json['prepTime'] = get_minutes(scrape.schema.data.get("prepTime")) or 0
except Exception:
recipe_json['prepTime'] = 0
try:
recipe_json['cookTime'] = get_minutes(scrape.schema.data.get("cookTime")) or 0
except Exception:
recipe_json['cookTime'] = 0
if recipe_json['cookTime'] + recipe_json['prepTime'] == 0:
try:
recipe_json['prepTime'] = scrape.total_time()
except AttributeError:
pass
recipe_json['prepTime'] = get_minutes(scrape.total_time()) or 0
except Exception:
try:
get_minutes(scrape.schema.data.get("totalTime")) or 0
except Exception:
pass
try:
recipe_json['image'] = scrape.image()
except AttributeError:
pass
recipe_json['image'] = parse_image(scrape.image()) or None
except Exception:
recipe_json['image'] = None
if not recipe_json['image']:
try:
recipe_json['image'] = parse_image(scrape.schema.data.get('image')) or ''
except Exception:
recipe_json['image'] = ''
keywords = []
try:
if scrape.schema.data.get("keywords"):
keywords += listify_keywords(scrape.schema.data.get("keywords"))
except Exception:
pass
try:
if scrape.schema.data.get('recipeCategory'):
keywords += listify_keywords(scrape.schema.data.get("recipeCategory"))
except Exception:
pass
try:
if scrape.schema.data.get('recipeCuisine'):
keywords += listify_keywords(scrape.schema.data.get("recipeCuisine"))
except Exception:
pass
try:
recipe_json['keywords'] = parse_keywords(list(set(map(str.casefold, keywords))), space)
except AttributeError:
recipe_json['keywords'] = keywords
@@ -272,23 +100,22 @@ def get_from_scraper(scrape, space):
ingredients = []
for x in scrape.ingredients():
try:
amount, unit, ingredient, note = parse_ingredient(x)
if ingredient:
ingredients.append(
{
'amount': amount,
'unit': {
'text': unit,
'id': random.randrange(10000, 99999)
},
'ingredient': {
'text': ingredient,
'id': random.randrange(10000, 99999)
},
'note': note,
'original': x
}
)
amount, unit, ingredient, note = parse_single_ingredient(x)
ingredients.append(
{
'amount': amount,
'unit': {
'text': unit,
'id': random.randrange(10000, 99999)
},
'ingredient': {
'text': ingredient,
'id': random.randrange(10000, 99999)
},
'note': note,
'original': x
}
)
except Exception:
ingredients.append(
{
@@ -306,38 +133,236 @@ def get_from_scraper(scrape, space):
}
)
recipe_json['recipeIngredient'] = ingredients
except AttributeError:
except Exception:
recipe_json['recipeIngredient'] = ingredients
try:
recipe_json['recipeInstructions'] = scrape.instructions()
except AttributeError:
recipe_json['recipeInstructions'] = parse_instructions(scrape.instructions())
except Exception:
recipe_json['recipeInstructions'] = ""
recipe_json['recipeInstructions'] += "\n\nImported from " + scrape.url
if scrape.url:
recipe_json['url'] = scrape.url
recipe_json['recipeInstructions'] += "\n\nImported from " + scrape.url
return recipe_json
def parse_name(name):
if type(name) == list:
try:
name = name[0]
except Exception:
name = 'ERROR'
return normalize_string(name)
def parse_ingredients(ingredients):
# some pages have comma separated ingredients in a single array entry
try:
if type(ingredients[0]) == dict:
return ingredients
except (KeyError, IndexError):
pass
if (len(ingredients) == 1 and type(ingredients) == list):
ingredients = ingredients[0].split(',')
elif type(ingredients) == str:
ingredients = ingredients.split(',')
for x in ingredients:
if '\n' in x:
ingredients.remove(x)
for i in x.split('\n'):
ingredients.insert(0, i)
ingredient_list = []
for x in ingredients:
if x.replace(' ', '') != '':
x = x.replace('&frac12;', "0.5").replace('&frac14;', "0.25").replace('&frac34;', "0.75")
try:
amount, unit, ingredient, note = parse_single_ingredient(x)
if ingredient:
ingredient_list.append(
{
'amount': amount,
'unit': {
'text': unit,
'id': random.randrange(10000, 99999)
},
'ingredient': {
'text': ingredient,
'id': random.randrange(10000, 99999)
},
'note': note,
'original': x
}
)
except Exception:
ingredient_list.append(
{
'amount': 0,
'unit': {
'text': '',
'id': random.randrange(10000, 99999)
},
'ingredient': {
'text': x,
'id': random.randrange(10000, 99999)
},
'note': '',
'original': x
}
)
ingredients = ingredient_list
else:
ingredients = []
return ingredients
def parse_description(description):
return normalize_string(description)
def parse_instructions(instructions):
instruction_text = ''
# flatten instructions if they are in a list
if type(instructions) == list:
for i in instructions:
if type(i) == str:
instruction_text += i
else:
if 'text' in i:
instruction_text += i['text'] + '\n\n'
elif 'itemListElement' in i:
for ile in i['itemListElement']:
if type(ile) == str:
instruction_text += ile + '\n\n'
elif 'text' in ile:
instruction_text += ile['text'] + '\n\n'
else:
instruction_text += str(i)
instructions = instruction_text
return normalize_string(instructions)
def parse_image(image):
# check if list of images is returned, take first if so
if not image:
return None
if type(image) == list:
for pic in image:
if (type(pic) == str) and (pic[:4] == 'http'):
image = pic
elif 'url' in pic:
image = pic['url']
elif type(image) == dict:
if 'url' in image:
image = image['url']
# ignore relative image paths
if image[:4] != 'http':
image = ''
return image
def parse_servings(servings):
if type(servings) == str:
try:
servings = int(re.search(r'\d+', servings).group())
except AttributeError:
servings = 1
elif type(servings) == list:
try:
servings = int(re.findall(r'\b\d+\b', servings[0])[0])
except KeyError:
servings = 1
return servings
def parse_cooktime(cooktime):
if type(cooktime) not in [int, float]:
try:
cooktime = float(re.search(r'\d+', cooktime).group())
except (ValueError, AttributeError):
try:
cooktime = round(iso_parse_duration(cooktime).seconds / 60)
except ISO8601Error:
try:
if (type(cooktime) == list and len(cooktime) > 0):
cooktime = cooktime[0]
cooktime = round(parse_duration(cooktime).seconds / 60)
except AttributeError:
cooktime = 0
return cooktime
def parse_preptime(preptime):
if type(preptime) not in [int, float]:
try:
preptime = float(re.search(r'\d+', preptime).group())
except ValueError:
try:
preptime = round(iso_parse_duration(preptime).seconds / 60)
except ISO8601Error:
try:
if (type(preptime) == list and len(preptime) > 0):
preptime = preptime[0]
preptime = round(parse_duration(preptime).seconds / 60)
except AttributeError:
preptime = 0
return preptime
def parse_keywords(keyword_json, space):
keywords = []
# keywords as list
for kw in keyword_json:
if k := Keyword.objects.filter(name=kw, space=space).first():
keywords.append({'id': str(k.id), 'text': str(k)})
else:
keywords.append({'id': random.randrange(1111111, 9999999, 1), 'text': kw})
kw = normalize_string(kw)
if len(kw) != 0:
if k := Keyword.objects.filter(name=kw, space=space).first():
keywords.append({'id': str(k.id), 'text': str(k)})
else:
keywords.append({'id': random.randrange(1111111, 9999999, 1), 'text': kw})
return keywords
def listify_keywords(keyword_list):
# keywords as string
try:
if type(keyword_list[0]) == dict:
return keyword_list
except (KeyError, IndexError):
pass
if type(keyword_list) == str:
keyword_list = keyword_list.split(',')
# keywords as string in list
if (type(keyword_list) == list
and len(keyword_list) == 1
and ',' in keyword_list[0]):
if (type(keyword_list) == list and len(keyword_list) == 1 and ',' in keyword_list[0]):
keyword_list = keyword_list[0].split(',')
return [x.strip() for x in keyword_list]
def normalize_string(string):
# Convert all named and numeric character references (e.g. &gt;, &#62;)
unescaped_string = unescape(string)
unescaped_string = re.sub('<[^<]+?>', '', unescaped_string)
unescaped_string = re.sub(' +', ' ', unescaped_string)
unescaped_string = re.sub('</p>', '\n', unescaped_string)
unescaped_string = re.sub(r'\n\s*\n', '\n\n', unescaped_string)
unescaped_string = unescaped_string.replace("\xa0", " ").replace("\t", " ").strip()
return unescaped_string
def iso_duration_to_minutes(string):
match = re.match(
r'P((?P<years>\d+)Y)?((?P<months>\d+)M)?((?P<weeks>\d+)W)?((?P<days>\d+)D)?T((?P<hours>\d+)H)?((?P<minutes>\d+)M)?((?P<seconds>\d+)S)?',
string
).groupdict()
return int(match['days'] or 0) * 24 * 60 + int(match['hours'] or 0) * 60 + int(match['minutes'] or 0)

View File

@@ -16,6 +16,12 @@ class ScopeMiddleware:
with scopes_disabled():
return self.get_response(request)
if request.path.startswith('/signup/') or request.path.startswith('/invite/'):
return self.get_response(request)
if request.path.startswith('/accounts/'):
return self.get_response(request)
with scopes_disabled():
if request.user.userpreference.space is None and not reverse('account_logout') in request.path:
return views.no_space(request)

View File

@@ -0,0 +1,68 @@
import json
from recipe_scrapers._abstract import AbstractScraper
class CooksIllustrated(AbstractScraper):
@classmethod
def host(cls, site='cooksillustrated'):
return {
'cooksillustrated': f"{site}.com",
'americastestkitchen': f"{site}.com",
'cookscountry': f"{site}.com",
}.get(site)
def title(self):
return self.schema.title()
def image(self):
return self.schema.image()
def total_time(self):
if not self.recipe:
self.get_recipe()
return self.recipe['recipeTimeNote']
def yields(self):
if not self.recipe:
self.get_recipe()
return self.recipe['yields']
def ingredients(self):
if not self.recipe:
self.get_recipe()
ingredients = []
for group in self.recipe['ingredientGroups']:
ingredients += group['fields']['recipeIngredientItems']
return [
"{} {} {}{}".format(
i['fields']['qty'] or '',
i['fields']['measurement'] or '',
i['fields']['ingredient']['fields']['title'] or '',
i['fields']['postText'] or ''
)
for i in ingredients
]
def instructions(self):
if not self.recipe:
self.get_recipe()
if self.recipe.get('headnote', False):
i = ['Note: ' + self.recipe.get('headnote', '')]
else:
i = []
return "\n".join(
i
+ [self.recipe.get('whyThisWorks', '')]
+ [
instruction['fields']['content']
for instruction in self.recipe['instructions']
]
)
def nutrients(self):
raise NotImplementedError("This should be implemented.")
def get_recipe(self):
j = json.loads(self.soup.find(type='application/json').string)
name = list(j['props']['initialState']['content']['documents'])[0]
self.recipe = j['props']['initialState']['content']['documents'][name]

View File

@@ -0,0 +1,43 @@
from bs4 import BeautifulSoup
from json import JSONDecodeError
from recipe_scrapers import SCRAPERS, get_host_name
from recipe_scrapers._factory import SchemaScraperFactory
from recipe_scrapers._schemaorg import SchemaOrg
from .cooksillustrated import CooksIllustrated
CUSTOM_SCRAPERS = {
CooksIllustrated.host(site="cooksillustrated"): CooksIllustrated,
CooksIllustrated.host(site="americastestkitchen"): CooksIllustrated,
CooksIllustrated.host(site="cookscountry"): CooksIllustrated,
}
SCRAPERS.update(CUSTOM_SCRAPERS)
def text_scraper(text, url=None):
domain = None
if url:
domain = get_host_name(url)
if domain in SCRAPERS:
scraper_class = SCRAPERS[domain]
else:
scraper_class = SchemaScraperFactory.SchemaScraper
class TextScraper(scraper_class):
def __init__(
self,
page_data,
url=None
):
self.wild_mode = False
# self.exception_handling = None # TODO add new method here, old one was deprecated
self.meta_http_equiv = False
self.soup = BeautifulSoup(page_data, "html.parser")
self.url = url
self.recipe = None
try:
self.schema = SchemaOrg(page_data)
except (JSONDecodeError, AttributeError):
pass
return TextScraper(text, url)

View File

@@ -40,7 +40,7 @@ class Pepperplate(Integration):
recipe = Recipe.objects.create(name=title, description=description, created_by=self.request.user, internal=True, space=self.request.space)
step = Step.objects.create(
instruction='\n'.join(directions) + '\n\n'
instruction='\n'.join(directions) + '\n\n', space=self.request.space,
)
for ingredient in ingredients:
@@ -49,7 +49,7 @@ class Pepperplate(Integration):
f = get_food(ingredient, self.request.space)
u = get_unit(unit, self.request.space)
step.ingredients.add(Ingredient.objects.create(
food=f, unit=u, amount=amount, note=note
food=f, unit=u, amount=amount, note=note, space=self.request.space,
))
recipe.steps.add(step)

View File

@@ -11,7 +11,7 @@ class ChefTap(Integration):
def import_file_name_filter(self, zip_info_object):
print("testing", zip_info_object.filename)
return re.match(r'^cheftap_export/([A-Za-z\d\w\s-])+.txt$', zip_info_object.filename)
return re.match(r'^cheftap_export/([A-Za-z\d\w\s-])+.txt$', zip_info_object.filename) or re.match(r'^([A-Za-z\d\w\s-])+.txt$', zip_info_object.filename)
def get_recipe_from_file(self, file):
source_url = ''
@@ -38,7 +38,7 @@ class ChefTap(Integration):
recipe = Recipe.objects.create(name=title, created_by=self.request.user, internal=True, space=self.request.space, )
step = Step.objects.create(instruction='\n'.join(directions))
step = Step.objects.create(instruction='\n'.join(directions), space=self.request.space,)
if source_url != '':
step.instruction += '\n' + source_url
@@ -50,7 +50,7 @@ class ChefTap(Integration):
f = get_food(ingredient, self.request.space)
u = get_unit(unit, self.request.space)
step.ingredients.add(Ingredient.objects.create(
food=f, unit=u, amount=amount, note=note
food=f, unit=u, amount=amount, note=note, space=self.request.space,
))
recipe.steps.add(step)

View File

@@ -3,6 +3,7 @@ import re
from io import BytesIO
from zipfile import ZipFile
from cookbook.helper.image_processing import get_filetype
from cookbook.helper.ingredient_parser import parse, get_food, get_unit
from cookbook.integration.integration import Integration
from cookbook.models import Recipe, Step, Food, Unit, Ingredient, Keyword
@@ -54,7 +55,7 @@ class Chowdown(Integration):
recipe.keywords.add(keyword)
step = Step.objects.create(
instruction='\n'.join(directions) + '\n\n' + '\n'.join(descriptions)
instruction='\n'.join(directions) + '\n\n' + '\n'.join(descriptions), space=self.request.space,
)
for ingredient in ingredients:
@@ -62,7 +63,7 @@ class Chowdown(Integration):
f = get_food(ingredient, self.request.space)
u = get_unit(unit, self.request.space)
step.ingredients.add(Ingredient.objects.create(
food=f, unit=u, amount=amount, note=note
food=f, unit=u, amount=amount, note=note, space=self.request.space,
))
recipe.steps.add(step)
@@ -71,7 +72,7 @@ class Chowdown(Integration):
import_zip = ZipFile(f['file'])
for z in import_zip.filelist:
if re.match(f'^images/{image}$', z.filename):
self.import_recipe_image(recipe, BytesIO(import_zip.read(z.filename)))
self.import_recipe_image(recipe, BytesIO(import_zip.read(z.filename)), filetype=get_filetype(z.filename))
return recipe

View File

@@ -1,9 +1,11 @@
import json
from io import BytesIO
from re import match
from zipfile import ZipFile
from rest_framework.renderers import JSONRenderer
from cookbook.helper.image_processing import get_filetype
from cookbook.integration.integration import Integration
from cookbook.serializer import RecipeExportSerializer
@@ -15,8 +17,9 @@ class Default(Integration):
recipe_string = recipe_zip.read('recipe.json').decode("utf-8")
recipe = self.decode_recipe(recipe_string)
if 'image.png' in recipe_zip.namelist():
self.import_recipe_image(recipe, BytesIO(recipe_zip.read('image.png')))
images = list(filter(lambda v: match('image.*', v), recipe_zip.namelist()))
if images:
self.import_recipe_image(recipe, BytesIO(recipe_zip.read(images[0])), filetype=get_filetype(images[0]))
return recipe
def decode_recipe(self, string):

View File

@@ -28,7 +28,7 @@ class Domestica(Integration):
recipe.save()
step = Step.objects.create(
instruction=file['directions']
instruction=file['directions'], space=self.request.space,
)
if file['source'] != '':
@@ -40,12 +40,12 @@ class Domestica(Integration):
f = get_food(ingredient, self.request.space)
u = get_unit(unit, self.request.space)
step.ingredients.add(Ingredient.objects.create(
food=f, unit=u, amount=amount, note=note
food=f, unit=u, amount=amount, note=note, space=self.request.space,
))
recipe.steps.add(step)
if file['image'] != '':
self.import_recipe_image(recipe, BytesIO(base64.b64decode(file['image'].replace('data:image/jpeg;base64,', ''))))
self.import_recipe_image(recipe, BytesIO(base64.b64decode(file['image'].replace('data:image/jpeg;base64,', ''))), filetype='.jpeg')
return recipe

View File

@@ -1,5 +1,7 @@
import datetime
import json
import os
import re
import uuid
from io import BytesIO, StringIO
from zipfile import ZipFile, BadZipFile
@@ -11,6 +13,7 @@ from django.utils.translation import gettext as _
from django_scopes import scope
from cookbook.forms import ImportExportBase
from cookbook.helper.image_processing import get_filetype
from cookbook.models import Keyword, Recipe
@@ -57,9 +60,8 @@ class Integration:
recipe_stream.write(data)
recipe_zip_obj.writestr(filename, recipe_stream.getvalue())
recipe_stream.close()
try:
recipe_zip_obj.write(r.image.path, 'image.png')
recipe_zip_obj.writestr(f'image{get_filetype(r.image.file.name)}', r.image.file.read())
except ValueError:
pass
@@ -105,33 +107,90 @@ class Integration:
try:
self.files = files
for f in files:
if '.zip' in f['name'] or '.paprikarecipes' in f['name']:
if 'RecipeKeeper' in f['name']:
import_zip = ZipFile(f['file'])
file_list = []
for z in import_zip.filelist:
if self.import_file_name_filter(z):
file_list.append(z)
il.total_recipes += len(file_list)
for z in file_list:
data_list = self.split_recipe_file(import_zip.read(z.filename).decode('utf-8'))
for d in data_list:
recipe = self.get_recipe_from_file(d)
recipe.keywords.add(self.keyword)
il.msg += f'{recipe.pk} - {recipe.name} \n'
self.handle_duplicates(recipe, import_duplicates)
il.imported_recipes += 1
il.save()
import_zip.close()
elif '.zip' in f['name'] or '.paprikarecipes' in f['name']:
import_zip = ZipFile(f['file'])
file_list = []
for z in import_zip.filelist:
if self.import_file_name_filter(z):
file_list.append(z)
il.total_recipes += len(file_list)
for z in file_list:
try:
recipe = self.get_recipe_from_file(BytesIO(import_zip.read(z.filename)))
recipe.keywords.add(self.keyword)
il.msg += f'{recipe.pk} - {recipe.name} \n'
self.handle_duplicates(recipe, import_duplicates)
il.imported_recipes += 1
il.save()
except Exception as e:
il.msg += f'-------------------- \n ERROR \n{e}\n--------------------\n'
import_zip.close()
elif '.json' in f['name'] or '.txt' in f['name']:
data_list = self.split_recipe_file(f['file'])
il.total_recipes += len(data_list)
for d in data_list:
recipe = self.get_recipe_from_file(d)
recipe.keywords.add(self.keyword)
il.msg += f'{recipe.pk} - {recipe.name} \n'
self.handle_duplicates(recipe, import_duplicates)
try:
recipe = self.get_recipe_from_file(d)
recipe.keywords.add(self.keyword)
il.msg += f'{recipe.pk} - {recipe.name} \n'
self.handle_duplicates(recipe, import_duplicates)
il.imported_recipes += 1
il.save()
except Exception as e:
il.msg += f'-------------------- \n ERROR \n{e}\n--------------------\n'
elif '.rtk' in f['name']:
import_zip = ZipFile(f['file'])
for z in import_zip.filelist:
if self.import_file_name_filter(z):
data_list = self.split_recipe_file(import_zip.read(z.filename).decode('utf-8'))
il.total_recipes += len(data_list)
for d in data_list:
try:
recipe = self.get_recipe_from_file(d)
recipe.keywords.add(self.keyword)
il.msg += f'{recipe.pk} - {recipe.name} \n'
self.handle_duplicates(recipe, import_duplicates)
il.imported_recipes += 1
il.save()
except Exception as e:
il.msg += f'-------------------- \n ERROR \n{e}\n--------------------\n'
import_zip.close()
else:
recipe = self.get_recipe_from_file(f['file'])
recipe.keywords.add(self.keyword)
il.msg += f'{recipe.pk} - {recipe.name} \n'
self.handle_duplicates(recipe, import_duplicates)
except BadZipFile:
il.msg += 'ERROR ' + _('Importer expected a .zip file. Did you choose the correct importer type for your data ?') + '\n'
il.msg += 'ERROR ' + _(
'Importer expected a .zip file. Did you choose the correct importer type for your data ?') + '\n'
except:
il.msg += 'ERROR ' + _(
'An unexpected error occurred during the import. Please make sure you have uploaded a valid file.') + '\n'
if len(self.ignored_recipes) > 0:
il.msg += '\n' + _('The following recipes were ignored because they already existed:') + ' ' + ', '.join(self.ignored_recipes) + '\n\n'
il.msg += '\n' + _(
'The following recipes were ignored because they already existed:') + ' ' + ', '.join(
self.ignored_recipes) + '\n\n'
il.keyword = self.keyword
il.msg += (_('Imported %s recipes.') % Recipe.objects.filter(keywords=self.keyword).count()) + '\n'
@@ -149,13 +208,14 @@ class Integration:
self.ignored_recipes.append(recipe.name)
@staticmethod
def import_recipe_image(recipe, image_file):
def import_recipe_image(recipe, image_file, filetype='.jpeg'):
"""
Adds an image to a recipe naming it correctly
:param recipe: Recipe object
:param image_file: ByteIO stream containing the image
:param filetype: type of file to write bytes to, default to .jpeg if unknown
"""
recipe.image = File(image_file, name=f'{uuid.uuid4()}_{recipe.pk}.png')
recipe.image = File(image_file, name=f'{uuid.uuid4()}_{recipe.pk}{filetype}')
recipe.save()
def get_recipe_from_file(self, file):

View File

@@ -3,6 +3,7 @@ import re
from io import BytesIO
from zipfile import ZipFile
from cookbook.helper.image_processing import get_filetype
from cookbook.helper.ingredient_parser import parse, get_food, get_unit
from cookbook.integration.integration import Integration
from cookbook.models import Recipe, Step, Food, Unit, Ingredient
@@ -11,40 +12,55 @@ from cookbook.models import Recipe, Step, Food, Unit, Ingredient
class Mealie(Integration):
def import_file_name_filter(self, zip_info_object):
return re.match(r'^recipes/([A-Za-z\d-])+.json$', zip_info_object.filename)
return re.match(r'^recipes/([A-Za-z\d-])+/([A-Za-z\d-])+.json$', zip_info_object.filename)
def get_recipe_from_file(self, file):
recipe_json = json.loads(file.getvalue().decode("utf-8"))
description = '' if len(recipe_json['description'].strip()) > 500 else recipe_json['description'].strip()
recipe = Recipe.objects.create(
name=recipe_json['name'].strip(), description=recipe_json['description'].strip(),
name=recipe_json['name'].strip(), description=description,
created_by=self.request.user, internal=True, space=self.request.space)
# TODO parse times (given in PT2H3M )
ingredients_added = False
for s in recipe_json['recipeInstructions']:
for s in recipe_json['recipe_instructions']:
step = Step.objects.create(
instruction=s['text']
instruction=s['text'], space=self.request.space,
)
if not ingredients_added:
ingredients_added = True
for ingredient in recipe_json['recipeIngredient']:
amount, unit, ingredient, note = parse(ingredient)
f = get_food(ingredient, self.request.space)
u = get_unit(unit, self.request.space)
step.ingredients.add(Ingredient.objects.create(
food=f, unit=u, amount=amount, note=note
))
if len(recipe_json['description'].strip()) > 500:
step.instruction = recipe_json['description'].strip() + '\n\n' + step.instruction
for ingredient in recipe_json['recipe_ingredient']:
try:
if ingredient['food']:
f = get_food(ingredient['food'], self.request.space)
u = get_unit(ingredient['unit'], self.request.space)
amount = ingredient['quantity']
note = ingredient['note']
else:
amount, unit, ingredient, note = parse(ingredient['note'])
f = get_food(ingredient, self.request.space)
u = get_unit(unit, self.request.space)
step.ingredients.add(Ingredient.objects.create(
food=f, unit=u, amount=amount, note=note, space=self.request.space,
))
except:
pass
recipe.steps.add(step)
for f in self.files:
if '.zip' in f['name']:
import_zip = ZipFile(f['file'])
for z in import_zip.filelist:
if re.match(f'^images/{recipe_json["slug"]}.jpg$', z.filename):
self.import_recipe_image(recipe, BytesIO(import_zip.read(z.filename)))
try:
self.import_recipe_image(recipe, BytesIO(import_zip.read(f'recipes/{recipe_json["slug"]}/images/min-original.webp')), filetype=get_filetype(f'recipes/{recipe_json["slug"]}/images/original'))
except:
pass
return recipe

View File

@@ -44,7 +44,7 @@ class MealMaster(Integration):
recipe.keywords.add(keyword)
step = Step.objects.create(
instruction='\n'.join(directions) + '\n\n'
instruction='\n'.join(directions) + '\n\n', space=self.request.space,
)
for ingredient in ingredients:
@@ -53,7 +53,7 @@ class MealMaster(Integration):
f = get_food(ingredient, self.request.space)
u = get_unit(unit, self.request.space)
step.ingredients.add(Ingredient.objects.create(
food=f, unit=u, amount=amount, note=note
food=f, unit=u, amount=amount, note=note, space=self.request.space,
))
recipe.steps.add(step)

View File

@@ -3,6 +3,7 @@ import re
from io import BytesIO
from zipfile import ZipFile
from cookbook.helper.image_processing import get_filetype
from cookbook.helper.ingredient_parser import parse, get_food, get_unit
from cookbook.integration.integration import Integration
from cookbook.models import Recipe, Step, Food, Unit, Ingredient
@@ -11,13 +12,15 @@ from cookbook.models import Recipe, Step, Food, Unit, Ingredient
class NextcloudCookbook(Integration):
def import_file_name_filter(self, zip_info_object):
return re.match(r'^Recipes/([A-Za-z\d\s])+/recipe.json$', zip_info_object.filename)
return zip_info_object.filename.endswith('.json')
def get_recipe_from_file(self, file):
recipe_json = json.loads(file.getvalue().decode("utf-8"))
description = '' if len(recipe_json['description'].strip()) > 500 else recipe_json['description'].strip()
recipe = Recipe.objects.create(
name=recipe_json['name'].strip(), description=recipe_json['description'].strip(),
name=recipe_json['name'].strip(), description=description,
created_by=self.request.user, internal=True,
servings=recipe_json['recipeYield'], space=self.request.space)
@@ -27,9 +30,12 @@ class NextcloudCookbook(Integration):
ingredients_added = False
for s in recipe_json['recipeInstructions']:
step = Step.objects.create(
instruction=s
instruction=s, space=self.request.space,
)
if not ingredients_added:
if len(recipe_json['description'].strip()) > 500:
step.instruction = recipe_json['description'].strip() + '\n\n' + step.instruction
ingredients_added = True
for ingredient in recipe_json['recipeIngredient']:
@@ -37,7 +43,7 @@ class NextcloudCookbook(Integration):
f = get_food(ingredient, self.request.space)
u = get_unit(unit, self.request.space)
step.ingredients.add(Ingredient.objects.create(
food=f, unit=u, amount=amount, note=note
food=f, unit=u, amount=amount, note=note, space=self.request.space,
))
recipe.steps.add(step)
@@ -46,7 +52,7 @@ class NextcloudCookbook(Integration):
import_zip = ZipFile(f['file'])
for z in import_zip.filelist:
if re.match(f'^Recipes/{recipe.name}/full.jpg$', z.filename):
self.import_recipe_image(recipe, BytesIO(import_zip.read(z.filename)))
self.import_recipe_image(recipe, BytesIO(import_zip.read(z.filename)), filetype=get_filetype(z.filename))
return recipe

View File

@@ -0,0 +1,71 @@
import json
import re
from django.utils.translation import gettext as _
from cookbook.helper.ingredient_parser import parse, get_food, get_unit
from cookbook.integration.integration import Integration
from cookbook.models import Recipe, Step, Food, Unit, Ingredient
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,
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"]
step = Step.objects.create(instruction=instructions, space=self.request.space,)
for ingredient in file['ingredients']:
f = get_food(ingredient['food'], self.request.space)
u = get_unit(ingredient['unit'], self.request.space)
step.ingredients.add(Ingredient.objects.create(
food=f, unit=u, amount=ingredient['amount'], space=self.request.space,
))
recipe.steps.add(step)
return recipe
def split_recipe_file(self, file):
recipe_json = json.loads(file.read())
recipe_dict = {}
ingredient_group_dict = {}
for o in recipe_json:
if o['model'] == 'recipe.recipe':
recipe_dict[o['pk']] = {
'name': o['fields']['title'],
'info': o['fields']['info'],
'directions': o['fields']['directions'],
'source': o['fields']['source'],
'prep_time': o['fields']['prep_time'],
'cook_time': o['fields']['cook_time'],
'servings': o['fields']['servings'],
'ingredients': [],
}
if o['model'] == 'ingredient.ingredientgroup':
ingredient_group_dict[o['pk']] = o['fields']['recipe']
for o in recipe_json:
if o['model'] == 'ingredient.ingredient':
ingredient = {
'food': o['fields']['title'],
'unit': o['fields']['measurement'],
'amount': round(o['fields']['numerator'] / o['fields']['denominator'], 2),
}
recipe_dict[ingredient_group_dict[o['fields']['ingredient_group']]]['ingredients'].append(ingredient)
return list(recipe_dict.values())
def get_file_from_recipe(self, recipe):
raise NotImplementedError('Method not implemented in storage integration')

View File

@@ -20,11 +20,13 @@ class Paprika(Integration):
recipe_json = json.loads(recipe_zip.read().decode("utf-8"))
recipe = Recipe.objects.create(
name=recipe_json['name'].strip(), description=recipe_json['description'].strip(),
created_by=self.request.user, internal=True, space=self.request.space)
name=recipe_json['name'].strip(), created_by=self.request.user, internal=True, space=self.request.space)
if 'description' in recipe_json:
recipe.description = '' if len(recipe_json['description'].strip()) > 500 else recipe_json['description'].strip()
try:
if re.match(r'([0-9])+\s(.)*', recipe_json['servings'] ):
if re.match(r'([0-9])+\s(.)*', recipe_json['servings']):
s = recipe_json['servings'].split(' ')
recipe.servings = s[0]
recipe.servings_text = s[1]
@@ -40,34 +42,45 @@ class Paprika(Integration):
recipe.save()
instructions = recipe_json['directions']
if len(recipe_json['notes'].strip()) > 0:
if recipe_json['notes'] and len(recipe_json['notes'].strip()) > 0:
instructions += '\n\n### ' + _('Notes') + ' \n' + recipe_json['notes']
if len(recipe_json['nutritional_info'].strip()) > 0:
if recipe_json['nutritional_info'] and len(recipe_json['nutritional_info'].strip()) > 0:
instructions += '\n\n### ' + _('Nutritional Information') + ' \n' + recipe_json['nutritional_info']
if len(recipe_json['source'].strip()) > 0 or len(recipe_json['source_url'].strip()) > 0:
instructions += '\n\n### ' + _('Source') + ' \n' + recipe_json['source'].strip() + ' \n' + recipe_json['source_url'].strip()
try:
if len(recipe_json['source'].strip()) > 0 or len(recipe_json['source_url'].strip()) > 0:
instructions += '\n\n### ' + _('Source') + ' \n' + recipe_json['source'].strip() + ' \n' + recipe_json['source_url'].strip()
except AttributeError:
pass
step = Step.objects.create(
instruction=instructions
instruction=instructions, space=self.request.space,
)
if len(recipe_json['description'].strip()) > 500:
step.instruction = recipe_json['description'].strip() + '\n\n' + step.instruction
if 'categories' in recipe_json:
for c in recipe_json['categories']:
keyword, created = Keyword.objects.get_or_create(name=c.strip(), space=self.request.space)
recipe.keywords.add(keyword)
for ingredient in recipe_json['ingredients'].split('\n'):
if len(ingredient.strip()) > 0:
amount, unit, ingredient, note = parse(ingredient)
f = get_food(ingredient, self.request.space)
u = get_unit(unit, self.request.space)
step.ingredients.add(Ingredient.objects.create(
food=f, unit=u, amount=amount, note=note
))
try:
for ingredient in recipe_json['ingredients'].split('\n'):
if len(ingredient.strip()) > 0:
amount, unit, ingredient, note = parse(ingredient)
f = get_food(ingredient, self.request.space)
u = get_unit(unit, self.request.space)
step.ingredients.add(Ingredient.objects.create(
food=f, unit=u, amount=amount, note=note, space=self.request.space,
))
except AttributeError:
pass
recipe.steps.add(step)
self.import_recipe_image(recipe, BytesIO(base64.b64decode(recipe_json['photo_data'])))
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

@@ -0,0 +1,136 @@
import re
import json
import base64
import requests
from io import BytesIO
from zipfile import ZipFile
import imghdr
from django.utils.translation import gettext as _
from cookbook.helper.image_processing import get_filetype
from cookbook.helper.ingredient_parser import parse, get_food, get_unit
from cookbook.integration.integration import Integration
from cookbook.models import Recipe, Step, Food, Unit, Ingredient, Keyword
class RecetteTek(Integration):
def import_file_name_filter(self, zip_info_object):
print("testing", zip_info_object.filename)
return re.match(r'^recipes_0.json$', zip_info_object.filename) or re.match(r'^recipes.json$', zip_info_object.filename)
def split_recipe_file(self, file):
recipe_json = json.loads(file)
recipe_list = [r for r in recipe_json]
return recipe_list
def get_recipe_from_file(self, file):
# Create initial recipe with just a title and a decription
recipe = Recipe.objects.create(name=file['title'], created_by=self.request.user, internal=True, space=self.request.space, )
# set the description as an empty string for later use for the source URL, incase there is no description text.
recipe.description = ''
try:
if file['description'] != '':
recipe.description = file['description'].strip()
except Exception as e:
print(recipe.name, ': failed to parse recipe description ', str(e))
instructions = file['instructions']
if not instructions:
instructions = ''
step = Step.objects.create(instruction=instructions, space=self.request.space,)
# Append the original import url to the step (if it exists)
try:
if file['url'] != '':
step.instruction += '\n\nImported from: ' + file['url']
step.save()
except Exception as e:
print(recipe.name, ': failed to import source url ', str(e))
try:
# Process the ingredients. Assumes 1 ingredient per line.
for ingredient in file['ingredients'].split('\n'):
if len(ingredient.strip()) > 0:
amount, unit, ingredient, note = parse(ingredient)
f = get_food(ingredient, self.request.space)
u = get_unit(unit, self.request.space)
step.ingredients.add(Ingredient.objects.create(
food=f, unit=u, amount=amount, note=note, space=self.request.space,
))
except Exception as e:
print(recipe.name, ': failed to parse recipe ingredients ', str(e))
recipe.steps.add(step)
# Attempt to import prep/cooking times
# quick hack, this assumes only one number in the quantity field.
try:
if file['quantity'] != '':
for item in file['quantity'].split(' '):
if item.isdigit():
recipe.servings = int(item)
break
except Exception as e:
print(recipe.name, ': failed to parse quantity ', str(e))
try:
if file['totalTime'] != '':
recipe.waiting_time = int(file['totalTime'])
except Exception as e:
print(recipe.name, ': failed to parse total times ', str(e))
try:
if file['preparationTime'] != '':
recipe.working_time = int(file['preparationTime'])
except Exception as e:
print(recipe.name, ': failed to parse prep time ', str(e))
try:
if file['cookingTime'] != '':
recipe.waiting_time = int(file['cookingTime'])
except Exception as e:
print(recipe.name, ': failed to parse cooking time ', str(e))
recipe.save()
# Import the recipe keywords
try:
if file['keywords'] != '':
for keyword in file['keywords'].split(';'):
k, created = Keyword.objects.get_or_create(name=keyword.strip(), space=self.request.space)
recipe.keywords.add(k)
recipe.save()
except Exception as e:
pass
# TODO: Parse Nutritional Information
# Import the original image from the zip file, if we cannot do that, attempt to download it again.
try:
if file['pictures'][0] != '':
image_file_name = file['pictures'][0].split('/')[-1]
for f in self.files:
if '.rtk' in f['name']:
import_zip = ZipFile(f['file'])
self.import_recipe_image(recipe, BytesIO(import_zip.read(image_file_name)), filetype=get_filetype(image_file_name))
else:
if file['originalPicture'] != '':
response = requests.get(file['originalPicture'])
if imghdr.what(BytesIO(response.content)) != None:
self.import_recipe_image(recipe, BytesIO(response.content), filetype=get_filetype(file['originalPicture']))
else:
raise Exception("Original image failed to download.")
except Exception as e:
print(recipe.name, ': failed to import image ', str(e))
return recipe
def get_file_from_recipe(self, recipe):
raise NotImplementedError('Method not implemented in storage integration')

View File

@@ -0,0 +1,80 @@
import re
from bs4 import BeautifulSoup
from io import BytesIO
from zipfile import ZipFile
from django.utils.translation import gettext as _
from cookbook.helper.ingredient_parser import parse, get_food, get_unit
from cookbook.helper.recipe_url_import import parse_servings, iso_duration_to_minutes
from cookbook.integration.integration import Integration
from cookbook.models import Recipe, Step, Food, Unit, Ingredient, Keyword
class RecipeKeeper(Integration):
def import_file_name_filter(self, zip_info_object):
return re.match(r'^recipes.html$', zip_info_object.filename)
def split_recipe_file(self, file):
recipe_html = BeautifulSoup(file, 'html.parser')
return recipe_html.find_all('div', class_='recipe-details')
def get_recipe_from_file(self, file):
# 'file' comes is as a beautifulsoup object
recipe = Recipe.objects.create(name=file.find("h2", {"itemprop": "name"}).text.strip(), created_by=self.request.user, internal=True, space=self.request.space, )
# add 'Courses' and 'Categories' as keywords
for course in file.find_all("span", {"itemprop": "recipeCourse"}):
keyword, created = Keyword.objects.get_or_create(name=course.text, space=self.request.space)
recipe.keywords.add(keyword)
for category in file.find_all("meta", {"itemprop": "recipeCategory"}):
keyword, created = Keyword.objects.get_or_create(name=category.get("content"), space=self.request.space)
recipe.keywords.add(keyword)
try:
recipe.servings = parse_servings(file.find("span", {"itemprop": "recipeYield"}).text.strip())
recipe.working_time = iso_duration_to_minutes(file.find("span", {"meta": "prepTime"}).text.strip())
recipe.waiting_time = iso_duration_to_minutes(file.find("span", {"meta": "cookTime"}).text.strip())
recipe.save()
except AttributeError:
pass
step = Step.objects.create(instruction='', space=self.request.space,)
for ingredient in file.find("div", {"itemprop": "recipeIngredients"}).findChildren("p"):
if ingredient.text == "":
continue
amount, unit, ingredient, note = parse(ingredient.text.strip())
f = get_food(ingredient, self.request.space)
u = get_unit(unit, self.request.space)
step.ingredients.add(Ingredient.objects.create(
food=f, unit=u, amount=amount, note=note, space=self.request.space,
))
for s in file.find("div", {"itemprop": "recipeDirections"}).find_all("p"):
if s.text == "":
continue
step.instruction += s.text + ' \n'
if file.find("span", {"itemprop": "recipeSource"}).text != '':
step.instruction += "\n\nImported from: " + file.find("span", {"itemprop": "recipeSource"}).text
step.save()
source_url_added = True
recipe.steps.add(step)
# import the Primary recipe image that is stored in the Zip
try:
for f in self.files:
if '.zip' in f['name']:
import_zip = ZipFile(f['file'])
self.import_recipe_image(recipe, BytesIO(import_zip.read(file.find("img", class_="recipe-photo").get("src"))), filetype='.jpeg')
except Exception as e:
pass
return recipe
def get_file_from_recipe(self, recipe):
raise NotImplementedError('Method not implemented in storage integration')

View File

@@ -36,7 +36,7 @@ class RecipeSage(Integration):
ingredients_added = False
for s in file['recipeInstructions']:
step = Step.objects.create(
instruction=s['text']
instruction=s['text'], space=self.request.space,
)
if not ingredients_added:
ingredients_added = True
@@ -46,7 +46,7 @@ class RecipeSage(Integration):
f = get_food(ingredient, self.request.space)
u = get_unit(unit, self.request.space)
step.ingredients.add(Ingredient.objects.create(
food=f, unit=u, amount=amount, note=note
food=f, unit=u, amount=amount, note=note, space=self.request.space,
))
recipe.steps.add(step)

View File

@@ -43,7 +43,7 @@ class RezKonv(Integration):
recipe.keywords.add(keyword)
step = Step.objects.create(
instruction='\n'.join(directions) + '\n\n'
instruction='\n'.join(directions) + '\n\n', space=self.request.space,
)
for ingredient in ingredients:
@@ -52,7 +52,7 @@ class RezKonv(Integration):
f = get_food(ingredient, self.request.space)
u = get_unit(unit, self.request.space)
step.ingredients.add(Ingredient.objects.create(
food=f, unit=u, amount=amount, note=note
food=f, unit=u, amount=amount, note=note, space=self.request.space,
))
recipe.steps.add(step)

View File

@@ -43,14 +43,14 @@ class Safron(Integration):
recipe = Recipe.objects.create(name=title, description=description, created_by=self.request.user, internal=True, space=self.request.space, )
step = Step.objects.create(instruction='\n'.join(directions))
step = Step.objects.create(instruction='\n'.join(directions), space=self.request.space,)
for ingredient in ingredients:
amount, unit, ingredient, note = parse(ingredient)
f = get_food(ingredient, self.request.space)
u = get_unit(unit, self.request.space)
step.ingredients.add(Ingredient.objects.create(
food=f, unit=u, amount=amount, note=note
food=f, unit=u, amount=amount, note=note, space=self.request.space,
))
recipe.steps.add(step)

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

@@ -6,20 +6,21 @@
# Translators:
# H K <hkocharyan@ctemplar.com>, 2021
#
#, fuzzy
msgid ""
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: 2020-06-02 19:28+0000\n"
"Last-Translator: H K <hkocharyan@ctemplar.com>, 2021\n"
"Language-Team: Armenian (https://www.transifex.com/django-recipes/teams/110507/hy/)\n"
"PO-Revision-Date: 2021-04-12 20:22+0000\n"
"Last-Translator: Hrachya Kocharyan <hkocharyan@ctemplar.com>\n"
"Language-Team: Armenian <http://translate.tandoor.dev/projects/tandoor/"
"recipes-backend/hy/>\n"
"Language: hy\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: hy\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Weblate 4.5.3\n"
#: .\cookbook\filters.py:22 .\cookbook\templates\base.html:87
#: .\cookbook\templates\forms\edit_internal_recipe.html:219
@@ -54,7 +55,7 @@ msgid ""
"shared by default."
msgstr ""
"Օգտատերեր, ում հետ նոր ստեղծված ճաշացուցակները/գնումների ցուցակները պետք է "
"կիսվեն լռելյայն"
"կիսվեն լռելյայն:"
#: .\cookbook\forms.py:48
msgid "Show recently viewed recipes on search page."
@@ -62,7 +63,7 @@ msgstr "Ցույց տալ վերջերս դիտած բաղադրատոմսերը
#: .\cookbook\forms.py:49
msgid "Number of decimals to round ingredients."
msgstr "Բաղադրիչների կլորացման համար տասնորդականների քանակը"
msgstr "Բաղադրիչների կլորացման համար տասնորդականների քանակը:"
#: .\cookbook\forms.py:50
msgid "If you want to be able to create and see comments underneath recipes."
@@ -84,7 +85,7 @@ msgstr ""
#: .\cookbook\forms.py:55
msgid "Makes the navbar stick to the top of the page."
msgstr "Կցել նավիգացիոն տողը էջի վերևում"
msgstr "Կցել նավիգացիոն տողը էջի վերևում:"
#: .\cookbook\forms.py:71
msgid ""
@@ -152,7 +153,7 @@ msgstr "Հին միավոր"
#: .\cookbook\forms.py:169
msgid "Unit that should be replaced."
msgstr "Փոխարինման ենթակա միավոր"
msgstr "Փոխարինման ենթակա միավոր:"
#: .\cookbook\forms.py:179
msgid "New Food"
@@ -172,7 +173,7 @@ msgstr "Փոխարինման ենթակա սննդամթերք։"
#: .\cookbook\forms.py:198
msgid "Add your comment: "
msgstr "Ավելացրեք ձեր մեկնաբանությունը՝"
msgstr "Ավելացրեք ձեր մեկնաբանությունը՝ "
#: .\cookbook\forms.py:229
msgid "Leave empty for dropbox and enter app password for nextcloud."
@@ -190,8 +191,8 @@ msgid ""
"Leave empty for dropbox and enter only base url for nextcloud "
"(<code>/remote.php/webdav/</code> is added automatically)"
msgstr ""
"Թողնել դատարկ dropbox-ի համար և մուտքագրել միայն հիմքային հղումը nextcloud-ի"
" համար (<code>/remote.php/webdav/</code> ինքնաբերաբար ավելացվում է)"
"Թողնել դատարկ dropbox-ի համար և մուտքագրել միայն հիմքային հղումը nextcloud-ի "
"համար (<code>/remote.php/webdav/</code> ինքնաբերաբար ավելացվում է)"
#: .\cookbook\forms.py:263
msgid "Search String"
@@ -203,13 +204,13 @@ msgstr "Ֆայլի ID"
#: .\cookbook\forms.py:299
msgid "You must provide at least a recipe or a title."
msgstr "Դուք պետք է տրամադրեք առնվազն բաղադրատոմս կամ վերնագիր"
msgstr "Դուք պետք է տրամադրեք առնվազն բաղադրատոմս կամ վերնագիր:"
#: .\cookbook\forms.py:312
msgid "You can list default users to share recipes with in the settings."
msgstr ""
"Դուք կարող եք կարգավորումներում ավելացնել այն օգտատերերին, ում հետ "
"բաղադրատոմսերը պետք է կիսվեն լռելյայն"
"բաղադրատոմսերը պետք է կիսվեն լռելյայն:"
#: .\cookbook\forms.py:313
#: .\cookbook\templates\forms\edit_internal_recipe.html:377
@@ -289,7 +290,7 @@ msgstr "Պատրաստման տևողություն"
#: .\cookbook\templates\forms\ingredients.html:7
#: .\cookbook\templates\index.html:7
msgid "Cookbook"
msgstr "Խոհարարական գիրք "
msgstr "Խոհարարական գիրք"
#: .\cookbook\integration\safron.py:31
msgid "Section"
@@ -409,7 +410,7 @@ msgstr "Դուրս գալ"
#: .\cookbook\templates\account\logout.html:11
msgid "Are you sure you want to sign out?"
msgstr "Համոզվա՞ծ եք, որ ցանկանում եք դուրս գալ"
msgstr "Համոզվա՞ծ եք, որ ցանկանում եք դուրս գալ:"
#: .\cookbook\templates\account\password_reset.html:5
#: .\cookbook\templates\account\password_reset_done.html:5
@@ -419,7 +420,7 @@ msgstr "Գաղտնաբառի վերականգնում"
#: .\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 "Գաղտնաբառի վերականգնում առայժմ իրականացված չէ:"
#: .\cookbook\templates\account\signup.html:5
msgid "Register"
@@ -478,7 +479,7 @@ msgstr "Բացահայտումների մատյան"
#: .\cookbook\templates\base.html:117 .\cookbook\templates\stats.html:10
msgid "Statistics"
msgstr "Վիճակագրություն "
msgstr "Վիճակագրություն"
#: .\cookbook\templates\base.html:119
msgid "Units & Ingredients"
@@ -910,7 +911,7 @@ msgstr "Գրանցել բաղադրատոմսի օգտագործում"
#: .\cookbook\templates\include\log_cooking.html:13
msgid "All fields are optional and can be left empty."
msgstr "Բոլոր դաշտերը կամավոր են և կարող են դատարկ թողնվել"
msgstr "Բոլոր դաշտերը կամավոր են և կարող են դատարկ թողնվել:"
#: .\cookbook\templates\include\log_cooking.html:19
msgid "Rating"
@@ -1201,7 +1202,7 @@ msgid ""
" view."
msgstr ""
"Շաբաթվա առաջին օրվանից հաշված օրերի քանակը, որը պետք է փոխհատուցել լռելյայն "
"էջում"
"էջում:"
#: .\cookbook\templates\meal_plan.html:217
#: .\cookbook\templates\meal_plan.html:294
@@ -1287,7 +1288,7 @@ msgstr "Ճաշացուցակի Դիտման էջ"
#: .\cookbook\templates\meal_plan_entry.html:50
msgid "Never cooked before."
msgstr "Երբեք պատրաստված չէ"
msgstr "Երբեք պատրաստված չէ:"
#: .\cookbook\templates\meal_plan_entry.html:76
msgid "Other meals on this day"
@@ -1412,7 +1413,7 @@ msgstr "Կարգավորում"
msgid ""
"To start using this application you must first create a superuser account."
msgstr ""
"Այս ծրագիրն օգտագործելու համար նախ պետք է ստեղծեք սուպեր-օգտատերի հաշիվ"
"Այս ծրագիրն օգտագործելու համար նախ պետք է ստեղծեք սուպեր-օգտատերի հաշիվ:"
#: .\cookbook\templates\setup.html:20
msgid "Create Superuser account"
@@ -1468,7 +1469,7 @@ msgstr "Ցուցակի նախածանց"
#: .\cookbook\templates\shopping_list.html:696
msgid "There was an error creating a resource!"
msgstr "Ռեսուրսը ստեղծելիս սխալ է գրանցվել"
msgstr "Ռեսուրսը ստեղծելիս սխալ է գրանցվել:"
#: .\cookbook\templates\socialaccount\connections.html:4
#: .\cookbook\templates\socialaccount\connections.html:7
@@ -1490,7 +1491,7 @@ msgstr "Հեռացնել"
#: .\cookbook\templates\socialaccount\connections.html:44
msgid ""
"You currently have no social network accounts connected to this account."
msgstr "Դուք այս հաշվին կապված սոցիալական հաշիվներ չունեք "
msgstr "Դուք այս հաշվին կապված սոցիալական հաշիվներ չունեք:"
#: .\cookbook\templates\socialaccount\connections.html:47
msgid "Add a 3rd Party Account"
@@ -1534,7 +1535,7 @@ msgstr "Ցուցադրել հղումները"
#: .\cookbook\templates\system.html:27
msgid "Backup & Restore"
msgstr "Կրկնօրինակում և վերականգնում "
msgstr "Կրկնօրինակում և վերականգնում"
#: .\cookbook\templates\system.html:28
msgid "Download Backup"
@@ -1673,7 +1674,7 @@ msgstr "Բոլոր բանալի բառերը"
#: .\cookbook\templates\url_import.html:206
msgid "Import all keywords, not only the ones already existing."
msgstr "Ներմուծել բոլոր բանալի բառերը, ոչ միայն արդեն գոյություն ունեցողները"
msgstr "Ներմուծել բոլոր բանալի բառերը, ոչ միայն արդեն գոյություն ունեցողները:"
#: .\cookbook\templates\url_import.html:233
msgid "Information"
@@ -1719,7 +1720,7 @@ msgstr "Այս հատկությունը հասանելի չէ փորձնական
#: .\cookbook\views\api.py:439
msgid "Sync successful!"
msgstr "Սինքրոնիզացիան հաջողված է"
msgstr "Սինքրոնիզացիան հաջողված է:"
#: .\cookbook\views\api.py:444
msgid "Error synchronizing with Storage"
@@ -1727,20 +1728,20 @@ msgstr "Պահոցի հետ սինքրոնիզացիայի սխալ"
#: .\cookbook\views\api.py:510
msgid "The requested page could not be found."
msgstr "Պահանջվող էջը չի գտնվել"
msgstr "Պահանջվող էջը չի գտնվել:"
#: .\cookbook\views\api.py:519
msgid ""
"The requested page refused to provide any information (Status Code 403)."
msgstr ""
"Պահանջվող էջը մերժեց տրամադրել որևէ տեղեկություն (Կարգավիճակի ծածկագիր 403)"
"Պահանջվող էջը մերժեց տրամադրել որևէ տեղեկություն (Կարգավիճակի ծածկագիր 403):"
#: .\cookbook\views\data.py:101
#, python-format
msgid "Batch edit done. %(count)d recipe was updated."
msgid_plural "Batch edit done. %(count)d Recipes where updated."
msgstr[0] "Խմբային խմբագրումն ավարտված է։ %(count)d բաղադրատոմս թարմացված է"
msgstr[1] "Խմբային խմբագրումն ավարտված է։ %(count)d բաղադրատոմս թարմացված է։"
msgstr[0] "Խմբային խմբագրումն ավարտված է։ %(count)d բաղադրատոմս թարմացված է:"
msgstr[1] "Խմբային խմբագրումն ավարտված է։ %(count)d բաղադրատոմսեր թարմացված են։"
#: .\cookbook\views\delete.py:72
msgid "Monitor"
@@ -1779,7 +1780,7 @@ msgstr "Դուք կարող եք խմբագրել այս պահոցը։"
#: .\cookbook\views\edit.py:131
msgid "Storage saved!"
msgstr "Պահոցը պահպանված է"
msgstr "Պահոցը պահպանված է։"
#: .\cookbook\views\edit.py:137
msgid "There was an error updating this storage backend!"
@@ -1791,23 +1792,23 @@ msgstr "Պահոց"
#: .\cookbook\views\edit.py:245
msgid "Changes saved!"
msgstr "Փոփոխությունները պահպանված են"
msgstr "Փոփոխությունները պահպանված են:"
#: .\cookbook\views\edit.py:253
msgid "Error saving changes!"
msgstr "Փոփոխությունների պահպանման սխալ"
msgstr "Փոփոխությունների պահպանման սխալ:"
#: .\cookbook\views\edit.py:289
msgid "Units merged!"
msgstr "Միավորները միավորված են"
msgstr "Միավորները միավորված են:"
#: .\cookbook\views\edit.py:295 .\cookbook\views\edit.py:317
msgid "Cannot merge with the same object!"
msgstr "Հնարավոր չէ միավորել նույն օբյեկտի հետ"
msgstr "Հնարավոր չէ միավորել նույն օբյեկտի հետ:"
#: .\cookbook\views\edit.py:311
msgid "Foods merged!"
msgstr "Սննդամթերքները միավորված են"
msgstr "Սննդամթերքները միավորված են:"
#: .\cookbook\views\import_export.py:42
msgid "Importing is not implemented for this provider"
@@ -1831,7 +1832,7 @@ msgstr "Գնումների ցուցակներ"
#: .\cookbook\views\new.py:107
msgid "Imported new recipe!"
msgstr "Բաղադրատոմսը ներմուծված է"
msgstr "Բաղադրատոմսը ներմուծված է:"
#: .\cookbook\views\new.py:114
msgid "There was an error importing this recipe!"
@@ -1843,15 +1844,15 @@ msgstr "Դուք չունեք բավարար թույլտվություն այս
#: .\cookbook\views\views.py:136
msgid "Comment saved!"
msgstr "Մեկնաբանությունը պահպանված է"
msgstr "Մեկնաբանությունը պահպանված է:"
#: .\cookbook\views\views.py:152
msgid "This recipe is already linked to the book!"
msgstr "Բաղադրատոմսն արդեն կապված է գրքին"
msgstr "Բաղադրատոմսն արդեն կապված է գրքին:"
#: .\cookbook\views\views.py:158
msgid "Bookmark saved!"
msgstr "Էջանիշը պահպանված է"
msgstr "Էջանիշը պահպանված է:"
#: .\cookbook\views\views.py:380
msgid ""
@@ -1865,7 +1866,7 @@ msgstr ""
#: .\cookbook\views\views.py:388 .\cookbook\views\views.py:435
msgid "Passwords dont match!"
msgstr "Գաղտնաբառերը չեն համընկնում"
msgstr "Գաղտնաբառերը չեն համընկնում:"
#: .\cookbook\views\views.py:402 .\cookbook\views\views.py:449
msgid "User has been created, please login!"
@@ -1877,4 +1878,4 @@ msgstr "Հրավերի արատավոր հղում է տրամադրվել։"
#: .\cookbook\views\views.py:470
msgid "Invite Link not valid or already used!"
msgstr "Հրավերի հղումը վավեր չէ, կամ արդեն օգտագործվել է"
msgstr "Հրավերի հղումը վավեր չէ, կամ արդեն օգտագործվել է:"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

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

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,15 @@
# Generated by Django 3.2 on 2021-04-11 19:01
from django.contrib.postgres.operations import UnaccentExtension, TrigramExtension
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0118_auto_20210406_1805'),
]
operations = [
TrigramExtension(),
UnaccentExtension(),
]

View File

@@ -0,0 +1,34 @@
# Generated by Django 3.1.7 on 2021-03-29 11:05
import cookbook.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('cookbook', '0119_auto_20210411_2101'),
]
operations = [
migrations.AlterField(
model_name='userpreference',
name='use_fractions',
field=models.BooleanField(default=True),
),
migrations.CreateModel(
name='BookmarkletImport',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('html', models.TextField()),
('url', models.CharField(blank=True, max_length=256, null=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('created_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
('space', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cookbook.space')),
],
bases=(models.Model, cookbook.models.PermissionModelMixin),
),
]

View File

@@ -0,0 +1,23 @@
# Generated by Django 3.2.3 on 2021-05-18 14:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0120_bookmarklet'),
]
operations = [
migrations.AlterField(
model_name='userpreference',
name='search_style',
field=models.CharField(choices=[('SMALL', 'Small'), ('LARGE', 'Large'), ('NEW', 'New')], default='LARGE', max_length=64),
),
migrations.AlterField(
model_name='userpreference',
name='use_fractions',
field=models.BooleanField(default=False),
),
]

View File

@@ -0,0 +1,23 @@
# Generated by Django 3.2.3 on 2021-05-27 15:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0121_auto_20210518_1638'),
]
operations = [
migrations.AddField(
model_name='space',
name='allow_files',
field=models.BooleanField(default=True),
),
migrations.AddField(
model_name='space',
name='max_users',
field=models.IntegerField(default=0),
),
]

View File

@@ -0,0 +1,18 @@
# Generated by Django 3.2.3 on 2021-05-28 12:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0122_auto_20210527_1712'),
]
operations = [
migrations.AddField(
model_name='invitelink',
name='email',
field=models.EmailField(blank=True, max_length=254),
),
]

View File

@@ -0,0 +1,18 @@
# Generated by Django 3.2.3 on 2021-05-30 15:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0123_invitelink_email'),
]
operations = [
migrations.AlterField(
model_name='userpreference',
name='theme',
field=models.CharField(choices=[('BOOTSTRAP', 'Bootstrap'), ('DARKLY', 'Darkly'), ('FLATLY', 'Flatly'), ('SUPERHERO', 'Superhero'), ('TANDOOR', 'Tandoor')], default='FLATLY', max_length=128),
),
]

View File

@@ -0,0 +1,18 @@
# Generated by Django 3.2.3 on 2021-06-04 14:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0124_alter_userpreference_theme'),
]
operations = [
migrations.AddField(
model_name='space',
name='demo',
field=models.BooleanField(default=False),
),
]

View File

@@ -0,0 +1,18 @@
# Generated by Django 3.2.3 on 2021-06-05 15:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0125_space_demo'),
]
operations = [
migrations.AlterField(
model_name='userpreference',
name='theme',
field=models.CharField(choices=[('TANDOOR', 'Tandoor'), ('BOOTSTRAP', 'Bootstrap'), ('DARKLY', 'Darkly'), ('FLATLY', 'Flatly'), ('SUPERHERO', 'Superhero')], default='TANDOOR', max_length=128),
),
]

View File

@@ -0,0 +1,17 @@
# Generated by Django 3.2.3 on 2021-06-07 14:21
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0126_alter_userpreference_theme'),
]
operations = [
migrations.RemoveField(
model_name='invitelink',
name='username',
),
]

View File

@@ -0,0 +1,30 @@
# Generated by Django 3.2.3 on 2021-06-08 10:23
import cookbook.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('cookbook', '0127_remove_invitelink_username'),
]
operations = [
migrations.CreateModel(
name='UserFile',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=128)),
('file', models.FileField(upload_to='files/')),
('file_size_kb', models.IntegerField()),
('created_at', models.DateTimeField(auto_now_add=True)),
('created_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
('space', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cookbook.space')),
],
bases=(models.Model, cookbook.models.PermissionModelMixin),
),
]

View File

@@ -0,0 +1,22 @@
# Generated by Django 3.2.3 on 2021-06-08 10:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0128_userfile'),
]
operations = [
migrations.RemoveField(
model_name='space',
name='allow_files',
),
migrations.AddField(
model_name='space',
name='max_file_storage_mb',
field=models.IntegerField(default=0, help_text='Maximum file storage for space in MB. 0 for unlimited, -1 to disable file upload.'),
),
]

View File

@@ -0,0 +1,18 @@
# Generated by Django 3.2.3 on 2021-06-08 10:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0129_auto_20210608_1233'),
]
operations = [
migrations.AlterField(
model_name='userfile',
name='file_size_kb',
field=models.IntegerField(blank=True, default=0),
),
]

View File

@@ -0,0 +1,24 @@
# Generated by Django 3.2.4 on 2021-06-08 17:29
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0130_alter_userfile_file_size_kb'),
]
operations = [
migrations.AddField(
model_name='step',
name='file',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='cookbook.userfile'),
),
migrations.AlterField(
model_name='step',
name='type',
field=models.CharField(choices=[('TEXT', 'Text'), ('TIME', 'Time'), ('FILE', 'File')], default='TEXT', max_length=16),
),
]

View File

@@ -0,0 +1,18 @@
# Generated by Django 3.2.4 on 2021-06-12 18:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0131_auto_20210608_1929'),
]
operations = [
migrations.AddField(
model_name='sharelink',
name='request_count',
field=models.IntegerField(default=0),
),
]

View File

@@ -0,0 +1,18 @@
# Generated by Django 3.2.4 on 2021-06-12 18:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0132_sharelink_request_count'),
]
operations = [
migrations.AddField(
model_name='sharelink',
name='abuse_blocked',
field=models.BooleanField(default=False),
),
]

View File

@@ -0,0 +1,18 @@
# Generated by Django 3.2.4 on 2021-06-15 19:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0133_sharelink_abuse_blocked'),
]
operations = [
migrations.AddField(
model_name='space',
name='allow_sharing',
field=models.BooleanField(default=True),
),
]

View File

@@ -0,0 +1,29 @@
# Generated by Django 3.2.4 on 2021-06-15 20:10
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0134_space_allow_sharing'),
]
operations = [
migrations.AddField(
model_name='ingredient',
name='space',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='cookbook.space'),
),
migrations.AddField(
model_name='nutritioninformation',
name='space',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='cookbook.space'),
),
migrations.AddField(
model_name='step',
name='space',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='cookbook.space'),
),
]

View File

@@ -0,0 +1,23 @@
# Generated by Django 3.2.4 on 2021-06-17 11:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0135_auto_20210615_2210'),
]
operations = [
migrations.AddField(
model_name='importlog',
name='imported_recipes',
field=models.IntegerField(default=0),
),
migrations.AddField(
model_name='importlog',
name='total_recipes',
field=models.IntegerField(default=0),
),
]

View File

@@ -0,0 +1,34 @@
# Generated by Django 3.2.4 on 2021-06-17 13:01
from django.db import migrations
from django.db.models import Subquery, OuterRef
from django_scopes import scopes_disabled
from django.db import migrations, models
import django.db.models.deletion
def migrate_spaces(apps, schema_editor):
with scopes_disabled():
Recipe = apps.get_model('cookbook', 'Recipe')
Step = apps.get_model('cookbook', 'Step')
Ingredient = apps.get_model('cookbook', 'Ingredient')
NutritionInformation = apps.get_model('cookbook', 'NutritionInformation')
Step.objects.filter(recipe__isnull=True).delete()
Ingredient.objects.filter(step__recipe__isnull=True).delete()
NutritionInformation.objects.filter(recipe__isnull=True).delete()
Step.objects.update(space=Subquery(Step.objects.filter(pk=OuterRef('pk')).values('recipe__space')[:1]))
Ingredient.objects.update(space=Subquery(Ingredient.objects.filter(pk=OuterRef('pk')).values('step__recipe__space')[:1]))
NutritionInformation.objects.update(space=Subquery(NutritionInformation.objects.filter(pk=OuterRef('pk')).values('recipe__space')[:1]))
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0136_auto_20210617_1343'),
]
operations = [
migrations.RunPython(migrate_spaces),
]

View File

@@ -0,0 +1,31 @@
# Generated by Django 3.2.4 on 2021-06-17 14:02
from django.db import migrations
from django.db.models import Subquery, OuterRef
from django_scopes import scopes_disabled
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0137_auto_20210617_1501'),
]
operations = [
migrations.AlterField(
model_name='ingredient',
name='space',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cookbook.space'),
),
migrations.AlterField(
model_name='nutritioninformation',
name='space',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cookbook.space'),
),
migrations.AlterField(
model_name='step',
name='space',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cookbook.space'),
),
]

View File

@@ -0,0 +1,20 @@
# Generated by Django 3.2.4 on 2021-06-22 16:14
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0138_auto_20210617_1602'),
]
operations = [
migrations.AddField(
model_name='space',
name='created_at',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
]

View File

@@ -0,0 +1,20 @@
# Generated by Django 3.2.4 on 2021-06-22 16:19
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0139_space_created_at'),
]
operations = [
migrations.AddField(
model_name='userpreference',
name='created_at',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
]

View File

@@ -0,0 +1,24 @@
# Generated by Django 3.2.5 on 2021-07-13 08:42
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0140_userpreference_created_at'),
]
operations = [
migrations.AddField(
model_name='step',
name='step_recipe',
field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.PROTECT, to='cookbook.recipe'),
),
migrations.AlterField(
model_name='step',
name='type',
field=models.CharField(choices=[('TEXT', 'Text'), ('TIME', 'Time'), ('FILE', 'File'), ('RECIPE', 'Recipe')], default='TEXT', max_length=16),
),
]

View File

@@ -0,0 +1,18 @@
# Generated by Django 3.2.5 on 2021-07-29 14:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0141_auto_20210713_1042'),
]
operations = [
migrations.AlterField(
model_name='userpreference',
name='search_style',
field=models.CharField(choices=[('SMALL', 'Small'), ('LARGE', 'Large'), ('NEW', 'New')], default='NEW', max_length=64),
),
]

View File

@@ -1,3 +1,5 @@
import operator
import pathlib
import re
import uuid
from datetime import date, timedelta
@@ -5,10 +7,12 @@ from datetime import date, timedelta
from annoying.fields import AutoOneToOneField
from django.contrib import auth
from django.contrib.auth.models import Group, User
from django.core.files.uploadedfile import UploadedFile, InMemoryUploadedFile
from django.core.validators import MinLengthValidator
from django.db import models
from django.utils import timezone
from django.utils.translation import gettext as _
from django_prometheus.models import ExportModelOperationsMixin
from django_scopes import ScopedManager
from recipes.settings import (COMMENT_PREF_DEFAULT, FRACTION_PREF_DEFAULT,
@@ -52,16 +56,23 @@ class PermissionModelMixin:
def get_space(self):
p = '.'.join(self.get_space_key())
if getattr(self, p, None):
return getattr(self, p)
raise NotImplementedError('get space for method not implemented and standard fields not available')
try:
if space := operator.attrgetter(p)(self):
return space
except AttributeError:
raise NotImplementedError('get space for method not implemented and standard fields not available')
class Space(models.Model):
class Space(ExportModelOperationsMixin('space'), models.Model):
name = models.CharField(max_length=128, default='Default')
created_by = models.ForeignKey(User, on_delete=models.PROTECT, null=True)
created_at = models.DateTimeField(auto_now_add=True)
message = models.CharField(max_length=512, default='', blank=True)
max_recipes = models.IntegerField(default=0)
max_file_storage_mb = models.IntegerField(default=0, help_text=_('Maximum file storage for space in MB. 0 for unlimited, -1 to disable file upload.'))
max_users = models.IntegerField(default=0)
allow_sharing = models.BooleanField(default=True)
demo = models.BooleanField(default=False)
def __str__(self):
return self.name
@@ -73,12 +84,14 @@ class UserPreference(models.Model, PermissionModelMixin):
DARKLY = 'DARKLY'
FLATLY = 'FLATLY'
SUPERHERO = 'SUPERHERO'
TANDOOR = 'TANDOOR'
THEMES = (
(TANDOOR, 'Tandoor'),
(BOOTSTRAP, 'Bootstrap'),
(DARKLY, 'Darkly'),
(FLATLY, 'Flatly'),
(SUPERHERO, 'Superhero')
(SUPERHERO, 'Superhero'),
)
# Nav colors
@@ -115,11 +128,12 @@ class UserPreference(models.Model, PermissionModelMixin):
# Search Style
SMALL = 'SMALL'
LARGE = 'LARGE'
NEW = 'NEW'
SEARCH_STYLE = ((SMALL, _('Small')), (LARGE, _('Large')),)
SEARCH_STYLE = ((SMALL, _('Small')), (LARGE, _('Large')), (NEW, _('New')))
user = AutoOneToOneField(User, on_delete=models.CASCADE, primary_key=True)
theme = models.CharField(choices=THEMES, max_length=128, default=FLATLY)
theme = models.CharField(choices=THEMES, max_length=128, default=TANDOOR)
nav_color = models.CharField(
choices=COLORS, max_length=128, default=PRIMARY
)
@@ -129,7 +143,7 @@ class UserPreference(models.Model, PermissionModelMixin):
choices=PAGES, max_length=64, default=SEARCH
)
search_style = models.CharField(
choices=SEARCH_STYLE, max_length=64, default=LARGE
choices=SEARCH_STYLE, max_length=64, default=NEW
)
show_recent = models.BooleanField(default=True)
plan_share = models.ManyToManyField(
@@ -140,6 +154,7 @@ class UserPreference(models.Model, PermissionModelMixin):
shopping_auto_sync = models.IntegerField(default=5)
sticky_navbar = models.BooleanField(default=STICKY_NAV_PREF_DEFAULT)
created_at = models.DateTimeField(auto_now_add=True)
space = models.ForeignKey(Space, on_delete=models.CASCADE, null=True)
objects = ScopedManager(space='space')
@@ -242,7 +257,7 @@ class SyncLog(models.Model, PermissionModelMixin):
return f"{self.created_at}:{self.sync} - {self.status}"
class Keyword(models.Model, PermissionModelMixin):
class Keyword(ExportModelOperationsMixin('keyword'), models.Model, PermissionModelMixin):
name = models.CharField(max_length=64)
icon = models.CharField(max_length=16, blank=True, null=True)
description = models.TextField(default="", blank=True)
@@ -262,7 +277,7 @@ class Keyword(models.Model, PermissionModelMixin):
unique_together = (('space', 'name'),)
class Unit(models.Model, PermissionModelMixin):
class Unit(ExportModelOperationsMixin('unit'), models.Model, PermissionModelMixin):
name = models.CharField(max_length=128, validators=[MinLengthValidator(1)])
description = models.TextField(blank=True, null=True)
@@ -276,7 +291,7 @@ class Unit(models.Model, PermissionModelMixin):
unique_together = (('space', 'name'),)
class Food(models.Model, PermissionModelMixin):
class Food(ExportModelOperationsMixin('food'), models.Model, PermissionModelMixin):
name = models.CharField(max_length=128, validators=[MinLengthValidator(1)])
recipe = models.ForeignKey('Recipe', null=True, blank=True, on_delete=models.SET_NULL)
supermarket_category = models.ForeignKey(SupermarketCategory, null=True, blank=True, on_delete=models.SET_NULL)
@@ -293,7 +308,7 @@ class Food(models.Model, PermissionModelMixin):
unique_together = (('space', 'name'),)
class Ingredient(models.Model, PermissionModelMixin):
class Ingredient(ExportModelOperationsMixin('ingredient'), models.Model, PermissionModelMixin):
food = models.ForeignKey(Food, on_delete=models.PROTECT, null=True, blank=True)
unit = models.ForeignKey(Unit, on_delete=models.PROTECT, null=True, blank=True)
amount = models.DecimalField(default=0, decimal_places=16, max_digits=32)
@@ -302,14 +317,8 @@ class Ingredient(models.Model, PermissionModelMixin):
no_amount = models.BooleanField(default=False)
order = models.IntegerField(default=0)
objects = ScopedManager(space='step__recipe__space')
@staticmethod
def get_space_key():
return 'step', 'recipe', 'space'
def get_space(self):
return self.step_set.first().recipe_set.first().space
space = models.ForeignKey(Space, on_delete=models.CASCADE)
objects = ScopedManager(space='space')
def __str__(self):
return str(self.amount) + ' ' + str(self.unit) + ' ' + str(self.food)
@@ -318,13 +327,15 @@ class Ingredient(models.Model, PermissionModelMixin):
ordering = ['order', 'pk']
class Step(models.Model, PermissionModelMixin):
class Step(ExportModelOperationsMixin('step'), models.Model, PermissionModelMixin):
TEXT = 'TEXT'
TIME = 'TIME'
FILE = 'FILE'
RECIPE = 'RECIPE'
name = models.CharField(max_length=128, default='', blank=True)
type = models.CharField(
choices=((TEXT, _('Text')), (TIME, _('Time')),),
choices=((TEXT, _('Text')), (TIME, _('Time')), (FILE, _('File')), (RECIPE, _('Recipe')),),
default=TEXT,
max_length=16
)
@@ -332,16 +343,12 @@ class Step(models.Model, PermissionModelMixin):
ingredients = models.ManyToManyField(Ingredient, blank=True)
time = models.IntegerField(default=0, blank=True)
order = models.IntegerField(default=0)
file = models.ForeignKey('UserFile', on_delete=models.PROTECT, null=True, blank=True)
show_as_header = models.BooleanField(default=True)
step_recipe = models.ForeignKey('Recipe', default=None, blank=True, null=True, on_delete=models.PROTECT)
objects = ScopedManager(space='recipe__space')
@staticmethod
def get_space_key():
return 'recipe', 'space'
def get_space(self):
return self.recipe_set.first().space
space = models.ForeignKey(Space, on_delete=models.CASCADE)
objects = ScopedManager(space='space')
def get_instruction_render(self):
from cookbook.helper.template_helper import render_instructions
@@ -362,20 +369,14 @@ class NutritionInformation(models.Model, PermissionModelMixin):
max_length=512, default="", null=True, blank=True
)
objects = ScopedManager(space='recipe__space')
@staticmethod
def get_space_key():
return 'recipe', 'space'
def get_space(self):
return self.recipe_set.first().space
space = models.ForeignKey(Space, on_delete=models.CASCADE)
objects = ScopedManager(space='space')
def __str__(self):
return 'Nutrition'
return f'Nutrition {self.pk}'
class Recipe(models.Model, PermissionModelMixin):
class Recipe(ExportModelOperationsMixin('recipe'), models.Model, PermissionModelMixin):
name = models.CharField(max_length=128)
description = models.CharField(max_length=512, blank=True, null=True)
servings = models.IntegerField(default=1)
@@ -407,7 +408,7 @@ class Recipe(models.Model, PermissionModelMixin):
return self.name
class Comment(models.Model, PermissionModelMixin):
class Comment(ExportModelOperationsMixin('comment'), models.Model, PermissionModelMixin):
recipe = models.ForeignKey(Recipe, on_delete=models.CASCADE)
text = models.TextField()
created_by = models.ForeignKey(User, on_delete=models.CASCADE)
@@ -420,6 +421,9 @@ class Comment(models.Model, PermissionModelMixin):
def get_space_key():
return 'recipe', 'space'
def get_space(self):
return self.recipe.space
def __str__(self):
return self.text
@@ -438,7 +442,7 @@ class RecipeImport(models.Model, PermissionModelMixin):
return self.name
class RecipeBook(models.Model, PermissionModelMixin):
class RecipeBook(ExportModelOperationsMixin('book'), models.Model, PermissionModelMixin):
name = models.CharField(max_length=128)
description = models.TextField(blank=True)
icon = models.CharField(max_length=16, blank=True, null=True)
@@ -452,7 +456,7 @@ class RecipeBook(models.Model, PermissionModelMixin):
return self.name
class RecipeBookEntry(models.Model, PermissionModelMixin):
class RecipeBookEntry(ExportModelOperationsMixin('book_entry'), models.Model, PermissionModelMixin):
recipe = models.ForeignKey(Recipe, on_delete=models.CASCADE)
book = models.ForeignKey(RecipeBook, on_delete=models.CASCADE)
@@ -487,7 +491,7 @@ class MealType(models.Model, PermissionModelMixin):
return self.name
class MealPlan(models.Model, PermissionModelMixin):
class MealPlan(ExportModelOperationsMixin('meal_plan'), models.Model, PermissionModelMixin):
recipe = models.ForeignKey(Recipe, on_delete=models.CASCADE, blank=True, null=True)
servings = models.DecimalField(default=1, max_digits=8, decimal_places=4)
title = models.CharField(max_length=64, blank=True, default='')
@@ -512,7 +516,7 @@ class MealPlan(models.Model, PermissionModelMixin):
return f'{self.get_label()} - {self.date} - {self.meal_type.name}'
class ShoppingListRecipe(models.Model, PermissionModelMixin):
class ShoppingListRecipe(ExportModelOperationsMixin('shopping_list_recipe'), models.Model, PermissionModelMixin):
recipe = models.ForeignKey(Recipe, on_delete=models.CASCADE, null=True, blank=True)
servings = models.DecimalField(default=1, max_digits=8, decimal_places=4)
@@ -535,7 +539,7 @@ class ShoppingListRecipe(models.Model, PermissionModelMixin):
return None
class ShoppingListEntry(models.Model, PermissionModelMixin):
class ShoppingListEntry(ExportModelOperationsMixin('shopping_list_entry'), models.Model, PermissionModelMixin):
list_recipe = models.ForeignKey(ShoppingListRecipe, on_delete=models.CASCADE, null=True, blank=True)
food = models.ForeignKey(Food, on_delete=models.CASCADE)
unit = models.ForeignKey(Unit, on_delete=models.CASCADE, null=True, blank=True)
@@ -565,7 +569,7 @@ class ShoppingListEntry(models.Model, PermissionModelMixin):
return None
class ShoppingList(models.Model, PermissionModelMixin):
class ShoppingList(ExportModelOperationsMixin('shopping_list'), models.Model, PermissionModelMixin):
uuid = models.UUIDField(default=uuid.uuid4)
note = models.TextField(blank=True, null=True)
recipes = models.ManyToManyField(ShoppingListRecipe, blank=True)
@@ -583,9 +587,11 @@ class ShoppingList(models.Model, PermissionModelMixin):
return f'Shopping list {self.id}'
class ShareLink(models.Model, PermissionModelMixin):
class ShareLink(ExportModelOperationsMixin('share_link'), models.Model, PermissionModelMixin):
recipe = models.ForeignKey(Recipe, on_delete=models.CASCADE)
uuid = models.UUIDField(default=uuid.uuid4)
request_count = models.IntegerField(default=0)
abuse_blocked = models.BooleanField(default=False)
created_by = models.ForeignKey(User, on_delete=models.CASCADE)
created_at = models.DateTimeField(auto_now_add=True)
@@ -600,9 +606,9 @@ def default_valid_until():
return date.today() + timedelta(days=14)
class InviteLink(models.Model, PermissionModelMixin):
class InviteLink(ExportModelOperationsMixin('invite_link'), models.Model, PermissionModelMixin):
uuid = models.UUIDField(default=uuid.uuid4)
username = models.CharField(blank=True, max_length=64)
email = models.EmailField(blank=True)
group = models.ForeignKey(Group, on_delete=models.CASCADE)
valid_until = models.DateField(default=default_valid_until)
used_by = models.ForeignKey(
@@ -632,7 +638,7 @@ class TelegramBot(models.Model, PermissionModelMixin):
return f"{self.name}"
class CookLog(models.Model, PermissionModelMixin):
class CookLog(ExportModelOperationsMixin('cook_log'), models.Model, PermissionModelMixin):
recipe = models.ForeignKey(Recipe, on_delete=models.CASCADE)
created_by = models.ForeignKey(User, on_delete=models.CASCADE)
created_at = models.DateTimeField(default=timezone.now)
@@ -646,7 +652,7 @@ class CookLog(models.Model, PermissionModelMixin):
return self.recipe.name
class ViewLog(models.Model, PermissionModelMixin):
class ViewLog(ExportModelOperationsMixin('view_log'), models.Model, PermissionModelMixin):
recipe = models.ForeignKey(Recipe, on_delete=models.CASCADE)
created_by = models.ForeignKey(User, on_delete=models.CASCADE)
created_at = models.DateTimeField(auto_now_add=True)
@@ -663,6 +669,10 @@ class ImportLog(models.Model, PermissionModelMixin):
running = models.BooleanField(default=True)
msg = models.TextField(default="")
keyword = models.ForeignKey(Keyword, null=True, blank=True, on_delete=models.SET_NULL)
total_recipes = models.IntegerField(default=0)
imported_recipes = models.IntegerField(default=0)
created_at = models.DateTimeField(auto_now_add=True)
created_by = models.ForeignKey(User, on_delete=models.CASCADE)
@@ -671,3 +681,30 @@ class ImportLog(models.Model, PermissionModelMixin):
def __str__(self):
return f"{self.created_at}:{self.type}"
class BookmarkletImport(ExportModelOperationsMixin('bookmarklet_import'), models.Model, PermissionModelMixin):
html = models.TextField()
url = models.CharField(max_length=256, null=True, blank=True)
created_at = models.DateTimeField(auto_now_add=True)
created_by = models.ForeignKey(User, on_delete=models.CASCADE)
objects = ScopedManager(space='space')
space = models.ForeignKey(Space, on_delete=models.CASCADE)
class UserFile(ExportModelOperationsMixin('user_files'), models.Model, PermissionModelMixin):
name = models.CharField(max_length=128)
file = models.FileField(upload_to='files/')
file_size_kb = models.IntegerField(default=0, blank=True)
created_at = models.DateTimeField(auto_now_add=True)
created_by = models.ForeignKey(User, on_delete=models.CASCADE)
objects = ScopedManager(space='space')
space = models.ForeignKey(Space, on_delete=models.CASCADE)
def save(self, *args, **kwargs):
if hasattr(self.file, 'file') and isinstance(self.file.file, UploadedFile) or isinstance(self.file.file, InMemoryUploadedFile):
self.file.name = f'{uuid.uuid4()}' + pathlib.Path(self.file.name).suffix
self.file_size_kb = round(self.file.size / 1000)
super(UserFile, self).save(*args, **kwargs)

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