{{/* Organization detail partial for operator. Titled by the organization's own display name — the retired working title named this page for the grant-delivery mechanism instead of the organization it describes (plan-enrollment-administration D5). This is a Go-template comment (stripped at render), not an HTML comment, so its own wording never leaks into the rendered page. */}} {{ if .Error }} {{ end }}

{{ .OrgName }}

Owner: {{ if .OrgOwnerPersonID }} {{ if .OrgOwnerName }}{{ .OrgOwnerName }}{{ else }}{{ .OrgOwnerPersonID }}{{ end }} {{ else }} {{ end }}
{{/* Read-only key, muted code style, shown only when the organization has one. Personal organizations never do; the System tenant and rows a seed or a configuration file named are the ordinary cases. */}} {{ if .OrgKey }}Key {{ .OrgKey }}{{ end }}
{{/* Section heading rule (maintainer design round 2026-08-24): every section names itself with an OUTSIDE heading, its primary action right-aligned on the heading row; card titles only ever name instances (a pool's name), never sections. */}}

Billing

{{ if .BillingSummary.HasAccount }} Full billing → {{ end }}
{{ if not .BillingSummary.HasAccount }}

No billing account exists for this organization yet.

{{ else }}
Subscription
{{ if .BillingSummary.HasSubscription }}
{{ .BillingSummary.SubscriptionStatus }} {{ if .BillingSummary.SubscriptionPeriodEnd }} · renews {{ .BillingSummary.SubscriptionPeriodEnd }} {{ end }} {{ if .BillingSummary.CancelAtPeriodEnd }} · cancels at period end {{ end }}
{{ else }}
No subscription
{{ end }}
Latest invoice
{{ if .BillingSummary.HasInvoice }}
{{ if .BillingSummary.LatestInvoicePaid }} paid {{ else }} unpaid {{ end }} {{ if .BillingSummary.LatestInvoiceNumber }} {{ .BillingSummary.LatestInvoiceNumber }} {{ else }} {{ end }} {{ .BillingSummary.LatestInvoiceAmountDue }} · {{ .BillingSummary.LatestInvoiceDate }}
{{ else }}
No invoices issued
{{ end }}
Outstanding balance
{{ if gt .BillingSummary.OutstandingBalance 0 }} {{ .BillingSummary.OutstandingBalanceFormatted }} across open invoices {{ else }} 0 no open invoices {{ end }}
{{ end }}

Pools

{{ if .PoolMissing }} {{ else if eq (len .Pools) 0 }}

No pools for this organization.

{{ else }} {{ range .Pools }}

{{ .PoolName }} {{ .PoolType }} {{ if eq .Status "active" }} {{ .Status }} {{ else }} {{ .Status }} {{ end }}

{{ if ne .Status "active" }}

This pool is not active; it is not delivering entitlements.

{{ end }} {{ if not .HasAttachment }}

No active plan

{{ end }}
{{/* One block per DELIVERY (provision), grouped: the product renders once with the single Extend control, and its ladder placements render as rung pills beneath (maintainer design round 2026-08-24 — a shared product used to render one line per ladder with a "Same delivery" marker; the grouping conveys that structurally instead). The Extend form is pre-scoped via provision_id; a delivery that is not grant-backed gets a disabled control with the reason. */}} {{ $pool := . }} {{ range .Deliveries }}

{{ .ProductName }}

{{ range $i, $rung := .Rungs }}{{ if $i }} · {{ end }}{{ $rung.LadderName }} rank {{ $rung.Rank }}{{ end }}

{{ if .GrantBacked }} {{ else }} {{ end }}
{{ end }} {{ if gt (len .Usage) 0 }}
{{ range .Usage }} {{ end }}
Resource Used Limit
{{ .ResourceKey }} {{ .Used }} {{ .Limit }}
{{ end }} {{ range .Deliveries }} {{ if .GrantBacked }}

{{ if gt (len .Rungs) 1 }}One extension refreshes all {{ len .Rungs }} ladders shown. {{ end }}Set Expires at to extend a trial, or leave it empty for an open-ended grant.

{{ $extendActive := and (eq $.FormName "extend") (eq $.FormPoolID .ProvisionID) }}
{{ $err := fieldErr $.FormName "extend" $.FormPoolID .ProvisionID $.FieldErrors "reason" }} {{ with $err }}
{{ . }}
{{ end }}
{{ $err := fieldErr $.FormName "extend" $.FormPoolID .ProvisionID $.FieldErrors "valid_until" }} {{ with $err }}
{{ . }}
{{ end }}
{{ end }} {{ end }}
{{ end }} {{ end }} {{ if .GrantsError }} {{ end }} {{ if .PoolMissing }} {{ else if .ProductsError }} {{ end }}

Plan and grants

{{/* The Issue grant control sits inside the card because its disclosure opens inside it (maintainer 2026-08-24: disclosure actions live in the box they disclose into; navigation actions like Full billing stay on the heading row). It shares the card header with the Active/History tabs. The #plan-grants-panel wrapper is the scoped swap target for the ledger's tab/search/pager controls (GrantsNav .Target), so using them re-renders only this panel and never scrolls the page. */}}
{{ template "listTabs" .GrantsNav }}
{{ if or .PoolMissing .ProductsError }} {{ else if eq (len .IssuanceProducts) 0 }} {{ else }} {{ end }}
{{ if and (not .PoolMissing) (not .ProductsError) (gt (len .IssuanceProducts) 0) }} {{/* Collapsed by default; forced open when this form's submission just failed so field errors are never hidden. */}}

