{% extends "base.html" %}
{% load i18n %}
{% load staticfiles %}
{% load manager_extras %}

{% block title %}{{ingredient.name}}{% endblock %}


{% block content %}

<div itemscope itemtype="http://schema.org/NutritionInformation">
<meta itemprop="name" content="{{ingredient.name}}" />

<p>{% trans "Nutritional values in 100g of product." %}</p>

<table>
    <thead>
        <tr>
            <th colspan="2">
                {% trans "Macronutrients" %}
            </th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td style="width:80%;">{% trans "Energy" %}</td>
            <td itemprop="calories">{{ingredient.energy}} kcal</td>
        </tr>
        <tr>
            <td>{% trans "Protein" %}</td>
            <td itemprop="proteinContent">{{ingredient.protein}} g</td>
        </tr>
        <tr>
            <td>{% trans "Carbohydrates" %}</td>
            <td itemprop="carbohydrateContent">{{ingredient.carbohydrates}} g</td>
        </tr>
        <tr>
            <td style="padding-left: 3em;">{% trans "Sugar content in carbohydrates" %}</td>
            <td itemprop="sugarContent">{{ingredient.carbohydrates_sugar}} g</td>
        </tr>
        <tr>
            <td>{% trans "Fat" %}</td>
            <td itemprop="fatContent">{{ingredient.fat}} g</td>
        </tr>
        <tr>
            <td style="padding-left: 3em;">{% trans "Saturated fat content in fats" %}</td>
            <td itemprop="saturatedFatContent">{{ingredient.fat_saturated}} g</td>
        </tr>
    </tbody>
</table>

<table>
    <thead>
        <tr>
            <th colspan="2">
                {% trans "Others" %}
            </th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td style="width:80%;">{% trans "Fibres" %}</td>
            <td itemprop="fiberContent">{% if ingredient.fibres %}{{ingredient.fibres}} g{% else %}-/-{% endif %}</td>
        </tr>
        <tr>
            <td>{% trans "Sodium" %}</td>
            <td itemprop="sodiumContent">{% if ingredient.sodium %}{{ingredient.sodium}} g{% else %}-/-{% endif %}</td>
        </tr>
    </tbody>
</table>
</div>
{% endblock %}



{% block sidebar %}
{% if perms.exercises %}
<h3>{% trans "Options" %}</h3>

<p>
<a href="{% url ingredient-delete ingredient.id %}"
   title="{% trans 'Delete ingredient' %}"
   class="modal-dialog">
   <img src="{% static 'images/icons/trash.svg' %}"
        width="32"
        height="32"
        alt="{% trans 'Delete ingredient' %}"
        title="{% trans 'Delete ingredient' %}">
    {% trans 'Delete ingredient' %}
</a>
</p>

<p>
<a href="{% url ingredient-edit ingredient.id %}"
   title="{% trans 'Edit ingredient' %}">
    <img src="{% static 'images/icons/edit.svg' %}"
         width="32"
         height="32"
         alt="{% trans 'Edit ingredient' %}"
         title="{% trans 'Edit ingredient' %}">
{% trans 'Edit ingredient' %}
</a>
</p>
{% endif %}

{% cc_by_sa_sidebar language %}

{% endblock %}
