{{define "title"}}Organizations · MeshTender{{end}} {{define "header"}}

Organizations

{{/* 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. */}}
{{if .Query}} {{.Total}} {{if eq .Total 1}}organization{{else}}organizations{{end}} matching “{{.Query}}” {{else}} {{.Total}} {{if eq .Total 1}}organization{{else}}organizations{{end}} {{end}}
{{if .UserName}}
{{template "icon-plus" "me-1"}}Create organization
{{end}}
{{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}}
{{.Name}} {{if .Region}}{{.Region}}{{end}}
{{if .Description}}

{{markdowntext .Description}}

{{end}}
{{.MemberCount}} member{{if ne .MemberCount 1}}s{{end}} · {{.RepeaterCount}} repeater{{if ne .RepeaterCount 1}}s{{end}}
{{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. */}}
{{if .All}}
{{template "org-rows" .}} {{if .NextCursor}}{{template "org-more" .}}{{end}}
{{else}}

{{if .Query}}No organizations match “{{.Query}}”.{{else}}No organizations yet.{{end}}

{{end}}
{{end}}