{% load static vantage i18n %}{% comment %} The per-list customisation rail. Six independent forms, one per section, each a plain POST. No JavaScript is involved and none is required: every control is a checkbox, a number box or a select, and the page it posts to answers with a redirect back to the list. The script loaded at the bottom adds reordering buttons and a select-all, and nothing else — take it away and the rail still does everything it claims to. Six forms rather than one, for the same reason `vantage/settings.html` uses one form and six reset *buttons*: a form cannot nest, and each section here has its own reset and its own scope. Saving the columns must not also rewrite the filters with whatever happened to be on screen, and separate forms make that structural rather than something the view has to remember. Ordering without JavaScript is a number box per row. Unattractive, and the only thing that works with scripting off; the enhancement script hides them behind ↑/↓ buttons. {% endcomment %}
{% icon "sliders" %} {% translate "Customise" %} {% if list_prefs.spec.stored %} {% translate "Tuned" context "badge: these list preferences differ from the code defaults" %} {% endif %}
{% comment %} The level the sections below were skipping. Every section inside the rail is an h3, the page's own title is the h1, and nothing sat between them — so a screen reader reading the outline saw six h3s belonging to nothing. Visually hidden because the trigger already labels the rail on screen; a heading is what makes that label exist for a reader who is navigating by structure rather than looking at the button. {% endcomment %}

{% translate "Customise this list" %}

{% blocktranslate trimmed %} Changes here affect this list only, and only for you — unless you save them for everyone. Reset puts a section back to what the code declares. {% endblocktranslate %}

{% comment %} One wrapper around the six forms so they can flow into columns on a wide screen. The rail is narrow beside a table and wide beneath one, and this is the whole of the difference between the two. {% endcomment %}
{% comment %} ── columns and page size ───────────────────────────────────── {% endcomment %} {% comment %} data-prefs-columns-form is the hook vantage-grid.js uses to auto-save a drag-resize or an in-header pin toggle: it submits this exact form in the background, with whatever the checkboxes and number boxes in it already say, so a resize can never clobber a reorder or a hide that has not been saved yet. {% endcomment %}
{% csrf_token %}

{% translate "Columns" %}

{% if list_prefs.overridden.columns %} {% translate "tuned" context "badge: this section differs from the code defaults" %} {% endif %}
{% comment %} A plain
, not a
{% comment %} Four buttons, one name. Only the pressed submit sends a value, so the scope has to ride on the button rather than in a hidden field — and one parameter means the permission check for "for everyone" has exactly one door to guard. {% endcomment %}
{% if list_prefs.may_set_default %} {% endif %} {% if list_prefs.may_set_default %} {% endif %}
{% comment %} ── search ──────────────────────────────────────────────────── {% endcomment %} {% if list_prefs.search_options %}
{% csrf_token %}

{% translate "Search" context "list preferences section, the noun" %}

{% if list_prefs.overridden.search %}{% translate "tuned" context "badge: this section differs from the code defaults" %}{% endif %}
{% for option in list_prefs.search_options %} {% endfor %}
{% if list_prefs.may_set_default %} {% endif %} {% if list_prefs.may_set_default %} {% endif %}
{% endif %} {% comment %} ── filters ─────────────────────────────────────────────────── {% endcomment %} {% if list_prefs.filter_options %}
{% csrf_token %}

{% translate "Filters" %}

{% if list_prefs.overridden.filters %}{% translate "tuned" context "badge: this section differs from the code defaults" %}{% endif %}
{% for option in list_prefs.filter_options %} {% endfor %}
{% if list_prefs.may_set_default %} {% endif %} {% if list_prefs.may_set_default %} {% endif %}
{% endif %} {% comment %} ── statistics ──────────────────────────────────────────────── {% endcomment %}
{% csrf_token %}

{% translate "Statistics" %}

{% if list_prefs.overridden.stats %}{% translate "tuned" context "badge: this section differs from the code defaults" %}{% endif %}
{% for option in list_prefs.stat_options %} {% endfor %} {% for option in list_prefs.extra_stats %} {% endfor %} {% if not list_prefs.stat_options and not list_prefs.extra_stats %}

{% translate "No statistics are declared for this list yet." %}

{% endif %}
{% translate "Add one" %}
{% if list_prefs.may_set_default %} {% endif %} {% if list_prefs.may_set_default %} {% endif %}
{% comment %} ── charts ──────────────────────────────────────────────────── {% endcomment %}
{% csrf_token %}

{% translate "Charts" %}

{% if list_prefs.overridden.charts %}{% translate "tuned" context "badge: this section differs from the code defaults" %}{% endif %}
{% for option in list_prefs.chart_options %} {% endfor %} {% for option in list_prefs.extra_charts %} {% endfor %} {% if not list_prefs.chart_options and not list_prefs.extra_charts %}

{% translate "No charts are declared for this list yet." %}

{% endif %}
{% if list_prefs.dates or list_prefs.groups %}
{% translate "Add one" %} {% if list_prefs.dates %} {% endif %} {% if list_prefs.groups %} {% endif %}
{% endif %}
{% if list_prefs.may_set_default %} {% endif %} {% if list_prefs.may_set_default %} {% endif %}
{% comment %} ── summary bar ─────────────────────────────────────────────── {% endcomment %}
{% csrf_token %}

{% translate "Summary bar" %}

{% if list_prefs.overridden.summary %}{% translate "tuned" context "badge: this section differs from the code defaults" %}{% endif %}
{% for option in list_prefs.summary_options %} {% empty %}

{% translate "No numeric columns to total on this list." %}

{% endfor %}
{% if list_prefs.may_set_default %} {% endif %} {% if list_prefs.may_set_default %} {% endif %}