{# htmx partial: paginated contacts table #} {% macro sort_link(col, label) %} {% set new_dir = 'asc' if sort_by == col and sort_dir == 'desc' else 'desc' %} {% if sort_by == col %} {% set arrow = ' ▲' if sort_dir == 'asc' else ' ▼' %} {% set active = ' sort-active' %} {% else %} {% set arrow = ' ↕' %} {% set active = '' %} {% endif %} {{ label }}{{ arrow }} {% endmacro %}
{{ total }} contacts found — page {{ page }} of {{ pages }}
{% for c in contacts %} {% else %} {% endfor %}
{{ sort_link('name', 'Name') }} {{ sort_link('title', 'Title') }} {{ sort_link('company', 'Company') }} {{ sort_link('company_tier', 'Tier') }} {{ sort_link('status', 'Status') }} {{ sort_link('total_interactions', 'Total') }} {% if has_date_filter %}In Period{% else %}Last 30d{% endif %} {{ sort_link('first_interaction', 'First Seen') }} {{ sort_link('latest_interaction', 'Last Active') }}
{{ c.name }} {{ c.title[:50] }}{% if c.title|length > 50 %}…{% endif %} {{ c.company }} {{ c.company_tier }} {{ c.status }} {{ c.total_interactions }} {{ c.last_30d }} {{ c.first_interaction }} {{ c.latest_interaction }}
No contacts found.
{# ── Pagination ── #} {% if pages > 1 %}
{% if page > 1 %} « Prev {% endif %} {% for p in range(1, pages + 1) %} {% if p == page %} {{ p }} {% elif p <= 3 or p > pages - 3 or (p >= page - 2 and p <= page + 2) %} {{ p }} {% elif p == 4 or p == pages - 3 %} {% endif %} {% endfor %} {% if page < pages %} Next » {% endif %}
{% endif %}