diff --git a/cookbook/forms.py b/cookbook/forms.py
index e7d0e4e4d..04e089700 100644
--- a/cookbook/forms.py
+++ b/cookbook/forms.py
@@ -18,12 +18,13 @@ class ExternalRecipeForm(forms.ModelForm):
class Meta:
model = Recipe
- fields = ('name', 'keywords', 'time', 'file_path', 'storage', 'file_uid')
+ fields = ('name', 'keywords', 'working_time', 'waiting_time', 'file_path', 'storage', 'file_uid')
labels = {
'name': _('Name'),
'keywords': _('Keywords'),
- 'time': _('Preparation time in minutes'),
+ 'working_time': _('Preparation time in minutes'),
+ 'waiting_time': _('Waiting time (cooking/baking) in minutes'),
'file_path': _('Path'),
'file_uid': _('Storage UID'),
}
@@ -33,13 +34,14 @@ class ExternalRecipeForm(forms.ModelForm):
class InternalRecipeForm(forms.ModelForm):
class Meta:
model = Recipe
- fields = ('name', 'instructions', 'image', 'time', 'keywords')
+ fields = ('name', 'instructions', 'image', 'working_time', 'waiting_time', 'keywords')
labels = {
'name': _('Name'),
'keywords': _('Keywords'),
'instructions': _('Instructions'),
- 'time': _('Preparation time in minutes'),
+ 'working_time': _('Preparation time in minutes'),
+ 'waiting_time': _('Waiting time (cooking/baking) in minutes'),
}
widgets = {'keywords': MultiSelectWidget}
diff --git a/cookbook/migrations/0007_auto_20191226_0852.py b/cookbook/migrations/0007_auto_20191226_0852.py
new file mode 100644
index 000000000..6cb5d939a
--- /dev/null
+++ b/cookbook/migrations/0007_auto_20191226_0852.py
@@ -0,0 +1,23 @@
+# Generated by Django 3.0.1 on 2019-12-26 07:52
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('cookbook', '0006_recipe_image'),
+ ]
+
+ operations = [
+ migrations.RenameField(
+ model_name='recipe',
+ old_name='time',
+ new_name='working_time',
+ ),
+ migrations.AddField(
+ model_name='recipe',
+ name='waiting_time',
+ field=models.IntegerField(default=0),
+ ),
+ ]
diff --git a/cookbook/models.py b/cookbook/models.py
index 16618d902..756d79c8c 100644
--- a/cookbook/models.py
+++ b/cookbook/models.py
@@ -63,7 +63,8 @@ class Recipe(models.Model):
file_path = models.CharField(max_length=512, default="")
link = models.CharField(max_length=512, default="")
keywords = models.ManyToManyField(Keyword, blank=True)
- time = models.IntegerField(default=0)
+ working_time = models.IntegerField(default=0)
+ waiting_time = models.IntegerField(default=0)
internal = models.BooleanField(default=False)
created_by = models.ForeignKey(User, on_delete=models.PROTECT)
created_at = models.DateTimeField(auto_now_add=True)
diff --git a/cookbook/templates/recipe_view.html b/cookbook/templates/recipe_view.html
index 642c8c306..3ea26678c 100644
--- a/cookbook/templates/recipe_view.html
+++ b/cookbook/templates/recipe_view.html
@@ -28,24 +28,30 @@
{% endif %}
{% if recipe.internal %}
- {% trans 'by' %} {{ recipe.created_by.username }}
+ {% trans 'by' %} {{ recipe.created_by.username }}
+
{% endif %}
-
-
{% if recipe.all_tags %}
{{ recipe.all_tags }}
{% endif %}
- {% if recipe.time and recipe.time != 0 %}
- {% trans 'Preparation time ca.' %} {{ recipe.time }} min
+ {% if recipe.working_time and recipe.working_time != 0 %}
+ {% trans 'Preparation time ca.' %} {{ recipe.working_time }} min
+ {% endif %}
+
+ {% if recipe.waiting_time and recipe.waiting_time != 0 %}
+ {% trans 'Waiting time ca.' %} {{ recipe.waiting_time }} min
+ {% endif %}
+
+ {% if recipe.waiting_time and recipe.waiting_time != 0 or recipe.working_time and recipe.working_time != 0 %}
{% endif %}
-