{# Per-folder editor for the Move to Folder / Create Empty Folder actions.
Those actions take a path whose levels may carry Checkmk attributes as a
Python dict after a '|', e.g.
linux/{{customer}}|{'contactgroups': {'groups': ['team'], 'use': True}}
Hand-writing that is error-prone (quotes, braces, the contactgroups shape)
and unreadable once the path has a few levels. This builds one card per
folder level with real input fields for the typical attributes and writes
the value back into the original text input, which stays the form's source
of truth — nothing about submission or validation changes.
The builder only takes over what it can round-trip exactly. Jinja blocks are
masked before the path is split (so '{{ os|lower }}' does not look like an
options separator) and a bare Jinja value is kept verbatim as a raw
expression. Anything else that does not parse leaves the level in text mode
with a visible reason, so a value is never silently rewritten. #}