Manage Tiers: {{ .Ladder.Name }} ({{ .Ladder.LadderKey }})

{{ if .Error }} {{ end }} {{ if gt (len .AvailableProducts) 0 }}
{{ $err := index .FieldErrors "product_id" }} {{ with $err }}
{{ . }}
{{ end }}
New tiers are added at the bottom — drag rows below to set the order.
{{ else }} {{ end }} {{ if eq (len .Tiers) 0 }}

No tiers in this ladder.

{{ else }}

Drag a row by its handle (⣿) to reorder tiers — dropping shows a preview, and nothing is saved until you commit. Rank 0 is the top, base tier; when a ladder is an org type's default plan, its rank-0 tier is what new organizations of that type start on.

{{ $pending := .Pending }} {{ $removal := .RemovalPending }} {{ $rows := .Tiers }}{{ if $pending }}{{ $rows = $pending.Order }}{{ end }} {{ range $rows }} {{ end }}
Rank Product Active Attachments Actions
{{ .Rank }} {{ .ProductName }} {{ if eq .Rank 0 }}{{ range $.DefaultForOrgTypeNames }}Default for new {{ . }} orgs{{ end }}{{ end }} {{ if .HasActiveAttachments }} Yes {{ else }} None {{ end }} {{ if or $pending $removal }} {{ else if .HasActiveAttachments }}
{{ .ActiveAttachmentCount }} pool(s) hold this tier; removing previews the effect on each before anything changes.
{{ else }} {{ end }}
{{ with .Pending }}

Preview — nothing saved yet.

{{ if .Stale }}

The page was out of date; this pending order reflects the ladder's current tiers.

{{ end }} {{ if not .RankZeroChanged }}

Display order only — rank 0 is unchanged.

{{ else if not .TypePreviews }}

Rank 0 changes from {{ .OldRankZeroName }} to {{ .NewRankZeroName }}, but this ladder is not any org type's default — display order only.

{{ else }}

Rank 0 changes from {{ .OldRankZeroName }} to {{ .NewRankZeroName }} — the default plan for new {{ range $i, $tp := .TypePreviews }}{{ if $i }}, {{ end }}{{ $tp.DisplayName }}{{ end }} organizations. Committing:

{{ range .TypePreviews }}

{{ .DisplayName }}

{{ with .Preview }} {{ if .Empty }}

No existing organizations are affected.

{{ else }}
    {{ if gt (len .WouldInitiate) 0 }}
  • {{ len .WouldInitiate }} without a plan — initiated onto the new rank-0 tier.
  • {{ end }} {{ if gt (len .OutgoingDefault) 0 }}
  • {{ len .OutgoingDefault }} on the outgoing rank-0 via the type default — requires a disposition below.
    show all {{ len .OutgoingDefault }}
      {{ range .OutgoingDefault }}
    • {{ .Name }} ({{ .Slug }})
    • {{ end }}
  • {{ end }} {{ if gt .AlreadyAtDefault 0 }}
  • {{ .AlreadyAtDefault }} already on the new rank-0 tier — untouched.
  • {{ end }} {{ if gt (len .OtherSource) 0 }}
  • {{ len .OtherSource }} on a plan from another source — never touched.
  • {{ end }} {{ if gt (len .WouldFail) 0 }}
  • {{ len .WouldFail }} would fail:
      {{ range .WouldFail }}
    • {{ .OrgName }} ({{ .OrgSlug }}) — {{ .Reason }}
    • {{ end }}
  • {{ end }}
{{ end }} {{ end }} {{ end }} {{ end }}
{{ range .OrderIDs }}{{ end }} {{ if .NeedsDisposition }}
{{ end }}
{{ end }} {{ with .RemovalPending }}

Removing {{ .ProductName }} from this ladder — preview, nothing removed yet.

{{ if .PromotedName }}

{{ .PromotedName }} becomes the rank-0 tier{{ if .PromotedForTypes }} — what new {{ range $i, $n := .PromotedForTypes }}{{ if $i }}, {{ end }}{{ $n }}{{ end }} organizations start on{{ end }}.

{{ end }}
    {{ if gt (len .OtherSource) 0 }}
  • {{ len .OtherSource }} hold this plan from another source — their position on this ladder ends, delivery continues.
    show all {{ len .OtherSource }}
      {{ range .OtherSource }}
    • {{ .Name }} ({{ .Slug }}) — {{ .Source }}
    • {{ end }}
  • {{ end }} {{ if gt (len .DefaultSourced) 0 }}
  • {{ len .DefaultSourced }} hold it as the org type default — choose their disposition below.
    show all {{ len .DefaultSourced }}
      {{ range .DefaultSourced }}
    • {{ .Name }} ({{ .Slug }})
    • {{ end }}
  • {{ end }}
{{ if .NeedsDisposition }}
{{ end }}
{{ end }} {{ end }}