{{- /* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial */ -}} {{- /* SPDX-FileCopyrightText: 2025-2026 Christian Galo */ -}} {{/* operator_list_controls.html Shared controls for governed operator lists (operator-list-scale). Defines, all taking a server.ListNav: listSearch: the search form alone. Input names come from the nav's QParam (parameter prefix applied) so several embedded lists can share one URL; sibling-list state (nav.ExtraInputs) rides along as hidden inputs because a GET form replaces the whole query string. listControls: listSearch + optional facet pills, rendered above the table (the standalone-page layout). Facet pills are links (one click to set, "All" to clear), the active pill marked. listTabs: the nav-tabs rendering of FacetOptions, for embedded lists whose facet is a small set of modes (e.g. the grants ledger's Active/History). Unlike the pills there is no synthetic "All": an option with Value "" IS the default mode, so give it a real label. Rendered inside a .card-header (card-header-tabs). listPager: "Showing X–Y of N", the page-size picker when the nav offers options, and Previous/Next, rendered below the table. The true total comes from the paged query's count(*) OVER() (design D2). listNoMatch: the searched-or-filtered-to-nothing state, distinct from the list's true-empty state (which empty-state-guidance owns): names the term, links back to the bare list. environmentNotice takes a server.EnvironmentNotice instead: the one muted line above a billing view that names the rows its Stripe environment filter is holding back and carries the switch between the two states (stripe-environment-stamp D7). It renders nothing when the filter hides nothing. It lives here rather than in each of the four billing views because its markup and its switch are the same line four times over. When nav.Target is set (embedded lists), every control issues a scoped htmx request (hx-get with hx-target/hx-select on the panel's selector, outerHTML swap, URL pushed) so only that panel re-renders and the page never scrolls (scroll-into-view is opt-in in htmx; a boosted full-page navigation is what jumps to the top). The plain href/action stays as the no-JS fallback. */}} {{ define "listSearch" }} {{/* Declared as a search form (form-library, spec operator-panel-navigation, design D4): a native GET with a true no-JS fallback for a standalone list, an htmx-scoped GET for a list embedded beside siblings (list_scale_forms.go). */}} {{ template "form" .Form }} {{ end }} {{ define "listControls" }}
{{ .Showing }}
{{ if .PerPageOptions }}Per page: {{ range .PerPageOptions }} {{ if $.PerPageActive . }}{{ . }}{{ else }}{{ . }}{{ end }} {{ end }}
{{ end }} {{ if gt .Pages 1 }} {{ end }}No rows match{{ if .Q }} "{{ .Q }}"{{ end }}{{ if .Facet }}{{ if .Q }} with{{ else }} with{{ end }} the current filter{{ end }}.
{{ .Text }} {{ .LinkLabel }}
{{ end }} {{ end }}