{{ define "repo-tag-section" }}
{{ if .SelectedTag }} {{/* Tag-scoped badges (platform / attested). These live INSIDE the HTMX-swapped section so they re-render on each tag change. Putting them in pages/repository.html freezes them at page load. */}}
{{ if .SelectedTag.Info.IsMultiArch }} {{ range .SelectedTag.Info.Platforms }} {{ .OS }}/{{ .Architecture }}{{ if .Variant }}/{{ .Variant }}{{ end }} {{ end }} Multi-arch {{ else if gt (len .SelectedTag.Info.Platforms) 0 }} {{ $p := index .SelectedTag.Info.Platforms 0 }} {{ if $p.OS }} {{ $p.OS }}/{{ $p.Architecture }}{{ if $p.Variant }}/{{ $p.Variant }}{{ end }} {{ end }} {{ end }} {{ if eq .ArtifactType "helm-chart" }} {{ icon "helm" "size-3" }} Helm {{ end }} {{ if .SelectedTag.Info.HasAttestations }} {{ end }}
{{ template "pull-command-switcher" (dict "RegistryURL" .RegistryURL "OwnerHandle" .Owner.Handle "RepoName" .Repository.Name "Tag" .SelectedTag.Info.Tag.Tag "ArtifactType" .ArtifactType "OciClient" .OciClient "IsLoggedIn" (ne .User nil)) }} {{ if .NonDefaultHolds }}
Hosted on: {{ range .NonDefaultHolds }} {{ displayHoldDID . }} {{ end }} (not your default hold)
{{ end }}
Image Size Layers
{{ humanizeBytes .SelectedTag.CompressedSize }} {{ .SelectedTag.LayerCount }}
Pushed {{ timeAgoShort .SelectedTag.Info.CreatedAt }}
Vulnerabilities
{{ if .SelectedTag.Info.Platforms }} {{ $firstPlatform := index .SelectedTag.Info.Platforms 0 }} Loading... {{ end }}
Pulls
{{ .Stats.PullCount }} total
{{ if .Stats.LastPull }}Last pull {{ timeAgoShort (derefTime .Stats.LastPull) }}{{ else }}No pulls yet{{ end }}
{{ range .SelectedTag.ScanBatchParams }}
{{ end }} {{ else }} {{ template "state-empty" (dict "Icon" "tag" "Title" "No tags yet" "Subtext" "Push an image to this repository and its tags will appear here." ) }} {{ end }}
{{ if .SelectedTag }} {{/* Deprecation leads the Overview panel, above the README, for the same reason it leads the metadata card on the Chart tab: it decides whether you should use the chart at all, so it has to be read before the prose that sells it. Overview is the tab people land on, so it can't be the one surface that stays silent, and a warning has to be in the first paint rather than arriving a beat later. Server-rendered from .SelectedTag.HelmMeta, which the handler fetches from the hold only for helm charts. It is nil for a container image and nil when the hold could not answer, and the shared block renders nothing at all for nil or for a chart that isn't deprecated, so no element enters the panel's space-y-4 rhythm in those cases. */}} {{ template "helm-deprecation-notice" .SelectedTag.HelmMeta }} {{ end }} {{ if and .AIAdvisorEnabled .User .IsOwner .SelectedTag }}
{{ icon "loader" "size-4 animate-spin" }}
{{ end }} {{ if and .IsOwner .ReadmeHTML }}
{{ end }}
{{ if .ReadmeHTML }} {{ .ReadmeHTML }} {{ else if .ReadmeFetchFailed }} {{/* README URL is configured but the fetch failed — distinguish from "no README yet" so owners know the source is broken, not missing. */}}
{{ icon "alert-triangle" "size-12 text-warning mx-auto" }}

We couldn't load the README

The configured README source didn't respond. It may be rate-limited or private.

{{ if .IsOwner }} {{ end }}
{{ else }} {{ if .IsOwner }}
{{ icon "file-text" "size-12 text-base-content/40 mx-auto" }}

No README provided

Add a README to help users understand this image.

{{ else }}
{{ icon "file-text" "size-12 text-base-content/40 mx-auto" }}

No README provided

Image metadata is shown above.

{{ end }} {{ end }}
{{ if .SelectedTag }} {{ if eq .ArtifactType "helm-chart" }} {{ else }} {{ end }} {{ end }}
{{ end }}