vanity/router/templates/index.tmpl

29 lines
778 B
Cheetah
Raw Normal View History

{{template "head.tmpl" .}}
<h3>{{if eq .Format "list"}}Imports{{else}}Topics{{end}}:</h3>
{{if eq .Format "list"}}
<ul>
{{range $path, $package := .Packages}}
<li><a href="{{$package.Name}}">{{$package.Name}}</a></li>
{{end}}
</ul>
{{else}}
{{range $topic, $packages := .Packages.Topics}}
<details>
<summary>{{$topic}}</summary>
<ul>
{{range $package := $packages}}
<li><a href="{{$package.Name}}">{{$package.Name}}</a></li>
{{end}}
</ul>
</details>
{{end}}
{{end}}
<br/>
<form method="get">
{{if eq .Format "list"}}
<button type="submit" name="format" value="topics">See Topics</button>
{{else}}
<button type="submit" name="format" value="list"> See List</button>
{{end}}
</form>
{{template "foot.tmpl" .}}