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