{# ABOUTME: Plan-01 paginated list partial — chip strip, count label, sortable table, pager. #} {# Rendered standalone for htmx swaps into #book-list. #} {% include "_status_filter.html" %} {% include "_filter_chips.html" %} {% if page.total > 0 %}
Showing {{ page.start }}–{{ page.end }} of {{ page.total }}
{# Sortable header link macro. Clicking the active column flips direction; clicking an inactive column starts at ``asc``. Page resets to 1 on any sort change — the user has new ordering, the old page index is stale. Active filters ride along so the user's filter set survives a re-sort. #} {% macro sort_link(label, key) -%} {%- set is_active = (query.sort == key) -%} {%- set next_dir = 'desc' if (is_active and query.dir == 'asc') else 'asc' -%} {{ label }}{% if is_active %} {% endif %} {%- endmacro %} {# P3 (#183) — bulk-mark form lives outside the table so the checkbox inputs inside each row can target it via the ``form="…"`` attribute, keeping the table markup flat and the action bar reusable across the desktop table and the mobile card list. #}| {{ sort_link('Title', 'title') }} | {{ sort_link('Author', 'author') }} | {% if 'series' in visible_columns %}{{ sort_link('Series', 'series') }} | {% endif %} {% if 'isbn' in visible_columns %}ISBN | {% endif %} {% if 'language' in visible_columns %}Language | {% endif %} {% if 'publisher' in visible_columns %}Publisher | {% endif %} {% if 'added' in visible_columns %}{{ sort_link('Added', 'added') }} | {% endif %} {% if 'enriched' in visible_columns %}Enriched | {% endif %}|||
|---|---|---|---|---|---|---|---|---|---|---|
| {%- set status = book_statuses.get(book.id) -%} {%- if status and status.status == 1 -%} 📖 {%- elif status and status.status == 2 -%} ✓ {%- endif %} {{ book.metadata.title }} | {{ book.metadata.author }} | {% if 'series' in visible_columns %}{% if book.metadata.series %}{{ book.metadata.series }}{% if book.metadata.series_index is not none %} #{{ '%g'|format(book.metadata.series_index) }}{% endif %}{% endif %} | {% endif %} {% if 'isbn' in visible_columns %}{{ book.metadata.isbn or '' }} | {% endif %} {% if 'language' in visible_columns %}{{ book.metadata.language or '' }} | {% endif %} {% if 'publisher' in visible_columns %}{{ book.metadata.publisher or '' }} | {% endif %} {% if 'added' in visible_columns %}{{ book.date_added or '' }} | {% endif %} {% if 'enriched' in visible_columns %}{% if book.metadata_matched_at %}✓{% endif %} | {% endif %}{# Native |
No books match these filters.
{% elif query.q %}No books matching '{{ query.q }}'
{% else %}Your library is empty. Run bookery import to add books.