{#- A folder: its path, its subfolders and documents in one table (or as tiles), a bar
for what applies to the selection; the community's folders beside it. Drawn in
`mockups/templates/folder.html`.
The card is the selection's form: what is ticked goes with Download, Move, Delete.
The filter and the view switch belong to forms of their own, outside it. -#}
{% extends "ads_community.html" %}
{% set folder_post = url_for(".folder_post", community_id=g.community.slug, folder_id=folder.id) %}
{% block page_title %}{{ folder.title }} · {{ _("Documents") }} · {{ g.community.name }}{% endblock %}
{#- What `folder.js` reads to fill a dialog from a row: hidden, unnamed, never sent. -#}
{% macro item_data(obj) -%}
{% if obj.is_folder -%}
{%- else -%}
{%- endif %}
{%- endmacro %}
{#- What can be done to one item. Download, Move and Delete tick it alone and do what
the selection's buttons do. -#}
{% macro item_menu(obj) %}
{{ icon("dots") }}
{{ item_data(obj) }}
{% endmacro %}
{% macro select_box(obj) -%}
{%- endmacro %}
{#- A folder's size is what it holds. -#}
{% macro size(obj) -%}
{% if obj.is_folder %}{{ ngettext("%(num)d item", "%(num)d items", counts[obj.id]) }}{% else %}{{ obj.content_length | filesize }}{% endif %}
{%- endmacro %}
{#- The tree: a folder with subfolders has a button that shows or hides them (a
`` holding only its summary; `theme.css` shows the list that follows). -#}
{% macro tree_nodes(nodes) %}
{% for node in nodes %}
{#- The forms that controls of the card belong to through their `form` attribute. -#}
{% endblock %}
{% block overlays %}
{% import "documents/_dialogs.html" as dialogs with context %}
{% if may_write %}{{ dialogs.folder_dialogs(folder) }}{{ dialogs.document_dialogs() }}{{ dialogs.move_dialog(folder) }}{% endif %}
{% if may_manage %}{{ dialogs.change_owner_dialog(folder) }}{% endif %}
{% endblock %}