{{ 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 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 }}