{# ABOUTME: Detail Reading partial — segmented status control + device read state. #} {# ABOUTME: Outer id="detail-reading" matches the htmx swap target from the toggle buttons. #} {# Always rendered when a book context is present so the segmented control is reachable even on a never-touched book — the user's first toggle has nowhere else to live. #}

Reading

{% set current_status = book_status.status if book_status else 0 %}
{% for value, slug, label in [(0, "unread", "Unread"), (1, "reading", "Reading"), (2, "finished", "Finished")] %} {% endfor %}
{% if queued_for_push %}

Queued for next sync

{% endif %} {% if device_read_state %}
{% if device_read_state.percent_read is not none %}
Progress
{{ "%.0f"|format(device_read_state.percent_read * 100) }}%
{% endif %} {% if device_read_state.last_read_at %}
Last opened
{{ device_read_state.last_read_at }}
{% endif %}
Device
{{ device_read_state.device_kind|title }}{% if device_read_state.device_label %} ({{ device_read_state.device_label }}){% endif %}
{% endif %}