Records the grant and updates this organization's entitlements right away. If the product occupies a plan-ladder tier, the pool moves to it; leave Valid until blank for an open-ended grant.

{{ $issueActive := and (eq $.FormName "issue") (eq $.FormPoolID "") }} {{ $formErr := fieldErr $.FormName "issue" $.FormPoolID "" $.FieldErrors "" }} {{ with $formErr }} {{ end }}
{{ $err := fieldErr $.FormName "issue" $.FormPoolID "" $.FieldErrors "product_id" }} {{ with $err }}
{{ . }}
{{ end }}
{{ $err := fieldErr $.FormName "issue" $.FormPoolID "" $.FieldErrors "quantity" }} {{ with $err }}
{{ . }}
{{ end }}
Above 1 only for per-seat products; most products deliver one tier.
{{ $err := fieldErr $.FormName "issue" $.FormPoolID "" $.FieldErrors "valid_until" }} {{ with $err }}
{{ . }}
{{ end }}
{{ $err := fieldErr $.FormName "issue" $.FormPoolID "" $.FieldErrors "reason" }} {{ with $err }}
{{ . }}
{{ end }}
{{ $err := fieldErr $.FormName "issue" $.FormPoolID "" $.FieldErrors "description" }} {{ with $err }}
{{ . }}
{{ end }}
{{ $superseders := false }} {{ range $.IssuanceProducts }}{{ if .SupersedesSubscription }}{{ $superseders = true }}{{ end }}{{ end }} {{ if $superseders }} {{ end }}

Connected services (for example forum or site access) apply the change in the background and can retry or fail; the overview's system panel shows queued work for services that use the delivery queue.

{{ end }} {{/* Two tabs over one ledger (maintainer design round 2026-08-24): Active (default) shows only grants delivering right now; History is every grant ever issued with the supersession audit trail. Search matches product or reason on both tabs; tab, q, page and per live on the org URL so views deep-link. */}} {{ if eq .GrantsNav.Facet "history" }}

One row per grant ever issued. The Delivery column shows which grants are delivering right now; superseded and inactive rows are history.

{{ end }}
{{ template "listSearch" .GrantsNav }}
{{ if gt (len .Grants) 0 }}
{{ range .Grants }} {{ end }}
Product Reason Delivery Qty Activated Ended Actions
{{ if .ProductName }}{{ .ProductName }}{{ else }}—{{ end }} {{ .GrantReason }} {{ if eq .DeliveryState "live" }} Live {{ if .ExtendsLabel }}
extends {{ .ExtendsLabel }}{{ end }} {{ else if eq .DeliveryState "superseded" }} Superseded {{ if .ReplacedByLabel }}
replaced by {{ .ReplacedByLabel }}{{ end }} {{ else }} Inactive {{ end }}
{{ .Quantity }} {{ if .ActivatedAt }}{{ .ActivatedAt }}{{ else }}—{{ end }} {{ if .EndedAt }}{{ .EndedAt }}{{ else }}—{{ end }} {{ if eq .DeliveryState "live" }} {{ if eq .GrantReason "default" }} System-managed {{ else }} {{ end }} {{ end }}
{{ template "listPager" .GrantsNav }} {{ else if .GrantsNav.Q }} {{ template "listNoMatch" .GrantsNav }} {{ else if eq .GrantsNav.Facet "history" }}
No grants issued yet.
{{ else }}
No grants are delivering right now. The History tab lists every grant ever issued.
{{ end }}

Members

{{ if .MembersError }} {{ end }} {{ if eq (len .Members) 0 }}
No members.
{{ else }}
{{ range .Members }} {{ end }}
Name Email Role Joined
{{ .DisplayName }} {{ .Email }} {{ .RoleName }} {{ .JoinedAt }}
{{ if .MembersCapped }}

Showing the latest 16 of {{ .MembersTotal }}.

{{ end }} {{ end }}
{{/* Formerly "Position history"; maintainer design round 2026-08-24: rows carry the ladder key, humanized verbs, and tier NAMES instead of integer ranks (Go-template comment so it never ships). */}}

Tier changes

{{/* #tier-changes-panel: scoped swap target for this list's pager, so paging never scrolls the page (TierChangesNav.Target). */}}
{{ if .TransitionsError }} {{ end }} {{ if eq (len .Transitions) 0 }}

No tier changes recorded.

{{ else }}
{{ range .Transitions }} {{ end }}
Ladder Change From To By Reason When
{{ .LadderName }} {{ if .ChangeTooltip }}{{ .ChangeLabel }}{{ else }}{{ .ChangeLabel }}{{ end }} {{ .FromLabel }} {{ .ToLabel }} {{ if .ActorName }}{{ .ActorName }}{{ else }}{{ .ActorType }}{{ end }} {{ .Reason }} {{ .EffectiveAt }}
{{ template "listPager" .TierChangesNav }} {{ end }}