{{ define "user/fragments/repoCard" }} {{/* root, repo, fullName [,starButton [,starData{IsStarred,SubjectAt,StarCount,RepoName} [,compact [,cardLink]]]] */}} {{ $root := index . 0 }} {{ $repo := index . 1 }} {{ $fullName := index . 2 }} {{ $starButton := false }} {{ $starData := dict }} {{ $compact := false }} {{ $cardLink := false }} {{ if gt (len .) 3 }} {{ $starButton = index . 3 }} {{ if gt (len .) 4 }} {{ $starData = index . 4 }} {{ if gt (len .) 5 }} {{ $compact = index . 5 }} {{ if gt (len .) 6 }} {{ $cardLink = index . 6 }} {{ end }} {{ end }} {{ end }} {{ end }} {{ with $repo }} {{ $repoOwner := resolve .Did }} {{ if $cardLink }} {{ else }}
{{ end }}
{{ if and $starButton $root.LoggedInUser }}
{{ template "fragments/starBtn" $starData }}
{{ end }}
{{ with .Description }}
{{ . | description }}
{{ end }} {{ if .RepoStats }} {{ block "repoStats" .RepoStats }}{{ end }} {{ end }} {{ if $cardLink }} {{ else }}
{{ end }} {{ end }} {{ end }} {{ define "repoStats" }}
{{ with .Language }}
{{ template "repo/fragments/colorBall" (dict "color" (langColor .)) }} {{ . }}
{{ end }} {{ with .StarCount }}
{{ i "star" "w-3 h-3 fill-current" }} {{ scaleFmt . }}
{{ end }} {{ with .ForkCount }}
{{ i "git-fork" "w-3 h-3" }} {{ scaleFmt . }}
{{ end }} {{ with .IssueCount.Open }}
{{ i "circle-dot" "w-3 h-3" }} {{ scaleFmt . }}
{{ end }} {{ with .PullCount.Open }}
{{ i "git-pull-request" "w-3 h-3" }} {{ scaleFmt . }}
{{ end }}
{{ end }}