{% extends 'diet_optimizer_website/layout2.html' %} {% block content %} Results

Food Items:

{% if not raw_foods %}

We are sorry, no food were found to match your requirements.

Try to change your research criterias. You might have more results.
{% else %} {% for key in raw_foods %}

Nutrients (for 100g):

Calories: {{ key.Cal }} kcal
Carbs: {{ key.Carb }} gr
Fat: {{ key.Fat }} gr
Protein: {{ key.Prot }} gr

{% endfor %} {% endif %}

Recipes:

{% if not recipes %}

We are sorry, no recipes were found to match your requirements.

Try to change your research criterias. You might have more results.
{% else %} {% for key in recipes %}

Ready in {{key.readyInMinutes}} minutes
Price per serving: ${% widthratio key.pricePerServing 100 1 %}


Nutrients:

{% for ob in key.nutrition.nutrients %} {% if ob.title == 'Calories'%} Calories: {{ ob.amount }} kcal
{% endif %} {% if ob.title == 'Carbohydrates'%} Carbs: {{ ob.amount }} gr
{% endif %} {% if ob.title == 'Fat'%} Fat: {{ ob.amount }} gr
{% endif %} {% if ob.title == 'Protein'%} Protein {{ ob.amount }} gr
{% endif %} {% endfor %}

Properties:

{% if key.vegetarian != false %} Vegetarian
{% endif %} {% if key.vegan != false %} Vegan
{% endif %} {% if key.glutenFree != false %} Gluten Free
{% endif %} {% if key.veryHealthy != false %} Healthy
{% endif %} {% if key.ketogenic != false %} Ketogenic
{% endif %} {% if key.dairyFree != false %} Dairy Free
{% endif %}

Source:

Spoonacular: {{key.spoonacularSourceUrl}}

{% endfor %}

Total nutrients taken, Price & Time:

Calories: {{total_nutrients_taken.calories}} kcal
Carb: {{total_nutrients_taken.carb}} gr
Fat: {{total_nutrients_taken.fat}} gr
Protein: {{total_nutrients_taken.protein}} gr
Price: $ {{total_nutrients_taken.price}}
Time: {{total_nutrients_taken.time}} minutes

{% endif %}
{% if recipes %} {%endif%}
{% endblock %}