mugit/web/templates/index.html (view raw)
Oleksandr Smirnov
Oleksandr Smirnov
olexsmir@gmail.com ui: refactor how data is passed to pages, 3 months ago
olexsmir@gmail.com ui: refactor how data is passed to pages, 3 months ago
| 1 | {{ define "index" }} |
| 2 | <!DOCTYPE html> |
| 3 | <html> |
| 4 | <head> |
| 5 | {{ template "head" . }} |
| 6 | <title>{{ .Meta.Title }}</title> |
| 7 | </head> |
| 8 | <body> |
| 9 | <header> |
| 10 | <h1>{{ .Meta.Title }}</h1> |
| 11 | {{ if .Meta.Description }}<h2>{{ .Meta.Description }}</h2>{{ end }} |
| 12 | </header> |
| 13 | <main> |
| 14 | <table class="table index"> |
| 15 | <thead> |
| 16 | <tr class="nohover"> |
| 17 | <th class="nowrap">Name</th> |
| 18 | <th class="fill">Description</th> |
| 19 | <th class="nowrap">Last update</th> |
| 20 | </tr> |
| 21 | </thead> |
| 22 | <tbody> |
| 23 | {{- range .P }} |
| 24 | <tr> |
| 25 | <td class="nowrap"><a href="/{{ .Name }}">{{ .Name }}</a></td> |
| 26 | <td class="fill"> |
| 27 | <a href="/{{ .Name }}"> |
| 28 | {{- if .Desc }}{{- .Desc -}} |
| 29 | {{- else }}<span class="muted">No description set</span>{{- end -}} |
| 30 | </a> |
| 31 | <td class="nowrap"> |
| 32 | {{ if not .LastCommit.IsZero }} |
| 33 | <span class="age"> |
| 34 | {{- humanizeTime .LastCommit -}} |
| 35 | <span class="tooltip" role="tooltip">{{- .LastCommit -}}</span> |
| 36 | </span> |
| 37 | {{ else }} |
| 38 | <span class="muted">n/a</span> |
| 39 | {{ end }} |
| 40 | </td> |
| 41 | </tr> |
| 42 | {{ end }} |
| 43 | </tbody> |
| 44 | </table> |
| 45 | </main> |
| 46 | </body> |
| 47 | </html> |
| 48 | {{ end }} |