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 72 73 74 75 |
{{ 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="nowrap">name</th>
<th class="fill">last commit</th>
<th class="nowrap">last update</th>
</tr>
</thead>
<tbody>
{{ if $parent }}
<tr>
<td class="nowrap"><a href="/{{ $name }}/tree/{{ urlencode $ref }}/{{ .P.DotDot }}">..</a></td>
<th class="fill"></th>
<th class="nowrap"></th>
</tr>
{{ end }}
{{ range .P.Tree }}
{{ if not .IsFile }}
<tr>
<td class="nowrap">
{{ if $parent }}<a href="/{{ $name}}/tree/{{ urlencode $ref }}/{{ $parent }}/{{ .Name }}">{{ .Name }}/</a>
{{ else }}<a href="/{{ $name }}/tree/{{ urlencode $ref }}/{{ .Name }}">{{ .Name }}/</a>{{ end }}
</td>
<td class="fill">
<a href="/{{ $name }}/commit/{{ .Commit.Hash }}">{{ commitSummary .Commit.Message }}</a>
</td>
<td class="age nowrap">
<a href="/{{ $.RepoName }}/commit/{{ .Commit.Hash }}">{{ humanizeRelTime .Commit.Committed }}</a>
<span class="tooltip" role="tooltip">{{ humanizeTime .Commit.Committed }}</span>
</td>
</tr>
{{ end }}
{{ end }}
{{ range .P.Tree }}
{{ if .IsFile }}
<tr>
<td class="nowrap">
{{ if $parent }}<a href="/{{ $name }}/blob/{{ urlencode $ref }}/{{ $parent }}/{{ .Name }}">{{ .Name }}</a>
{{ else }}<a href="/{{ $name }}/blob/{{ urlencode $ref }}/{{ .Name }}">{{ .Name }}</a>{{ end }}
</td>
<td class="fill">
<a href="/{{ $.RepoName }}/commit/{{ .Commit.Hash }}">{{ commitSummary .Commit.Message }}</a>
</td>
<td class="age nowrap">
<a href="/{{ $.RepoName }}/commit/{{ .Commit.Hash }}">{{ humanizeRelTime .Commit.Committed }}</a>
<span class="tooltip" role="tooltip">{{ humanizeTime .Commit.Committed }}</span>
</td>
</tr>
{{ end }}
{{ end }}
</tbody>
</table>
{{- if and .P.Readme .P.ParentPath -}}
<article class="readme">{{- .P.Readme -}}</article>
{{- end -}}
</main>
</body>
</html>
{{ end }}
|