mugit/web/templates/repo_tree.html(view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
{{ define "repo_tree" }}
{{ $name := .RepoName }}
{{ $ref := .P.Ref }}
<html>
<head>
{{ template "head" . }}
<title>{{ $name }}: tree ({{ $ref }})</title>
</head>
<body>
{{ template "repo_header" . }}
<main>
{{ $parent := .P.ParentPath }}
<table class="table tree">
<thead>
<tr class="nohover">
<th class="mode nowrap">mode</th>
<th class="size nowrap">size</th>
<th class="fill">name</th>
</tr>
</thead>
<tbody>
{{ if $parent }}
<tr>
<td class="mode nowrap"></td>
<td class="size nowrap"></td>
<td class="fill"><a href="/{{ $name }}/tree/{{ $ref }}/{{ .P.DotDot }}">..</a></td>
</tr>
{{ end }}
{{ range .P.Tree }}
{{ if not .IsFile }}
<tr>
<td class="mode nowrap">{{ .Mode }}</td>
<td class="size nowrap">{{ .Size }}</td>
<td class="fill">
{{ if $parent }}
<a href="/{{ $name}}/tree/{{ $ref }}/{{ $parent }}/{{ .Name }}">{{ .Name }}/</a>
{{ else }}
<a href="/{{ $name }}/tree/{{ $ref }}/{{ .Name }}">{{ .Name }}/</a>
{{ end }}
</td>
</tr>
{{ end }}
{{ end }}
{{ range .P.Tree }}
{{ if .IsFile }}
<tr>
<td class="mode nowrap">{{ .Mode }}</td>
<td class="size nowrap">{{ .Size }}</td>
<td class="fill">
{{ if $parent }}
<a href="/{{ $name }}/blob/{{ $ref }}/{{ $parent }}/{{ .Name }}">{{ .Name }}</a>
{{ else }}
<a href="/{{ $name }}/blob/{{ $ref }}/{{ .Name }}">{{ .Name }}</a>
{{ end }}
</td>
</tr>
{{ end }}
{{ end }}
</tbody>
</table>
<article>
<pre>{{- if .P.Readme }}{{ .P.Readme }}{{- end -}}</pre>
</article>
</main>
</body>
</html>
{{ end }}
|