From c3f62dd469084debad60af6be93fad4daee5646d Mon Sep 17 00:00:00 2001 From: Kaibu Date: Thu, 14 Nov 2019 00:34:35 +0100 Subject: [PATCH] import all button, migration --- .../0005_recipeingredients_amount.py | 18 ++++++++++++++++++ cookbook/templates/generic/list_template.html | 4 ++++ cookbook/views/lists.py | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 cookbook/migrations/0005_recipeingredients_amount.py diff --git a/cookbook/migrations/0005_recipeingredients_amount.py b/cookbook/migrations/0005_recipeingredients_amount.py new file mode 100644 index 00000000..d8e104dd --- /dev/null +++ b/cookbook/migrations/0005_recipeingredients_amount.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.7 on 2019-11-13 23:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cookbook', '0004_auto_20191113_2238'), + ] + + operations = [ + migrations.AddField( + model_name='recipeingredients', + name='amount', + field=models.DecimalField(decimal_places=2, default=0, max_digits=16), + ), + ] diff --git a/cookbook/templates/generic/list_template.html b/cookbook/templates/generic/list_template.html index 59c257a7..4904f760 100644 --- a/cookbook/templates/generic/list_template.html +++ b/cookbook/templates/generic/list_template.html @@ -15,6 +15,10 @@ {% endif %} {% render_table table %} + + {% if import_btn %} + {% trans 'Import all' %} + {% endif %} {% endblock content %} \ No newline at end of file diff --git a/cookbook/views/lists.py b/cookbook/views/lists.py index 9ae0031c..c649dc2c 100644 --- a/cookbook/views/lists.py +++ b/cookbook/views/lists.py @@ -31,7 +31,7 @@ def recipe_import(request): RequestConfig(request, paginate={'per_page': 25}).configure(table) - return render(request, 'generic/list_template.html', {'title': _("Import"), 'table': table}) + return render(request, 'generic/list_template.html', {'title': _("Import"), 'table': table, 'import_btn': True}) @login_required