{{/* A filter-wide total, so a visitor can tell whether they're looking at the whole
directory or a slice of it. It counts matches rather than rows on screen, which
keeps it accurate as htmx appends further pages below. */}}
{{end}}
{{/* org-rows renders just the directory rows; shared by the full page and the
htmx "load more" fragment so appended pages match the first. */}}
{{define "org-rows"}}
{{range .All}}
{{end}}
{{end}}
{{/* org-more is the "load more" control. It replaces itself (hx-swap outerHTML)
with the next page's rows followed by a fresh org-more, so the list grows in
place without scrolling to the top. The cursor already carries sort + query. */}}
{{define "org-more"}}
{{end}}
{{/* orgs-frag is the htmx response layout: rows + next control, no page chrome. */}}
{{define "orgs-frag"}}{{template "org-rows" .}}{{if .NextCursor}}{{template "org-more" .}}{{end}}{{end}}
{{define "content"}}
{{if .Error}}
{{.Error}}
{{end}}
{{/* Search/filters come FIRST in the DOM and move to the right of the list at lg
(order-lg-last). Source order governs both the mobile stack and the tab order,
so ordering with CSS alone would leave keyboard and screen-reader users
traversing every row to reach the control that exists to avoid exactly that. */}}