{% extends "base.html" %} {% import "food/_head.html" as fd with context %} {% block title %}Food{% endblock %} {% block head %}{{ fd.assets() }}{% endblock %} {% block main_attrs %} data-norefresh{% endblock %} {# One day: the week strip (energy per day, click = that day), the meals with their foods (click one = edit, a meal's + = add to it), left: ring + bars + the add / describe box. food.js: the dialogs; after a save it swaps in .fd from a fresh copy of the page. #} {% set n, g = fd.n, fd.g %} {% macro amount(e) %}{% if e.amount is not none %}{{ g(e.amount) }}{% if e.unit %} {{ e.unit }}{% endif %}{% endif %}{% endmacro %} {% block page %} {{ fd.head(fd.day_label(v.day, v.today), v.day.strftime("%A ") ~ v.day.day ~ v.day.strftime(" %B %Y") ~ (" · planned" if v.future else " · food"), v.day == v.today, "/food", "/food?d=" ~ v.prev.isoformat(), ("/food?d=" ~ v.next.isoformat()) if v.next else None, v.next is not none) }}
{{ fd.side(v) }}
{% for col in [v.meals[:2], v.meals[2:]] %}
{% for m in col %}

{{ m.label }}

{% if m.rows %}{{ n(m.t.kcal) }} kcal{{ fd.mac(m.t.protein, m.t.carbs, m.t.fat) }}{% endif %} {% if m.key %}{% endif %}
{% if m.rows %}
    {% for e in m.rows %}
  • {% if m.key %}{% endif %}
  • {% endfor %}
{% elif m.key %} {% endif %}
{% endfor %}
{% endfor %}
{# the add box: yesterday's foods with a + (food.js) #}
{% endblock %} {% block scripts %}{{ fd.dialogs(v.day.isoformat()) }}{% endblock %}