Compare commits

...

35 Commits

Author SHA1 Message Date
vabene1111
738aa12243 Merge branch 'develop' 2025-01-05 11:38:52 +01:00
vabene1111
f25de4b4ce remove healthcheck 2025-01-05 11:38:35 +01:00
vabene1111
698aa5a753 Merge branch 'develop' 2025-01-01 09:24:51 +01:00
vabene1111
6444680e06 Merge pull request #3475 from TandoorRecipes/dependabot/pip/cryptography-44.0.0
Bump cryptography from 43.0.1 to 44.0.0
2025-01-01 08:16:19 +01:00
dependabot[bot]
c604369e86 Bump cryptography from 43.0.1 to 44.0.0
Bumps [cryptography](https://github.com/pyca/cryptography) from 43.0.1 to 44.0.0.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/43.0.1...44.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-01 00:33:49 +00:00
vabene1111
79abb8bf8f Merge branch 'develop' 2024-12-29 13:46:24 +01:00
vabene1111
fd4236672e update gitignore like vue3 branch 2024-12-29 13:46:17 +01:00
vabene1111
00148a2993 made shopping list compatible with SLR entries without a recipe 2024-12-29 13:44:43 +01:00
vabene1111
359fcb24cf fixed social signup form 2024-12-29 13:42:12 +01:00
vabene1111
f5d7919f72 Merge pull request #3448 from igorsantos07/patch-1
Update system.html: Django Recipes > Tandoor
2024-12-28 08:26:53 +01:00
vabene1111
86c4278553 Merge pull request #3454 from TandoorRecipes/dependabot/pip/jinja2-3.1.5
Bump jinja2 from 3.1.4 to 3.1.5
2024-12-28 08:26:44 +01:00
dependabot[bot]
2a5c0bb740 Bump jinja2 from 3.1.4 to 3.1.5
Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.4 to 3.1.5.
- [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.1.4...3.1.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-28 07:25:33 +00:00
Igor Santos
432dfa9e86 Update system.html: Django Recipes > Tandoor 2024-12-24 02:28:21 -03:00
vabene1111
f61a8371f4 Revert "added user filkes to recipe and added is_image flag to user file"
This reverts commit 0bcdf5e0a3.
2024-12-22 12:12:37 +01:00
vabene1111
0bcdf5e0a3 added user filkes to recipe and added is_image flag to user file 2024-12-22 12:05:47 +01:00
vabene1111
169f799a23 Merge pull request #3428 from hawthorc/develop
Add note about Python 3.12 dependency to manual.md
2024-12-11 15:19:59 +01:00
vabene1111
942d1130a1 Merge pull request #3416 from zodac/develop
Adding healthcheck to docker image
2024-12-11 15:17:28 +01:00
vabene1111
64cc20aed2 Merge pull request #3426 from TandoorRecipes/dependabot/pip/icalendar-6.1.0
Bump icalendar from 5.0.11 to 6.1.0
2024-12-11 15:12:09 +01:00
vabene1111
3a6731ec8d Merge pull request #3425 from TandoorRecipes/dependabot/pip/pytest-factoryboy-2.7.0
Bump pytest-factoryboy from 2.6.0 to 2.7.0
2024-12-11 15:11:32 +01:00
vabene1111
e6f11a17b9 Merge pull request #3423 from TandoorRecipes/dependabot/pip/pytest-django-4.9.0
Bump pytest-django from 4.8.0 to 4.9.0
2024-12-11 15:11:17 +01:00
vabene1111
cc1cd610e7 Merge pull request #3424 from TandoorRecipes/dependabot/pip/crispy-bootstrap4-2024.10
Bump crispy-bootstrap4 from 2024.1 to 2024.10
2024-12-11 15:10:19 +01:00
vabene1111
6a3b5ee844 Merge pull request #3431 from TandoorRecipes/dependabot/pip/django-4.2.17
Bump django from 4.2.16 to 4.2.17
2024-12-11 15:09:46 +01:00
Matjaž T
49b119571e Translated using Weblate (Slovenian)
Currently translated at 100.0% (570 of 570 strings)

Translation: Tandoor/Recipes Frontend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/sl/
2024-12-10 07:58:36 +00:00
Vincenzo Reale
e024e3deb0 Translated using Weblate (Italian)
Currently translated at 100.0% (488 of 488 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/it/
2024-12-09 00:58:36 +00:00
dependabot[bot]
7ccedb559d Bump django from 4.2.16 to 4.2.17
Bumps [django](https://github.com/django/django) from 4.2.16 to 4.2.17.
- [Commits](https://github.com/django/django/compare/4.2.16...4.2.17)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-06 18:57:23 +00:00
zodac
103daf000d Using --spider for healthcheck, which performs a HEAD request instead of a GET request 2024-12-02 20:44:12 +13:00
Vincenzo Reale
70df456307 Translated using Weblate (Italian)
Currently translated at 100.0% (488 of 488 strings)

Translation: Tandoor/Recipes Backend
Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/it/
2024-12-02 04:53:51 +00:00
Carter Hawthorne
375174ee41 Add note about Python 3.12 dependency to manual.md 2024-12-01 18:38:38 -08:00
dependabot[bot]
f19beba014 Bump icalendar from 5.0.11 to 6.1.0
Bumps [icalendar](https://github.com/collective/icalendar) from 5.0.11 to 6.1.0.
- [Release notes](https://github.com/collective/icalendar/releases)
- [Changelog](https://github.com/collective/icalendar/blob/main/CHANGES.rst)
- [Commits](https://github.com/collective/icalendar/compare/v5.0.11...v6.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-01 00:39:31 +00:00
dependabot[bot]
865756e4b2 Bump pytest-factoryboy from 2.6.0 to 2.7.0
Bumps [pytest-factoryboy](https://github.com/pytest-dev/pytest-factoryboy) from 2.6.0 to 2.7.0.
- [Changelog](https://github.com/pytest-dev/pytest-factoryboy/blob/master/CHANGES.rst)
- [Commits](https://github.com/pytest-dev/pytest-factoryboy/compare/2.6.0...2.7.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-01 00:39:28 +00:00
dependabot[bot]
41f834db08 Bump crispy-bootstrap4 from 2024.1 to 2024.10
Bumps [crispy-bootstrap4](https://github.com/django-crispy-forms/crispy-bootstrap4) from 2024.1 to 2024.10.
- [Release notes](https://github.com/django-crispy-forms/crispy-bootstrap4/releases)
- [Changelog](https://github.com/django-crispy-forms/crispy-bootstrap4/blob/main/CHANGELOG.md)
- [Commits](https://github.com/django-crispy-forms/crispy-bootstrap4/compare/2024.1...2024.10)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-01 00:39:26 +00:00
dependabot[bot]
2c94753a5a Bump pytest-django from 4.8.0 to 4.9.0
Bumps [pytest-django](https://github.com/pytest-dev/pytest-django) from 4.8.0 to 4.9.0.
- [Release notes](https://github.com/pytest-dev/pytest-django/releases)
- [Changelog](https://github.com/pytest-dev/pytest-django/blob/main/docs/changelog.rst)
- [Commits](https://github.com/pytest-dev/pytest-django/compare/v4.8.0...v4.9.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-01 00:39:23 +00:00
zodac
0e05c77fa7 Adding healthcheck to docker image 2024-11-29 14:15:24 +13:00
vabene1111
793c152b26 Merge pull request #3412 from lavanyamehn/duplicate_urls
Display a warning message when duplicate recipe is imported
2024-11-27 15:50:54 +01:00
Lavanya Mehndiratta
9df75f551c Changed functionality to only display a warning message 2024-11-26 18:09:55 -05:00
14 changed files with 101 additions and 49 deletions

2
.gitignore vendored
View File

@@ -84,3 +84,5 @@ vue3/.vite
# Configs
vetur.config.js
venv/
.idea/easy-i18n.xml
cookbook/static/vue3

View File

@@ -35,6 +35,13 @@ RUN apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev zlib-de
#Copy project and execute it.
COPY . ./
# commented for now https://github.com/TandoorRecipes/recipes/issues/3478
#HEALTHCHECK --interval=30s \
# --timeout=5s \
# --start-period=10s \
# --retries=3 \
# CMD [ "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:8080/openapi" ]
# collect information from git repositories
RUN /opt/recipes/venv/bin/python version.py
# delete git repositories to reduce image size

View File

@@ -1,6 +1,8 @@
from datetime import datetime
from allauth.account.forms import ResetPasswordForm, SignupForm
from allauth.socialaccount.forms import SignupForm as SocialSignupForm
from django import forms
from django.conf import settings
from django.core.exceptions import ValidationError
@@ -14,15 +16,13 @@ from .models import Comment, InviteLink, Keyword, Recipe, SearchPreference, Spac
class SelectWidget(widgets.Select):
class Media:
js = ('custom/js/form_select.js', )
js = ('custom/js/form_select.js',)
class MultiSelectWidget(widgets.SelectMultiple):
class Media:
js = ('custom/js/form_multiselect.js', )
js = ('custom/js/form_multiselect.js',)
# Yes there are some stupid browsers that still dont support this but
@@ -139,7 +139,7 @@ class CommentForm(forms.ModelForm):
class Meta:
model = Comment
fields = ('text', )
fields = ('text',)
labels = {'text': _('Add your comment: '), }
widgets = {'text': forms.Textarea(attrs={'rows': 2, 'cols': 15}), }
@@ -161,7 +161,6 @@ class StorageForm(forms.ModelForm):
help_texts = {'url': _('Leave empty for dropbox and enter only base url for nextcloud (<code>/remote.php/webdav/</code> is added automatically)'), }
class ConnectorConfigForm(forms.ModelForm):
enabled = forms.BooleanField(
help_text="Is the connector enabled",
@@ -315,6 +314,18 @@ class AllAuthSignupForm(SignupForm):
pass
class AllAuthSocialSignupForm(SocialSignupForm):
terms = forms.BooleanField(label=_('Accept Terms and Privacy'))
def __init__(self, **kwargs):
super().__init__(**kwargs)
if settings.PRIVACY_URL == '' and settings.TERMS_URL == '':
self.fields.pop('terms')
def signup(self, request, user):
pass
class CustomPasswordResetForm(ResetPasswordForm):
captcha = hCaptchaField()
@@ -345,12 +356,13 @@ class SearchPreferenceForm(forms.ModelForm):
help_texts = {
'search': _('Select type method of search. Click <a href="/docs/search/">here</a> for full description of choices.'), 'lookup':
_('Use fuzzy matching on units, keywords and ingredients when editing and importing recipes.'), 'unaccent':
_('Fields to search ignoring accents. Selecting this option can improve or degrade search quality depending on language'), 'icontains':
_("Fields to search for partial matches. (e.g. searching for 'Pie' will return 'pie' and 'piece' and 'soapie')"), 'istartswith':
_("Fields to search for beginning of word matches. (e.g. searching for 'sa' will return 'salad' and 'sandwich')"), 'trigram':
_("Fields to 'fuzzy' search. (e.g. searching for 'recpie' will find 'recipe'.) Note: this option will conflict with 'web' and 'raw' methods of search."), 'fulltext':
_("Fields to full text search. Note: 'web', 'phrase', and 'raw' search methods only function with fulltext fields."),
_('Use fuzzy matching on units, keywords and ingredients when editing and importing recipes.'), 'unaccent':
_('Fields to search ignoring accents. Selecting this option can improve or degrade search quality depending on language'), 'icontains':
_("Fields to search for partial matches. (e.g. searching for 'Pie' will return 'pie' and 'piece' and 'soapie')"), 'istartswith':
_("Fields to search for beginning of word matches. (e.g. searching for 'sa' will return 'salad' and 'sandwich')"), 'trigram':
_("Fields to 'fuzzy' search. (e.g. searching for 'recpie' will find 'recipe'.) Note: this option will conflict with 'web' and 'raw' methods of search."),
'fulltext':
_("Fields to full text search. Note: 'web', 'phrase', and 'raw' search methods only function with fulltext fields."),
}
labels = {
@@ -360,5 +372,5 @@ class SearchPreferenceForm(forms.ModelForm):
widgets = {
'search': SelectWidget, 'unaccent': MultiSelectWidget, 'icontains': MultiSelectWidget, 'istartswith': MultiSelectWidget, 'trigram': MultiSelectWidget, 'fulltext':
MultiSelectWidget,
MultiSelectWidget,
}

View File

@@ -12,7 +12,7 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-08-01 15:04+0200\n"
"PO-Revision-Date: 2024-11-01 06:58+0000\n"
"PO-Revision-Date: 2024-12-09 00:58+0000\n"
"Last-Translator: Vincenzo Reale <smart2128vr@gmail.com>\n"
"Language-Team: Italian <http://translate.tandoor.dev/projects/tandoor/"
"recipes-backend/it/>\n"
@@ -21,7 +21,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.6.2\n"
"X-Generator: Weblate 5.8.4\n"
#: .\cookbook\forms.py:45
msgid ""
@@ -520,7 +520,7 @@ msgstr "Web"
#: .\cookbook\models.py:1411 .\cookbook\templates\search_info.html:47
msgid "Raw"
msgstr "Raw"
msgstr "Crudo"
#: .\cookbook\models.py:1467
msgid "Food Alias"
@@ -1440,8 +1440,9 @@ msgid ""
"\"noreferrer noopener\" target=\"_blank\">this one.</a>"
msgstr ""
"Le tabelle in markdown sono difficili da creare a mano. Si raccomanda "
"l'utilizzo di un editor di come <a href=\"https://www.tablesgenerator.com/"
"markdown_tables\" rel=\"noreferrer noopener\" target=\"_blank\">questo.</a>"
"l'utilizzo di un editor di tabelle come <a href=\"https://www.tablesgenerator"
".com/markdown_tables\" rel=\"noreferrer noopener\" target=\"_blank\""
">questo.</a>"
#: .\cookbook\templates\markdown_info.html:155
#: .\cookbook\templates\markdown_info.html:157
@@ -2203,8 +2204,8 @@ msgstr ""
" Le migrazioni non andate a buon fine probabilmente causeranno il "
"malfunzionamento di parti importanti dell'applicazione.\n"
" Se una migrazione non riesce, assicurati di avere la versione "
"più recente e, in tal caso, pubblica il registro della migrazione e la "
"panoramica di seguito in una segnalazione di problema su GitHub.\n"
"più recente e, in tal caso, pubblica il registro della migrazione e il "
"riepilogo che segue in una segnalazione di problema su GitHub.\n"
" "
#: .\cookbook\templates\system.html:182
@@ -2765,7 +2766,7 @@ msgid ""
"but not recommended as some features only work with postgres databases."
msgstr ""
"Questa applicazione non è in esecuzione con un database Postgres. Va bene, "
"ma non è consigliato perché alcune funzionalità sono disponibili solo con un "
"ma non è consigliato perché alcune funzionalità sono disponibili solo con "
"database Postgres."
#: .\cookbook\views\views.py:360

View File

@@ -1,6 +1,5 @@
{% extends "base.html" %}
{% load crispy_forms_filters %}
{% load crispy_forms_filters %}
{% load i18n %}
{% block title %}{% trans 'Register' %}{% endblock %}

View File

@@ -16,7 +16,6 @@
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}"/>
{% endif %}
<div class="form-group">
{{ form.username |as_crispy_field }}
</div>
@@ -30,7 +29,7 @@
<div class="form-group">
{{ form.terms |as_crispy_field }}
<small>
{% trans 'I accept the follwoing' %}
{% trans 'I accept the following' %}
{% if TERMS_URL != '' %}
<a href="{{ TERMS_URL }}" target="_blank"
rel="noreferrer nofollow">{% trans 'Terms and Conditions' %}</a>

View File

@@ -12,9 +12,9 @@
<h1>{% trans 'System' %}</h1>
{% blocktrans %}
Django Recipes is an open source free software application. It can be found on
<a href="https://github.com/vabene1111/recipes">GitHub</a>.
Changelogs can be found <a href="https://github.com/vabene1111/recipes/releases">here</a>.
Tandoor Recipes is an open source free software application. It can be found on
<a href="https://github.com/TandoorRecipes/recipes">GitHub</a>.
Changelogs can be found <a href="https://github.com/TandoorRecipes/recipes/releases">here</a>.
{% endblocktrans %}
<h3 class="mt-5">{% trans 'System Information' %}</h3>

View File

@@ -1455,13 +1455,21 @@ class RecipeUrlImportView(APIView):
url = serializer.validated_data.get('url', None)
data = unquote(serializer.validated_data.get('data', None))
duplicate = False
if url:
# Check for existing recipes with provided url
existing_recipe = Recipe.objects.filter(source_url=url).first()
if existing_recipe:
duplicate = True
if not url and not data:
return Response({'error': True, 'msg': _('Nothing to do.')}, status=status.HTTP_400_BAD_REQUEST)
elif url and not data:
if re.match('^(https?://)?(www\\.youtube\\.com|youtu\\.be)/.+$', url):
if validate_import_url(url):
return Response({'recipe_json': get_from_youtube_scraper(url, request), 'recipe_images': [], }, status=status.HTTP_200_OK)
return Response({'recipe_json': get_from_youtube_scraper(url, request), 'recipe_images': [], 'duplicate': duplicate}, status=status.HTTP_200_OK)
if re.match('^(.)*/view/recipe/[0-9]+/[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$', url):
recipe_json = requests.get(
url.replace('/view/recipe/', '/api/recipe/').replace(re.split('/view/recipe/[0-9]+', url)[1], '') + '?share='
@@ -1476,7 +1484,7 @@ class RecipeUrlImportView(APIView):
filetype=pathlib.Path(recipe_json['image']).suffix),
name=f'{uuid.uuid4()}_{recipe.pk}{pathlib.Path(recipe_json["image"]).suffix}')
recipe.save()
return Response({'link': request.build_absolute_uri(reverse('view_recipe', args={recipe.pk}))}, status=status.HTTP_201_CREATED)
return Response({'link': request.build_absolute_uri(reverse('view_recipe', args={recipe.pk})), 'duplicate': duplicate}, status=status.HTTP_201_CREATED)
else:
try:
if validate_import_url(url):
@@ -1511,6 +1519,7 @@ class RecipeUrlImportView(APIView):
return Response({
'recipe_json': helper.get_from_scraper(scrape, request),
'recipe_images': list(dict.fromkeys(get_images_from_soup(scrape.soup, url))),
'duplicate': duplicate
},
status=status.HTTP_200_OK)

View File

@@ -3,7 +3,7 @@
These instructions are inspired from a standard django/gunicorn/postgresql instructions ([for example](https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04))
!!! warning
Make sure to use Python 3.10 or higher, and ensure that `pip` is associated with Python 3. Depending on your system configuration, using `python` or `pip` might default to Python 2. Make sure your machine has at least 2048 MB of memory; otherwise, the `yarn build` process may fail with the error: `FATAL ERROR: Reached heap limit - Allocation failed: JavaScript heap out of memory`.
Make sure to use at least Python 3.10 (although 3.12 is preferred) or higher, and ensure that `pip` is associated with Python 3. Depending on your system configuration, using `python` or `pip` might default to Python 2. Make sure your machine has at least 2048 MB of memory; otherwise, the `yarn build` process may fail with the error: `FATAL ERROR: Reached heap limit - Allocation failed: JavaScript heap out of memory`.
## Prerequisites

View File

@@ -66,7 +66,6 @@ LOGGING = {
},
}
# allow djangos wsgi server to server mediafiles
GUNICORN_MEDIA = bool(int(os.getenv('GUNICORN_MEDIA', False)))
@@ -247,14 +246,14 @@ MIDDLEWARE = [
]
if DEBUG_TOOLBAR:
MIDDLEWARE += ('debug_toolbar.middleware.DebugToolbarMiddleware', )
INSTALLED_APPS += ('debug_toolbar', )
MIDDLEWARE += ('debug_toolbar.middleware.DebugToolbarMiddleware',)
INSTALLED_APPS += ('debug_toolbar',)
SORT_TREE_BY_NAME = bool(int(os.getenv('SORT_TREE_BY_NAME', False)))
DISABLE_TREE_FIX_STARTUP = bool(int(os.getenv('DISABLE_TREE_FIX_STARTUP', False)))
if bool(int(os.getenv('SQL_DEBUG', False))):
MIDDLEWARE += ('recipes.middleware.SqlPrintingMiddleware', )
MIDDLEWARE += ('recipes.middleware.SqlPrintingMiddleware',)
if ENABLE_METRICS:
MIDDLEWARE += 'django_prometheus.middleware.PrometheusAfterMiddleware',
@@ -294,7 +293,6 @@ if LDAP_AUTH:
"handlers": ["console"]
}
AUTHENTICATION_BACKENDS += [
'django.contrib.auth.backends.ModelBackend',
'allauth.account.auth_backends.AuthenticationBackend',
@@ -564,6 +562,9 @@ ACCOUNT_EMAIL_SUBJECT_PREFIX = os.getenv('ACCOUNT_EMAIL_SUBJECT_PREFIX', '[Tando
# ACCOUNT_SIGNUP_FORM_CLASS = 'cookbook.forms.AllAuthSignupForm'
ACCOUNT_FORMS = {'signup': 'cookbook.forms.AllAuthSignupForm', 'reset_password': 'cookbook.forms.CustomPasswordResetForm'}
SOCIALACCOUNT_FORMS = {
'signup': 'cookbook.forms.AllAuthSocialSignupForm',
}
ACCOUNT_EMAIL_UNKNOWN_ACCOUNTS = False
ACCOUNT_RATE_LIMITS = {

View File

@@ -1,9 +1,9 @@
Django==4.2.16
cryptography===43.0.1
Django==4.2.17
cryptography===44.0.0
django-annoying==0.10.6
django-cleanup==8.0.0
django-crispy-forms==2.3
crispy-bootstrap4==2024.1
crispy-bootstrap4==2024.10
django-tables2==2.7.0
djangorestframework==3.15.2
drf-writable-nested==0.7.0
@@ -20,13 +20,13 @@ requests==2.32.3
six==1.16.0
webdavclient3==3.14.6
whitenoise==6.7.0
icalendar==5.0.11
icalendar==6.1.0
pyyaml==6.0.2
uritemplate==4.1.1
beautifulsoup4==4.12.3
microdata==0.8.0
mock==5.1.0
Jinja2==3.1.4
Jinja2==3.1.5
django-webpack-loader==3.0.1
git+https://github.com/BITSOLVER/django-js-reverse@071e304fd600107bc64bbde6f2491f1fe049ec82
django-allauth==0.61.1
@@ -48,9 +48,9 @@ redis==5.2.0
# Development
pytest==8.0.0
pytest-django==4.8.0
pytest-django==4.9.0
pytest-cov===5.0.0
pytest-factoryboy==2.6.0
pytest-factoryboy==2.7.0
pytest-html==4.1.1
pytest-asyncio==0.23.5
pytest-xdist==3.6.1

View File

@@ -83,6 +83,11 @@
<loading-spinner></loading-spinner>
</b-card>
<!-- Warnings -->
<b-card no-body v-if="duplicateWarning" class="warning">
{{ duplicateWarning }}
</b-card>
<!-- OPTIONS -->
<b-card no-body v-if="recipe_json !== undefined">
<b-card-header header-tag="header" class="p-1" role="tab">
@@ -463,6 +468,7 @@ export default {
},
// URL import
LS_IMPORT_RECENT: 'import_recent_urls', //TODO use central helper to manage all local storage keys (and maybe even access)
duplicateWarning: '',
website_url: '',
website_url_list: '',
import_multiple: false,
@@ -643,6 +649,12 @@ export default {
return
}
if ('duplicate' in response.data && response.data['duplicate']) {
this.duplicateWarning = "A recipe with this URL already exists.";
} else {
this.duplicateWarning = "";
}
this.loading = false
this.recipe_json = response.data['recipe_json'];
@@ -763,6 +775,16 @@ export default {
<style>
.warning {
color: rgb(255, 149, 0);
align-items: center;
background-color: #fff4ec;
padding: 10px;
border: 1px solid rgb(255, 149, 0);
border-radius: 5px;
margin: 10px 0;
}
.bounce {
animation: bounce 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
transform: translate3d(0, 0, 0);

View File

@@ -238,7 +238,7 @@ export default {
if (e.recipe_mealplan !== null) {
let recipe_name = e.recipe_mealplan.recipe_name
if (recipes.indexOf(recipe_name) === -1) {
if (recipes.indexOf(recipe_name) === -1 && recipe_name !== undefined) {
recipes.push(recipe_name.substring(0, 14) + (recipe_name.length > 14 ? '..' : ''))
}

View File

@@ -203,7 +203,7 @@
"Next_Day": "Naslednji Dan",
"Previous_Day": "Prejšnji Dan",
"Coming_Soon": "Kmalu",
"Auto_Planner": "Avto-planer",
"Auto_Planner": "Samodejni planer",
"New_Cookbook": "Nova kuharska knjiga",
"Hide_Keyword": "Skrij ključne besede",
"Clear": "Počisti",
@@ -215,7 +215,7 @@
"RemoveFoodFromShopping": "Odstrani {food} iz nakupovalnega listka",
"SupermarketCategoriesOnly": "Prikaži samo trgovinske kategorije",
"DelayFor": "Zamakni za {hours} ur",
"OfflineAlert": "Si v offline načinu, nakupovalni listek se mogoče ne bo sinhroniziral.",
"OfflineAlert": "Si v načinu brez povezave, nakupovalni listek se mogoče ne bo sinhroniziral.",
"shopping_share_desc": "Uporabniki bodo videli vse elemente, ki si jih dodal v nakupovalni listek. Morajo te dodati, da vidiš njihove elemente na listku.",
"shopping_auto_sync_desc": "Nastavitev na 0 bo onemogoča avtomatsko sinhronizacijo. Pri ogledu nakupovalnega seznama se seznam posodablja vsakih nekaj sekund za sinhronizacijo sprememb, ki jih je morda naredil nekdo drug. Uporabno pri nakupovanju z več ljudmi, vendar bo uporabljalo mobilne podatke.",
"filter_to_supermarket_desc": "Privzeto, razvrsti nakupovalni listek, da vključi samo označene trgovine.",
@@ -225,7 +225,7 @@
"success_moving_resource": "Premikanje vira je bilo uspešno!",
"success_merging_resource": "Združevanje vira je bilo uspešno!",
"Added_by": "Dodano s strani",
"AddToShopping": "Dodaj nakupovlanemu listku",
"AddToShopping": "Dodaj nakupovalnemu listku",
"NotInShopping": "{food} ni v tvojem nakupovalnem listku.",
"OnHand": "Trenutno imam v roki",
"FoodOnHand": "Imaš {food} v roki.",
@@ -247,8 +247,8 @@
"ShowDelayed": "Pokaži odložene elemente",
"Completed": "Končano",
"shopping_share": "Deli nakupovalni listek",
"shopping_auto_sync": "Avtomatska sinhronizacija",
"mealplan_autoadd_shopping": "Avtomatsko dodaj obrok v načrt",
"shopping_auto_sync": "Samodejna sinhronizacija",
"mealplan_autoadd_shopping": "Samodejno dodaj obrok v načrt",
"mealplan_autoexclude_onhand": "Izključi hrano v roki",
"mealplan_autoinclude_related": "Dodaj povezane recepte",
"default_delay": "Privzete ure za zamik",
@@ -275,7 +275,7 @@
"copy_markdown_table": "Kopiraj kot Markdown tabela",
"in_shopping": "V nakupovalnem listku",
"DelayUntil": "Zamakni do",
"shopping_add_onhand": "Avtomatsko v roki",
"shopping_add_onhand": "Samodejno v roki",
"related_recipes": "Povezani recepti",
"today_recipes": "Današnji recepti",
"mark_complete": "Označi končano",