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