{# === Flash messages (e.g. "Absence deleted") === #}
{% if messages %}
{% for m in messages %}
{{ m }}
{% endfor %}
{% endif %}
{# === Filter bar — 7 fields stacked on mobile, wrapped on desktop === #}
{# Lift the filter card above the table card so the multi-checkbox #}
{# Reasons dropdown can overflow downward without being clipped by #}
{# the next sibling .card (the table). Requires `position: relative` #}
{# for z-index to apply. #}
{# === Table of absences === #}
Date
Worker
Project
Reason
Paid?
Logged by
Notes
{% for a in page %}
{{ a.date|date:"d M Y" }}
{{ a.worker.name }}
{# Project column — shows the direct Absence.project FK, #}
{# or an em-dash for non-project absences. #}
{{ a.project.name|default:"—" }}
{{ a.get_reason_display }}
{% if a.is_paid %}
{% if a.payroll_adjustment %}({{ a.payroll_adjustment.amount|money }}){% endif %}
{% else %}
{% endif %}
{{ a.logged_by.username|default:"—" }}
{{ a.notes|truncatechars:60 }}
{% csrf_token %}
{% empty %}
{# Colspan bumped from 7 → 8 to cover the new Project column. #}
No absences match the filters.
{% endfor %}
{# === Pagination — only shown when there's more than one page === #}
{% if page.has_other_pages %}
{% endif %}
{# Reason badge colours live in static/css/custom.css under #}
{# "/* === Absence reason badges === */" — single source of truth shared #}
{# between this list and the Absences tab on /workers//. #}
{% endblock %}