-
- {% if s.type == 'TEXT' %}
-
- {% elif s.type == 'TIME' %}
-
- {% endif %}
- {% if s.name %}{{ s.name }}{% else %}{% trans 'Step' %}
- {{ forloop.counter }}{% endif %}
- {% if s.type == 'TIME' %}
- - {{ s.time }} {% trans 'Minutes' %}
- {% endif %}
-
+
+
+ {% if recipe.steps.all|length > 1 %}
+
+
+
+
+ {% if s.type == 'TEXT' %}
+
+ {% elif s.type == 'TIME' %}
+
+ {% endif %}
+ {% if s.name %}{{ s.name }}{% else %}{% trans 'Step' %}
+ {{ forloop.counter }}{% endif %}
+ {% if s.type == 'TIME' %}
+ - {{ s.time }} {% trans 'Minutes' %}
+ {% endif %}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+ [[i.note]]
+ |
+
+
+ |
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+ [[i.food.name]]
+
+
+ [[i.food.name]]
+
+ |
+
+
+
+
+
+
+ [[i.note]]
+
+
+ |
+
+
+
+
+
+
+ |
+ |
+ |
+
+
+
+
+
+ {% endif %}
+
+
+
+ {% if s.instruction %}
+ {{ s.instruction | markdown | safe }}
+ {% endif %}
+
- {% endif %}
-
-
-
- {% if s.instruction %}
- {{ s.instruction | markdown | safe }}
- {% endif %}
-
-
{% endfor %}
@@ -380,6 +463,7 @@
el: '#id_base_container',
data: {
recipe: undefined,
+ has_ingredients: false,
ingredient_factor: 1,
},
@@ -391,6 +475,14 @@
this.$http.get("{% url 'api:recipe-detail' recipe.pk %}").then((response) => {
this.recipe = response.data;
this.loading = false
+
+ for (let step of this.recipe.steps) {
+ if (step.ingredients.length > 0) {
+ this.has_ingredients = true
+ return
+ }
+ }
+
}).catch((err) => {
this.error = err.data
this.loading = false