{{ define "user/fragments/repoCard" }} {{/* root, repo, fullName [,starButton [,starData]] */}} {{ $root := index . 0 }} {{ $repo := index . 1 }} {{ $fullName := index . 2 }} {{ $starButton := false }} {{ $starData := dict }} {{ if gt (len .) 3 }} {{ $starButton = index . 3 }} {{ if gt (len .) 4 }} {{ $starData = index . 4 }} {{ end }} {{ end }} {{ with $repo }}
{{ if .Source }} {{ i "git-fork" "w-4 h-4 mr-1.5 shrink-0" }} {{ else }} {{ i "book-marked" "w-4 h-4 mr-1.5 shrink-0" }} {{ end }} {{ $repoOwner := resolve .Did }} {{- if $fullName -}} {{ $repoOwner }}/{{ .Name }} {{- else -}} {{ .Name }} {{- end -}}
{{ if and $starButton $root.LoggedInUser }}
{{ template "fragments/starBtn" $starData }}
{{ end }}
{{ with .Description }}
{{ . | description }}
{{ end }} {{ if .RepoStats }} {{ block "repoStats" .RepoStats }}{{ end }} {{ 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" }} {{ . }}
{{ end }} {{ with .IssueCount.Open }}
{{ i "circle-dot" "w-3 h-3" }} {{ . }}
{{ end }} {{ with .PullCount.Open }}
{{ i "git-pull-request" "w-3 h-3" }} {{ . }}
{{ end }}
{{ end }}