mugit/web/templates/repo_file.html (view raw)
Oleksandr Smirnov
Oleksandr Smirnov
olexsmir@gmail.com fix formatting in some of the templates , 3 months ago
olexsmir@gmail.com fix formatting in some of the templates , 3 months ago
| 1 | {{ define "repo_file" }} |
| 2 | <html> |
| 3 | <head> |
| 4 | {{ template "head" . }} |
| 5 | <title>{{ .name }}: {{ .path }} ({{ .ref }})</title> |
| 6 | </head> |
| 7 | <body> |
| 8 | {{ template "repo_header" . }} |
| 9 | <main> |
| 10 | <p>{{ .path }} (<a class="muted" href="?raw=true">view raw</a>)</p> |
| 11 | <div class="file-wrapper"> |
| 12 | {{ if .is_image }} |
| 13 | <div class="image-viewer"> |
| 14 | <p>{{.mime_type}} • {{.size}} bytes</p> |
| 15 | <img src="?raw=true" alt="{{- .path -}}"> |
| 16 | </div> |
| 17 | {{ else if .is_binary }} |
| 18 | <div class="binary-viewer"> |
| 19 | <p>Binary file ({{.mime_type}})</p> |
| 20 | <p>Size: {{.size}} bytes</p> |
| 21 | <a class="link" href="?raw=true" download>[ Download ]</a> |
| 22 | </div> |
| 23 | {{ else }} |
| 24 | <table> |
| 25 | <tbody><tr> |
| 26 | <td class="line-numbers"> |
| 27 | <pre>{{- range .linecount }} |
| 28 | <a id="L{{ . }}" href="#L{{ . }}">{{ . }}</a> |
| 29 | {{- end -}}</pre> |
| 30 | </td> |
| 31 | <td class="file-content"> |
| 32 | <pre>{{- .content -}}</pre> |
| 33 | </td> |
| 34 | </tbody></tr> |
| 35 | </table> |
| 36 | {{ end }} |
| 37 | </div> |
| 38 | </main> |
| 39 | </body> |
| 40 | </html> |
| 41 | {{ end }} |