{{define "title"}}Configuration · {{.Org.Name}} · MeshTender{{end}} {{define "header"}}{{template "org-header" .}}{{end}} {{define "content"}} {{template "org-tabs" .Nav}} {{if and (not .Config.HasConfig) (not .CanEdit)}}
This organization hasn't defined any configuration yet.
{{else}} {{/* Section 1 — the configuration a chosen profile produces, with the profile list in the right rail above the region legend (the sidebar position the rest of the site uses). The main pane shows the *assembled* list — profile steps with the location's region commands spliced in — which is what a repeater owner actually runs; see ConfigView.AssembledLines. Main comes first in the DOM so a narrow screen reads content before its picker, matching the other org pages. */}} {{if or .Config.Profiles .Config.PreviewActive .CanEdit}}
{{if or .Config.Profiles .Config.PreviewActive}}

{{if .Config.Profiles}}{{.Config.Selected}}{{else}}Region commands{{end}} {{if .Config.PreviewActive}} · at {{.PreviewLat}}, {{.PreviewLon}}{{else}} · base settings{{end}}

{{template "config-lines" .Config.AssembledLines}}
{{if .Config.PreviewActive}} {{if not .Config.RegionDef}} {{end}} {{else if .Config.HasRegionShapes}} {{end}}
{{else if .CanEdit}} {{/* Admin, no profiles yet: explain what a profile is and point at Add profile. */}}

What's a profile?

A profile is this organization's recommended configuration: the commands a repeater owner runs to bring their repeater in spec, not just onto the mesh. Profiles vary by hardware and use case, so give each one a name that tells members which fits theirs.

Use Add profile to create your first one.

{{end}}
{{if or .Config.Profiles .CanEdit}}

Profiles

{{if .CanEdit}}
{{end}}
{{if .Config.Profiles}}
{{range .Config.Profiles}}
{{.Name}} {{if $.CanEdit}}
{{end}}
{{end}}
{{else}}
No profiles yet.
{{end}}
{{end}}
{{end}} {{/* Section 2 — Regions: the map is the view of them, and the list beside it is the map's legend (swatch + hierarchy by indentation). Everyone sees it; only admins get the controls. Clicking the map picks a location, which is what drives the assembled preview above. */}} {{if or .Config.Regions .CanEdit}}

Regions

Named areas drawn on a map. A repeater joins every region whose area contains it.
{{if .CanEdit}}
{{end}}
{{if and .CanEdit (not .Config.RootAllowFlood)}} {{/* Denying the wildcard is the one setting here that can quietly take an org off the air, so it gets a standing alert rather than a line of small print. */}}
{{end}}
{{if .Config.HasRegionShapes}} {{template "map-styles"}}
{{template "map-scripts"}} {{/* Region names and shapes are user data, interpolated in a JS context so html/template JSON-encodes and escapes them. */}} {{else}}
{{if .Config.Regions}} No region has an area drawn yet, so there is nothing to show on a map. {{if .CanEdit}}Use the area button on a region to outline where it applies.{{end}} {{else}} Regions apply settings by location. Add one, draw where it applies, and a repeater there picks it up automatically. {{end}}
{{end}}
{{if .CanEdit}} {{/* The root (*) isn't a region row — it lives on the org — so it has no swatch and its only setting is flood policy, saved on its own. It is NOT "everywhere": MeshCore consults the wildcard only for packets that carry no region, and scoped packets are matched against the defined regions alone (meshcore-go node/region.go, FindFloodMatch). The old wording invited exactly the wrong reading. */}}
Root · *
{{/* No hidden shadow input: an unchecked checkbox simply isn't submitted, which the handler reads as deny. */}}
{{/* Sits next to the switch, not the row label: what needs explaining is allow/deny flooding, not the word "Root". Outside the
{{end}} {{range .Config.Regions}}
{{/* Align to the top, not the middle: the swatch labels the region's name on the first line, and centering would float it down beside the token. */}}
{{if .HasShape}} {{else}} {{template "icon-alert" ""}} {{end}} {{/* Name, then token, then status — each on its own line. A token is an identifier, so it never wraps mid-string. */}}
{{.DisplayName}}
{{.Token}}
{{if not .HasShape}}
Needs an area
{{else if .Matches}}
Applies here
{{else if not .AllowFlood}}
Flood denied
{{end}}
{{if $.CanEdit}} {{template "icon-map-pin" ""}}
{{end}}
{{end}} {{if not .Config.Regions}}
No regions yet.
{{end}}
{{end}} {{if .CanEdit}} {{end}} {{end}} {{end}} {{/* config-lines renders assembled ConfigLines as one copy-pasteable block. Region lines are tinted so it reads which came from the location rather than the profile, matching the highlighted polygons on the map. */}} {{define "config-lines"}} {{if .}}
{{range .}}{{if .IsMarker}}… click a spot on the map below to fill in the region commands …{{else if .IsComment}}# {{.Text}}{{else if .FromRegion}}{{.Text}}{{else}}{{.Text}}{{end}}
{{end}}
{{else}}
No steps.
{{end}} {{end}}