legit/templates/tree.html

57 lines
1.3 KiB
HTML
Raw Normal View History

2022-12-17 16:03:04 +00:00
{{ define "tree" }}
<html>
2023-02-18 08:46:43 +00:00
2022-12-17 16:03:04 +00:00
{{ template "head" . }}
2024-02-20 00:24:38 +00:00
{{ template "repoheader" . }}
2022-12-17 16:03:04 +00:00
2024-02-20 00:24:38 +00:00
<body>
{{ template "nav" . }}
<main>
{{ $repo := .repo }}
{{ $ref := .ref }}
{{ $parent := .parent }}
<div class="tree">
{{ if $parent }}
<div></div>
<div></div>
<div><a href="/{{ $repo }}/tree/{{ $ref }}/{{ .dotdot }}">..</a></div>
{{ end }}
{{ range .files }}
{{ if not .IsFile }}
<div class="mode">{{ .Mode }}</div>
<div class="size">{{ .Size }}</div>
<div>
2022-12-17 16:03:04 +00:00
{{ if $parent }}
2024-02-20 00:24:38 +00:00
<a href="/{{ $repo }}/tree/{{ $ref }}/{{ $parent }}/{{ .Name }}">{{ .Name }}/</a>
{{ else }}
<a href="/{{ $repo }}/tree/{{ $ref }}/{{ .Name }}">{{ .Name }}/</a>
2022-12-17 16:03:04 +00:00
{{ end }}
2024-02-20 00:24:38 +00:00
</div>
{{ end }}
{{ end }}
{{ range .files }}
{{ if .IsFile }}
<div class="mode">{{ .Mode }}</div>
<div class="size">{{ .Size }}</div>
<div>
{{ if $parent }}
<a href="/{{ $repo }}/blob/{{ $ref }}/{{ $parent }}/{{ .Name }}">{{ .Name }}</a>
{{ else }}
<a href="/{{ $repo }}/blob/{{ $ref }}/{{ .Name }}">{{ .Name }}</a>
{{ end }}
2022-12-17 16:03:04 +00:00
</div>
2024-02-20 00:24:38 +00:00
{{ end }}
{{ end }}
</div>
<article>
<pre>
{{- if .readme }}{{ .readme }}{{- end -}}
</pre>
</article>
</main>
</body>
2022-12-17 16:03:04 +00:00
</html>
2024-02-20 00:24:38 +00:00
{{ end }}