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