{# 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. #}
{{ folder_error }}
{% endif %}No folders are registered yet — browse below and add one.
{% else %}{{ "your media root" if f.rel == "." else f.rel }}
{% if f.missing %}(no longer on disk){% endif %}
Domain packs can't be listed right now, so pack selection is
disabled — check your DOMAIN_PACKS_DIR / DOMAIN_PACK_PATH
configuration.
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 %} {% endif %} {% if L.entries %}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. #} {% endif %}