{{ define "pull-command-switcher" }} {{/* Pull command with inline OCI client switcher. Expects dict with: RegistryURL, OwnerHandle, RepoName, Tag, ArtifactType, OciClient, IsLoggedIn For helm charts, shows helm command only (no switcher). For container images, shows a client dropdown that updates the command. Logged-in users: saves to profile via HTMX POST. Anonymous users: saves to localStorage. */}} {{ if eq .ArtifactType "helm-chart" }} {{/* Helm chart: small install/pull toggle. JS in app.js wires the switcher and persists the choice in localStorage. Default = install. */}} {{ $versionFlag := "" }} {{ if .Tag }}{{ $versionFlag = print " --version " .Tag }}{{ end }} {{ $ociRef := print "oci://" .RegistryURL "/" .OwnerHandle "/" .RepoName }}
{{ template "docker-command" (print "helm install " .RepoName " " $ociRef $versionFlag) }}
{{ else }}
{{ if .Tag }} {{ template "docker-command" (print (pullPrefix .OciClient) .RegistryURL "/" .OwnerHandle "/" .RepoName ":" .Tag) }} {{ else }} {{ template "docker-command" (print (pullPrefix .OciClient) .RegistryURL "/" .OwnerHandle "/" .RepoName ":latest") }} {{ end }}
{{ end }} {{ end }}