1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{{define "content" -}}
<h2>
<a href="/~{{.Repo.OwnerName}}/{{.Repo.Name}}">~{{.Repo.OwnerName}}/{{.Repo.Name}}</a>
· {{.Table}}
</h2>
<p class="text-muted">
<code>{{.Ref}}</code> · {{.Rows.Total}} rows
</p>
{{if .Rows.Columns}}
<div style="overflow-x: auto">
<table class="table table-sm">
<thead>
<tr>{{range .Rows.Columns}}<th>{{.}}</th>{{end}}</tr>
</thead>
<tbody>
{{range .Rows.Rows}}
<tr>{{range .}}<td>{{.}}</td>{{end}}</tr>
{{end}}
</tbody>
</table>
</div>
{{if not .Rows.Rows}}
<p class="text-muted">No rows on this page.</p>
{{end}}
{{else}}
<p class="text-muted">This table has no columns.</p>
{{end}}
<nav aria-label="rows pagination">
<ul class="pagination">
<li class="page-item {{if not .HasPrev}}disabled{{end}}">
<a class="page-link"
href="/~{{.Repo.OwnerName}}/{{.Repo.Name}}/table/{{.Ref | urlquery}}/{{.Table | urlquery}}?page={{dec .Page}}">
← Previous
</a>
</li>
<li class="page-item disabled"><span class="page-link">Page {{.Page}} of {{.TotalPages}}</span></li>
<li class="page-item {{if not .HasNext}}disabled{{end}}">
<a class="page-link"
href="/~{{.Repo.OwnerName}}/{{.Repo.Name}}/table/{{.Ref | urlquery}}/{{.Table | urlquery}}?page={{inc .Page}}">
Next →
</a>
</li>
</ul>
</nav>
{{- end}}