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