{{ define "repo-card" }} {{/* Repository card component - displays a repository as a clickable card Expects: db.RepoCardData struct with fields: - OwnerHandle: string - Repository owner's handle - OwnerAvatarURL: string (optional) - Owner's profile avatar URL (fallback when no repo icon) - Repository: string - Repository name - Title: string (optional) - Display title - Description: string (optional) - Repository description - IconURL: string (optional) - Repository icon URL - StarCount: int - Number of stars - PullCount: int - Number of pulls - ArtifactType: string - container-image, helm-chart, unknown - Tag: string (optional) - Latest tag name - Digest: string (optional) - Latest manifest digest - LastUpdated: time.Time (optional) - Last push time - RegistryURL: string - Registry URL for docker commands (e.g., "atcr.io") */}}
{{ if .IconURL }} {{ else if .OwnerAvatarURL }} {{ else }}
{{ firstChar .Repository }}
{{ end }}
{{ .OwnerHandle }} {{ .Repository }}
{{ if .Tag }} Tag: {{ .Tag }} {{ end }}
{{ if .Description }}

{{ .Description }}

{{ end }}
{{ if eq .ArtifactType "helm-chart" }} {{ if .Tag }} {{ template "image-ref" (dict "Display" (printf "%s/%s/%s:%s" .RegistryURL .OwnerHandle .Repository .Tag) "Copy" (printf "helm pull oci://%s/%s/%s --version %s" .RegistryURL .OwnerHandle .Repository .Tag)) }} {{ else }} {{ template "image-ref" (dict "Display" (printf "%s/%s/%s" .RegistryURL .OwnerHandle .Repository) "Copy" (printf "helm pull oci://%s/%s/%s" .RegistryURL .OwnerHandle .Repository)) }} {{ end }} {{ else }} {{ if .Tag }} {{ template "image-ref" (dict "Display" (printf "%s/%s/%s:%s" .RegistryURL .OwnerHandle .Repository .Tag) "Copy" (printf "%s%s/%s/%s:%s" (pullPrefix .OciClient) .RegistryURL .OwnerHandle .Repository .Tag)) }} {{ else }} {{ template "image-ref" (dict "Display" (printf "%s/%s/%s" .RegistryURL .OwnerHandle .Repository) "Copy" (printf "%s%s/%s/%s" (pullPrefix .OciClient) .RegistryURL .OwnerHandle .Repository)) }} {{ end }} {{ end }}
{{ template "star" (dict "IsStarred" .IsStarred "StarCount" .StarCount) }} {{ template "pull-count" (dict "PullCount" .PullCount) }} {{ if eq .ArtifactType "helm-chart" }} {{ icon "helm" "size-5 text-helm" }} Helm chart {{ end }}
{{ if not .LastUpdated.IsZero }} {{ icon "history" "size-4" }}{{ timeAgoShort .LastUpdated }} {{ end }}
{{ end }}