diff options
author | Derek Stevens <nilix@nilfm.cc> | 2023-02-01 23:01:36 -0700 |
---|---|---|
committer | Anirudh Oppiliappan <x@icyphox.sh> | 2023-02-08 00:30:57 +0530 |
commit | b78354aee2f0fef8552896d75e106c915365d3ef (patch) | |
tree | 5e772c82807d226dd4bc69c72f170849402941ae /templates/tree.html | |
parent | ee800624f58b26204c1f846a524ccef5a1b4e386 (diff) | |
download | legit-b78354aee2f0fef8552896d75e106c915365d3ef.tar.gz legit-b78354aee2f0fef8552896d75e106c915365d3ef.tar.bz2 legit-b78354aee2f0fef8552896d75e106c915365d3ef.zip |
tree: directories first, add size column, fix ..
Signed-off-by: Derek Stevens <nilix@nilfm.cc>
Diffstat (limited to 'templates/tree.html')
-rw-r--r-- | templates/tree.html | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/templates/tree.html b/templates/tree.html index 2880714..496dceb 100644 --- a/templates/tree.html +++ b/templates/tree.html @@ -18,26 +18,35 @@ <div class="tree"> {{ if $parent }} <div></div> - <div><a href="../">..</a></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> - {{ if .IsFile }} - {{ if $parent }} - <a href="/{{ $repo }}/blob/{{ $ref }}/{{ $parent }}/{{ .Name }}">{{ .Name }}</a> - {{ else }} - <a href="/{{ $repo }}/blob/{{ $ref }}/{{ .Name }}">{{ .Name }}</a> - {{ end }} - {{ else }} {{ if $parent }} <a href="/{{ $repo }}/tree/{{ $ref }}/{{ $parent }}/{{ .Name }}">{{ .Name }}/</a> {{ else }} <a href="/{{ $repo }}/tree/{{ $ref }}/{{ .Name }}">{{ .Name }}/</a> {{ 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> + {{ end }} </div> {{ end }} + {{ end }} </div> <article> <pre> |