{{ define "main" }} {{- $all := partialCached "concepts.html" "concepts" -}} {{- $tones := partial "tones.html" . -}} {{- $s := newScratch -}} {{- range $all.id }}{{ $s.Add .trust.tone (slice .) }}{{ end -}} {{- $total := len $all.id -}}

{{ .Title }}

{{- /* The ladder as a card: a bar per state, then the report's other figures. */}}
Trust ladder {{ $total }} concepts
{{- range $tone := $tones.order }} {{- $n := len ($s.Get $tone | default slice) }}
{{ if $n }}{{ index $tones $tone }}{{ else }}{{ index $tones $tone }}{{ end }} {{ $n }} of {{ $total }} {{ $n }}
{{- end }}

Also counted

{{ partial "health-tiles.html" (dict "states" false) }}
{{- range $tone := $tones.order }} {{- with $s.Get $tone }}

{{ index $tones $tone }}: {{ len . }}

{{- end }} {{- end }}
{{ end }}