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

{% block title %}{% trans "Your nutrition plans" %}{% endblock %}


{% block content %}
{% if plans %}
<table class="table">
    <thead>
    <tr>
        <th>{% trans "Description" %}</th>
        <th>{% trans "Date" %}</th>
        <th>{% trans "Energy" %}</th>
    </tr>
    </thead>
    <tbody>
    {% for plan in plans %}
    <tr>
        <td>
            <a href="{{ plan.get_absolute_url }}">{{ plan }}</a>
        </td>
        <td>
            {{ plan.creation_date }}
        </td>
        <td>
            {{ plan.get_nutritional_values.total.energy|floatformat }} {% trans "kcal" %}
        </td>
    </tr>
    {% endfor %}
    </tbody>
    </table>
{% else %}
    <p>
        <a href="{% url 'nutrition:plan:add' %}" class="btn btn-default btn-block">
        {% trans "No nutrition plans." %} {% trans "Add one now." %}
        </a>
    </p>
{% endif %}

{% endblock %}



{% block sidebar%}
<h4>{% trans "Options" %}</h4>
<p>
    <a href="{% url 'nutrition:plan:add' %}" id="nutrition-create-new">
    <img src="{% static 'images/icons/new.svg' %}"
         width="32"
         height="32"
         alt="{% trans 'Add nutrition plan' %}"
         title="{% trans 'Add nutrition plan' %}">
        {% trans "Add nutrition plan" %}</a>
</p>

<p>
    <a href="{% url 'nutrition:ingredient:list' %}" id="ingredient-overview">
    <img src="{% static 'images/icons/list.svg' %}"
         width="32"
         height="32"
         alt="{% trans 'Ingredient overview' %}"
         title="{% trans 'Ingredient overview' %}">
    {% trans "Ingredient overview" %}
    </a>
</p>
{% endblock %}
