{# Inline take-history panel for one deck/part. Lazy-fetched via HTMX from ``GET /decks/{course}/{section}/{deck}/takes?part=N`` and rendered inside an additional ```` directly under the deck row. The panel refreshes itself on ``sse:job`` events so a retake-in-progress shows up without the user toggling the panel. Inputs: deck_name — original (un-sanitized) deck name; rendered in the header part — part number this panel is showing active — ``TakeFileInfo`` for the active take, or None when no state record exists for this part (the panel then renders only superseded history). takes — list of TakeFileInfo for superseded takes panel_locked — True when the session has this exact deck armed/ recording. Restore buttons render disabled and the column header is replaced by an info note. restore_url_for — callable(take) → URL for the restore POST. #} {% macro take_row(take, is_active, panel_locked, restore_url_for) -%} {% set explorer_path = take.final_path or take.raw_path %} {{ take.take if take.take else '?' }} {% if is_active %}active{% endif %} {{ take.kind }} {{ take.display_stem }} {{ take.recorded_at | mtime }} {% if explorer_path %}
{% endif %} {% if is_active %} current {% else %} {% set restore_url = restore_url_for(take) if restore_url_for else None %} {% if restore_url %} {% endif %} {% endif %} {%- endmacro %}
Takes for part {{ part if part > 0 else 1 }}
{% if not active and not takes %}

No takes recorded yet for this part.

{% else %} {% if active %} {{ take_row(active, True, panel_locked, restore_url_for) }} {% endif %} {% for take in takes %} {{ take_row(take, False, panel_locked, restore_url_for) }} {% endfor %}
Take Status File Recorded {% if panel_locked %} Locked {% else %} Action {% endif %}
{% endif %}