{% from "_macros.html" import icon %} {# A folder and everything under it. Recursive: a folder includes this same template for each of its children, so nesting has no fixed depth limit. Open/closed state is local to the browser (Alpine), not persisted per request -- collapsing a folder should not cost a round trip. #}
{% for child in folder.children %} {% with folder = child %} {% include "partials/_folder.html" %} {% endwith %} {% endfor %} {% for chat_item in folder.chats %} {% include "partials/_chat_link.html" %} {% endfor %} {% if not folder.children and not folder.chats %} {% endif %}