this repo has no description
at ci 2.5 kB view raw
1{{ define "user/fragments/repoCard" }} 2 {{/* root, repo, fullName [,starButton [,starData]] */}} 3 {{ $root := index . 0 }} 4 {{ $repo := index . 1 }} 5 {{ $fullName := index . 2 }} 6 {{ $starButton := false }} 7 {{ $starData := dict }} 8 {{ if gt (len .) 3 }} 9 {{ $starButton = index . 3 }} 10 {{ if gt (len .) 4 }} 11 {{ $starData = index . 4 }} 12 {{ end }} 13 {{ end }} 14 15 {{ with $repo }} 16 <div class="py-4 px-6 gap-1 flex flex-col drop-shadow-sm rounded bg-white dark:bg-gray-800 min-h-32"> 17 <div class="font-medium dark:text-white flex items-center justify-between"> 18 <div class="flex items-center min-w-0 flex-1 mr-2"> 19 {{ if .Source }} 20 {{ i "git-fork" "w-4 h-4 mr-1.5 shrink-0" }} 21 {{ else }} 22 {{ i "book-marked" "w-4 h-4 mr-1.5 shrink-0" }} 23 {{ end }} 24 {{ $repoOwner := resolve .Did }} 25 {{- if $fullName -}} 26 <a href="/{{ $repoOwner }}/{{ .Name }}" class="truncate min-w-0">{{ $repoOwner }}/{{ .Name }}</a> 27 {{- else -}} 28 <a href="/{{ $repoOwner }}/{{ .Name }}" class="truncate min-w-0">{{ .Name }}</a> 29 {{- end -}} 30 </div> 31 {{ if and $starButton $root.LoggedInUser }} 32 <div class="shrink-0"> 33 {{ template "fragments/starBtn" $starData }} 34 </div> 35 {{ end }} 36 </div> 37 {{ with .Description }} 38 <div class="text-gray-600 dark:text-gray-300 text-sm line-clamp-2"> 39 {{ . | description }} 40 </div> 41 {{ end }} 42 43 {{ if .RepoStats }} 44 {{ block "repoStats" .RepoStats }}{{ end }} 45 {{ end }} 46 </div> 47 {{ end }} 48{{ end }} 49 50{{ define "repoStats" }} 51 <div class="text-gray-400 text-sm font-mono inline-flex gap-4 mt-auto"> 52 {{ with .Language }} 53 <div class="flex gap-2 items-center text-sm"> 54 {{ template "repo/fragments/colorBall" (dict "color" (langColor .)) }} 55 <span>{{ . }}</span> 56 </div> 57 {{ end }} 58 {{ with .StarCount }} 59 <div class="flex gap-1 items-center text-sm"> 60 {{ i "star" "w-3 h-3 fill-current" }} 61 <span>{{ . }}</span> 62 </div> 63 {{ end }} 64 {{ with .IssueCount.Open }} 65 <div class="flex gap-1 items-center text-sm"> 66 {{ i "circle-dot" "w-3 h-3" }} 67 <span>{{ . }}</span> 68 </div> 69 {{ end }} 70 {{ with .PullCount.Open }} 71 <div class="flex gap-1 items-center text-sm"> 72 {{ i "git-pull-request" "w-3 h-3" }} 73 <span>{{ . }}</span> 74 </div> 75 {{ end }} 76 </div> 77{{ end }}