aboutsummaryrefslogtreecommitdiff
path: root/templates/tree.html
blob: ebdcaf9fb8bcc7d52a2c8668bcfda73a03607da5 (plain) (blame)
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
{{ define "tree" }}
<!DOCTYPE html>
<html>
{{ template "head" . }}
	<body>
		<main id="legitrx">
			{{ template "repoheader" . }}
			{{ template "reponav" . }}
			<div class="content">
				<table summary="tree listing" class="list">
					<tr class="nohover">
						<th class="left">Mode</th>
						<th class="left">Name</th>
						<th class="right">Size</th>
						<th />
					</tr>
					{{ $repo := .name }}
					{{ $ref := .ref }}
					{{ $parent := .parent }}
					{{ if $parent }}
					<tr>
						<td class="ls-mode">d---------</td>
						<td><a class="ls-blob" href="/{{ $repo }}/tree/{{ $ref }}/{{ .dotdot }}">..</a></td>
						<td class="ls-size">TODO</td>
						<td>
							TODO
							<a class="button" href="">log</a><a class="button" href="">stats</a>
							<a class="button" href="">plain</a>
							
						</td>
					</tr>
					{{ end }}
					{{ range .files }}
					<tr>
						<td class="ls-mode">{{ .Mode }}</td>
	                                        {{ if $parent }}
						{{ if .IsFile }}
						<td><a class="ls-blob" href="/{{ $repo }}/blob/{{ $ref }}/{{ $parent }}/{{ .Name }}">{{ .Name }}</a></td>
						{{ else }}
						<td><a class="ls-blob" href="/{{ $repo }}/tree/{{ $ref }}/{{ $parent }}/{{ .Name }}">{{ .Name }}/</a></td>
						{{ end }}
	                                        {{ else }}
						{{ if .IsFile }}
						<td><a class="ls-blob" href="/{{ $repo }}/blob/{{ $ref }}/{{ .Name }}">{{ .Name }}</a></td>
						{{ else }}
						<td><a class="ls-blob" href="/{{ $repo }}/tree/{{ $ref }}/{{ .Name }}">{{ .Name }}/</a></td>
						{{ end }}
	                                        {{ end }}
						<td class="ls-size">{{ .Size }}</td>
						<td>
							TODO (& blame)
						</td>
					</tr>
					{{ end }}
				</table>
			</div>
			{{ template "foot" . }}
		</main>
	</body>
</html>
{{ end }}