diff options
Diffstat (limited to '')
-rw-r--r-- | templates/repo.html | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/templates/repo.html b/templates/repo.html index e388de3..3c99df5 100644 --- a/templates/repo.html +++ b/templates/repo.html @@ -9,13 +9,41 @@ <body> {{ template "nav" . }} <main> + {{ $repo := .name }} + {{ $ref := .ref }} + {{ $parent := .parent }} + + <table> + <tr> + <td></td> + <td><a href="../">..</a> + </tr> {{ range .files }} - {{ if .IsFile }} - <p>{{ .Mode }} {{ .Name }} {{ .Size }} </p> - {{ else }} - <p>d-------- {{ .Name}}/</p> - {{ end }} + {{ if .IsFile }} + <tr> + <td><code>{{ .Mode }}</code></td> + <td> + {{ if $parent }} + <a href="/{{ $repo }}/blob/{{ $ref }}/{{ $parent }}/{{ .Name }}">{{ .Name }}</a> + {{ else }} + <a href="/{{ $repo }}/blob/{{ $ref }}/{{ .Name }}">{{ .Name }}</a> + {{ end }} + </td> + </tr> + {{ else }} + <tr> + <td><code>{{ .Mode }}</code></td> + <td> + {{ if $parent }} + <a href="/{{ $repo }}/tree/{{ $ref }}/{{ $parent }}/{{ .Name }}">{{ .Name }}/</a> + {{ else }} + <a href="{{ $repo }}/tree/{{ $ref }}/{{ .Name }}">{{ .Name }}/</a> + {{ end }} + </td> + </tr> + {{ end }} {{ end }} + </table> </main> </body> </html> |