oficina / sheets Public

Clone
git clone https://amadan.net/oficina/sheets

Plain git — no account needed to clone.

Download

Download this file

1{{define "content"}}
2<header rst-page-header>
3<div rst-page-header-titles>
4<h1>{{.Data.Sheet.Title}}</h1>
5<p rst-page-header-sub>Shared with you as a read-only link.</p>
6</div>
7</header>
8
9{{if .Data.CanComment}}
10{{template "callout" (dict "Body" "You can comment on this sheet once you sign in. Reading needs no account; anything you write is attributed, and that is what an account is for." "Tone" "info")}}
11{{end}}
12
13<div style="overflow-x:auto">
14<table data-cell-table>
15<caption class="rst-sr-only">{{.Data.Sheet.Title}}, page {{.Data.Page}} of {{.Data.Pages}}</caption>
16<thead>
17<tr>
18<th scope="col"><span class="rst-sr-only">Row</span></th>
19{{range .Data.Cols}}<th scope="col">{{.}}</th>{{end}}
20</tr>
21</thead>
22<tbody>
23{{range .Data.Rows}}
24<tr>
25<th scope="row">{{.Number}}</th>
26{{/* No edit form and no link to one. The handler passes a row and
27 column that cannot match any cell, so .Editing is false
28 everywhere — read-only expressed in the data rather than trusted
29 to this template. */}}
30{{/* data-kind carries the same numeric flag the editable table uses, so
31 a link viewer gets the same right-aligned numbers. The cells here
32 are plain <td> rather than anchors — there is nothing to edit — and
33 with no anchor there is nothing to keep an empty cell open, so the
34 &nbsp; stays on this view and only on this view. */}}
35{{range .Cells}}<td{{if .Number}} data-kind="number"{{end}}{{if .Raw}} title="{{.Raw}}"{{end}}>{{if .Display}}{{.Display}}{{else}}&nbsp;{{end}}</td>{{end}}
36</tr>
37{{end}}
38</tbody>
39</table>
40</div>
41
42<nav rst-pagination aria-label="Rows">
43{{if .Data.HasPrev}}
44<a href="/l/{{.Data.Token}}?page={{.Data.PrevPage}}">Previous rows</a>
45{{else}}<span rst-pagination-disabled>Previous rows</span>{{end}}
46<span>Page {{.Data.Page}} of {{.Data.Pages}}</span>
47{{if .Data.HasNext}}
48<a href="/l/{{.Data.Token}}?page={{.Data.NextPage}}">Next rows</a>
49{{else}}<span rst-pagination-disabled>Next rows</span>{{end}}
50</nav>
51{{end}}
52