{# The Today queue (hermitcrm/today.py): one prioritised list of what to do now. Included by home.html (section "next") and by today_page.html (/today). Expects `queue`, `today_limit` (None shows every row), `today_back` (where a row's form comes back to) and `today_all_url`. Every action is an existing POST route or a link; the forms carry data-live so a script can upgrade them, and work as plain posts without it. #} {% set groups = queue.groups(limit=today_limit) %}

What to do now{% if queue.total %} ({{ queue.total }}){% endif %}

{% if queue.failed %}

Part of this list could not be read ({{ queue.failed | join(', ') }}); the rest is below. hermitcrm check says more.

{% endif %} {% if not queue.items %}

Nothing is waiting. {% if queue.next_up %}Next up: {{ queue.next_up.title }} for {{ queue.next_up.who }}, due {{ fmt_date(queue.next_up.due) }}. {% else %}Nothing else is dated either. Add a task or look at the pipeline.{% endif %}

{% else %} {% for g in groups %}

{{ g.heading }} {{ g.count }}

    {% for i in g.items %}
  1. {% if i.company %}{{ i.who }}{% if i.contact %} {{ i.company.name }}{% endif %}{% else %}{{ i.title }}{% endif %}{% if i.count > 1 %} ×{{ i.count }}{% endif %} {% if i.company %}{{ i.title }}{% endif %} {{ i.reason }} {% for a in i.actions %}{% if a.method == 'post' %}
    {% for k, v in a.fields %}{% endfor %}
    {% else %} {{ a.label }} {% endif %}{% endfor %}
  2. {% endfor %}
{% endfor %} {% if today_limit and queue.more(today_limit) %}

Show all {{ queue.items | length }} rows {{ queue.more(today_limit) }} more not shown here

{% endif %} {% endif %}