67 lines
2.2 kB
1
{{define "repoContent"}}
2
<main>
3
<div class="tree">
4
{{ $containerstyle := "py-1" }}
5
{{ $linkstyle := "no-underline hover:underline" }}
6
7
<div class="pb-2 text-base">
8
<div class="flex justify-between">
9
<div id="breadcrumbs">
10
{{ range .BreadCrumbs }}
11
<a href="{{ index . 1}}" class="text-bold text-gray-500 {{ $linkstyle }}">{{ index . 0 }}</a> /
12
{{ end }}
13
</div>
14
<div id="dir-info">
15
<span class="text-gray-500 text-xs">
16
{{ $stats := .TreeStats }}
17
18
{{ if eq $stats.NumFolders 1 }}
19
{{ $stats.NumFolders }} folder
20
·
21
{{ else if gt $stats.NumFolders 1 }}
22
{{ $stats.NumFolders }} folders
23
·
24
{{ end }}
25
26
{{ if eq $stats.NumFiles 1 }}
27
{{ $stats.NumFiles }} file
28
{{ else if gt $stats.NumFiles 1 }}
29
{{ $stats.NumFiles }} files
30
{{ end }}
31
</span>
32
</div>
33
</div>
34
</div>
35
36
{{ range .Files }}
37
{{ if not .IsFile }}
38
<div class="{{ $containerstyle }}">
39
<div class="flex justify-between items-center">
40
<a href="/{{ $.BaseTreeLink }}/{{ .Name }}" class="{{ $linkstyle }}">
41
<div class="flex items-center gap-2">
42
<i class="w-3 h-3 fill-current" data-lucide="folder"></i>{{ .Name }}
43
</div>
44
</a>
45
<time class="text-xs text-gray-500">{{ timeFmt .LastCommit.Author.When }}</time>
46
</div>
47
</div>
48
{{ end }}
49
{{ end }}
50
51
{{ range .Files }}
52
{{ if .IsFile }}
53
<div class="{{ $containerstyle }}">
54
<div class="flex justify-between items-center">
55
<a href="/{{ $.BaseBlobLink }}/{{ .Name }}" class="{{ $linkstyle }}">
56
<div class="flex items-center gap-2">
57
<i class="w-3 h-3" data-lucide="file"></i>{{ .Name }}
58
</div>
59
</a>
60
<time class="text-xs text-gray-500">{{ timeFmt .LastCommit.Author.When }}</time>
61
</div>
62
</div>
63
{{ end }}
64
{{ end }}
65
</div>
66
</main>
67
{{end}}
68