{# Shared folder browser + registered-folder manager (issue #63). One panel serves the setup wizard (CSRF_SETUP) and the Settings page (CSRF_SETTINGS); it is swapped into #folder-panel with hx-swap="outerHTML", so the root element below carries the id and a re-render never nests duplicate ids. Every server path re-validates the MEDIA_ROOT containment — the client path is never trusted. Non-JS: the forms/links are ordinary POST/GET to the same routes (mutations redirect to the full page, navigation reloads with ?path=); htmx enhances them into in-place panel swaps. #}
{% if folder_error %} {% endif %}

Watched folders

{% if not folder_rows %}

No folders are registered yet — browse below and add one.

{% else %} {% if not folder_packs_available %}

Domain packs can't be listed right now, so pack selection is disabled — check your DOMAIN_PACKS_DIR / DOMAIN_PACK_PATH configuration.

{% endif %} {% endif %}

Add a folder

{% set L = folder_listing %} {% if L.root_missing %}

Your media root doesn't exist yet — create it, then reload.

{% else %} {% if L.invalid_path %}

That folder isn't available — showing your media root instead.

{% endif %} {% if L.current_registered %}

This folder is registered. ✓

{% else %}
{% endif %} {% if L.parent is not none %}

↑ up one level

{% endif %} {% if L.entries %} {% else %}

No sub-folders here.

{% endif %} {% if L.truncated %}

Showing the first {{ L.entries|length }} sub-folders — this directory has more. Use “go to folder” below to jump straight to one.

{% endif %} {# Server-canonicalized jump — also the recovery path when a directory holds more sub-folders than the browser lists, so no folder is ever unreachable. #}
{% if folders_wizard %}{% endif %}
{% endif %}