{{ define "storage_stats" }}
{{ if .Tier }}
Tier: {{/* Whitelist known tier names so an unrecognized tier falls back to a safe neutral badge instead of producing a broken class. */}} {{ if eq .Tier "deckhand" }} {{ .Tier }} {{ else if eq .Tier "bosun" }} {{ .Tier }} {{ else if eq .Tier "quartermaster" }} {{ .Tier }} {{ else }} {{ .Tier }} {{ end }}
{{ end }}
Storage: {{ if .HasLimit }} {{ .HumanSize }} / {{ .HumanLimit }} {{ else }} {{ .HumanSize }} Unlimited {{ end }}
{{ if .HasLimit }}
{{ .UsagePercent }}% used
{{/* Color alone on the progress bar doesn't meet AAA — repeat the warning as an alert block once usage crosses the threshold. */}} {{ if ge .UsagePercent 100 }} {{ template "alert" (dict "Type" "error" "Message" "You've exceeded your storage limit. New pushes will be rejected until you delete images to free space.") }} {{ else if ge .UsagePercent 95 }} {{ template "alert" (dict "Type" "error" "Message" "You're nearly at your storage limit. Pushes may fail once you exceed it.") }} {{ else if ge .UsagePercent 80 }} {{ template "alert" (dict "Type" "warning" "Message" "You're using most of your storage quota. Consider cleaning up untagged images.") }} {{ end }} {{ end }}
Unique Blobs: {{ .UniqueBlobs }}
{{ end }}