{{ define "repo/fragments/pipelineStatusSymbol" }}
{{ block "icon" $ }} {{ end }} {{ block "tooltip" $ }} {{ end }}
{{ end }} {{ define "icon" }}
{{ $c := .Counts }} {{ $statuses := .Statuses }} {{ $total := len $statuses }} {{ $success := index $c "success" }} {{ $allPass := eq $success $total }} {{ if $allPass }}
{{ i "check" "size-4 text-green-600 dark:text-green-400 " }} {{ $total }}/{{ $total }}
{{ else }} {{ $radius := f64 8 }} {{ $circumference := mulf64 2.0 (mulf64 3.1416 $radius) }} {{ $offset := 0.0 }}
{{ range $kind, $count := $c }} {{ $color := "" }} {{ if or (eq $kind "pending") (eq $kind "running") }} {{ $color = "#eab308" }} {{ else if eq $kind "success" }} {{ $color = "#10b981" }} {{ else if eq $kind "cancelled" }} {{ $color = "#6b7280" }} {{ else }} {{ $color = "#ef4444" }} {{ end }} {{ $percent := divf64 (f64 $count) (f64 $total) }} {{ $length := mulf64 $percent $circumference }} {{ $offset = addf64 $offset $length }} {{ end }} {{$success}}/{{ $total }}
{{ end }}
{{ end }} {{ define "tooltip" }} {{ end }}