{% extends shell('app') %} {% block title %}{{ _('Usage') }}{% endblock %} {% block content %}

{{ _('Usage') }}

{% for d in periods %} {{ _('%(n)s days', n=d) }} {% endfor %}
{% macro head(key, label, num=False, first=False) -%} {%- endmacro %}

{{ _('People') }}

{% if u.people %}
{{ head('who', _('Person')) }}{{ head('sessions', _('Sessions'), True) }}{{ head('hours', _('Hours'), True, True) }}{{ head('unused', _('Unused'), True) }}{{ head('last', _('Last'), True) }} {% for p in u.people %} {% endfor %}
{{ p.who }}{{ p.sessions }}{{ hours(p.hours) }} {% if p.unused %}{{ p.unused }}{% else %}0{% endif %} {{ pretty_day(p.last) }}
{% else %}

{{ _('None.') }}

{% endif %}

{{ _('Models') }}

{% if u.models %}
{{ head('what', _('Model')) }}{{ head('sessions', _('Sessions'), True) }}{{ head('hours', _('Hours'), True, True) }}{{ head('people', _('People'), True) }} {% for m in u.models %} {% endfor %}
{{ m.what }}{{ m.sessions }}{{ hours(m.hours) }}{{ m.people }}
{% else %}

{{ _('None.') }}

{% endif %}

{{ _('Busy, per week') }}

{{ head('week', _('Week of'), True, True) }} {% for name in u.nodes %}{{ head('n' ~ loop.index, name, True) }}{% endfor %} {% for w in u.weeks %} {% for b in w.busy %}{% endfor %} {% endfor %}
{{ week_label(w.monday) }}
{{ hours(b) }} %

{{ _('Booked and not used') }}

{% if u.unused %}
{{ head('at', _('When'), True, True) }}{{ head('who', _('Person')) }}{{ head('what', _('Model')) }}{{ head('hours', _('Hours'), True) }} {% for x in u.unused %} {% endfor %}
{{ pretty_range(x.booking.start, x.booking.end) }}
#{{ x.booking.id }} · {{ nodes_label(x.booking.node_list) }}
{{ x.who }}{{ x.what }}{{ hours(x.hours) }}
{% else %}

{{ _('None.') }}

{% endif %}
{% endblock %}