{% load i18n ui %}{% comment %} The folder listing (#292, the GridNew board), inside a form: a path bar (the folders above as links, then a field for any folder), then the folder's subfolders as links and its netCDF files, each with what its header holds (gridded.listing) and its size. New run's chooser (pick empty): each file has a checkbox, its daily variables and dates; a file that cannot be chosen (no daily grid, a thresholds file, an unreadable time axis) is greyed, its checkbox off; files ticked in other folders ride along as hidden fields. The set-up page's Browse (#320; pick "file" or "folder", pick_field the field it fills): a thresholds file is chosen by its name, every other netCDF file greyed; a folder by "Choose this folder" under the subfolders. Close leaves the field as it was. Without JavaScript these post the set-up form (action "pick::", "close"), which fills the field and draws the page again; js/gridded.js fills the field in place. The links are the form's buttons (action ""), so they work without JavaScript and keep the rest of the form; htmx swaps only this listing (listing_target, listing_swap). Context: browse (listing.listing or listing.picking), folder_value, folder_error, listing_url, browse_action, listing_target, listing_swap, pick, pick_field. {% endcomment %}
{% if pick %}{% endif %} {% for path in browse.elsewhere %}{% endfor %}
{% if pick %}{# Enter in the folder field (js/gridded.js; without JavaScript the form's default button does it) #}{% endif %}
{% if folder_error %}{% endif %} {% if browse.error %}

{% icon "warning" %}{{ browse.error }}

{% endif %}
{% if not pick %}{% endif %} {% if pick != "folder" %} {% endif %} {% for folder in browse.folders %} {% if not pick %}{% endif %} {% endfor %} {% for f in browse.files %} {% if pick %} {% else %} {% endif %} {% endfor %} {% if not browse.folders and not browse.files %} {% if not pick %}{% endif %}{% if pick == "folder" %}{% translate "No folders here." %}{% else %}{% translate "No folders or netCDF files here." %}{% endif %} {% endif %}
{% if pick == "folder" %}{% blocktranslate with folder=browse.folder %}Folders in {{ folder }}{% endblocktranslate %}{% else %}{% blocktranslate with folder=browse.folder %}Folders and netCDF files in {{ folder }}{% endblocktranslate %}{% endif %}
{% translate "Chosen" %}{% translate "Name" %}{% if pick %}{% translate "Holds" %}{% else %}{% translate "Daily variables" %}{% endif %} {% translate "Dates" %} {% translate "Size" %}
{% if f.thresholds %}{% else %}{{ f.name }}{% endif %} {% if f.thresholds %}{% translate "Percentile thresholds" %}{% else %}{% blocktranslate with note=f.note %}– ({{ note }}){% endblocktranslate %}{% endif %} {% if f.usable %}{{ f.variables|join:", " }}{% else %}{% blocktranslate with note=f.note %}– ({{ note }}){% endblocktranslate %}{% endif %}{{ f.dates|default:"–" }} {{ f.size|filesizeformat }}
{% if pick %}
{% if pick == "folder" %}{% endif %}
{% endif %}