{% import "macros.html" as m %}
{% if not view.ok %}
  {{ m.absence(view) }}
{% elif view['items'] %}
  <p class="lead fw-lede">Started, not finished — every <span class="mono">blocked</span>/<span class="mono">postponed</span>
  task plus anything <span class="mono">in_progress</span> past the {{ view.threshold_days }}-day staleness threshold,
  with its reason and age ({{ m.derived() }}).
  {% if view.flagged %}<b>{{ view.flagged }}</b> {{ 'stall is' if view.flagged == 1 else 'stalls are' }} <b>unexplained</b> — a stalled item missing a reason is itself a finding.{% endif %}</p>
  <div class="fw-cards">
    {% for it in view['items'] %}
    <div class="fw-stalled {% if it.missing_reason %}fw-stalled--flagged{% endif %}">
      {% if it.missing_reason %}
      <div class="fw-flag">
        <span class="fw-flag__icon" aria-hidden="true">⚑</span>
        <span>No <span class="mono">reason</span> reported — this stall is unexplained. {{ m.derived() }}</span>
      </div>
      {% endif %}
      {{ m.task_card(it.task, age=it.age) }}
    </div>
    {% endfor %}
  </div>
{% else %}
  {{ m.empty_inline(view.empty_title, view.empty_reason) }}
{% endif %}
