aboutsummaryrefslogtreecommitdiff
path: root/templates/tree.html
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2024-07-27 08:00:00 +0800
committerRunxi Yu <me@runxiyu.org>2024-07-27 08:00:00 +0800
commit7386392b8cd08e73e4f5fa6080e8f4fcf20831f6 (patch)
tree73330ee296f398b7720312a942bc9d524ece9857 /templates/tree.html
parenttemplates/file.html: Remove line numbers (diff)
downloadlegitrx-7386392b8cd08e73e4f5fa6080e8f4fcf20831f6.tar.gz
legitrx-7386392b8cd08e73e4f5fa6080e8f4fcf20831f6.tar.zst
legitrx-7386392b8cd08e73e4f5fa6080e8f4fcf20831f6.zip
Some more HTML sanities
Diffstat (limited to '')
-rw-r--r--templates/tree.html55
1 files changed, 24 insertions, 31 deletions
diff --git a/templates/tree.html b/templates/tree.html
index 6e48dc1..6634a5c 100644
--- a/templates/tree.html
+++ b/templates/tree.html
@@ -1,54 +1,47 @@
{{ define "tree" }}
<!DOCTYPE html>
<html>
-
-{{ template "head" . }}
-
- {{ template "repoheader" . }}
+ {{ template "head" . }}
<body>
+ {{ template "repoheader" . }}
{{ template "nav" . }}
<main>
{{ $repo := .name }}
{{ $ref := .ref }}
{{ $parent := .parent }}
-
<div class="tree">
{{ if $parent }}
- <div></div>
- <div></div>
- <div><a href="/{{ $repo }}/tree/{{ $ref }}/{{ .dotdot }}">..</a></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>
- {{ if $parent }}
- <a href="/{{ $repo }}/tree/{{ $ref }}/{{ $parent }}/{{ .Name }}">{{ .Name }}/</a>
- {{ else }}
- <a href="/{{ $repo }}/tree/{{ $ref }}/{{ .Name }}">{{ .Name }}/</a>
+ {{ if not .IsFile }}
+ <div class="mode">{{ .Mode }}</div>
+ <div class="size">{{ .Size }}</div>
+ <div>
+ {{ if $parent }}
+ <a href="/{{ $repo }}/tree/{{ $ref }}/{{ $parent }}/{{ .Name }}">{{ .Name }}/</a>
+ {{ else }}
+ <a href="/{{ $repo }}/tree/{{ $ref }}/{{ .Name }}">{{ .Name }}/</a>
+ {{ end }}
+ </div>
{{ end }}
- </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>
+ {{ 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 }}
+ </div>
{{ end }}
- </div>
- {{ end }}
{{ end }}
</div>
<article>
- <pre>
- {{- if .readme }}{{ .readme }}{{- end -}}
- </pre>
+ <pre>{{- if .readme }}{{ .readme }}{{- end -}}</pre>
</article>
</main>
</body>