| 1 | {{/* /documents: everything stored, moved off the front page (Paul, |
| 2 | 2026-10-29). Adding lives at /add; a failed delete lands here. */}} |
| 3 | {{define "content"}} |
| 4 | {{if .Notices}}<div rst-callout rst-tone="warning" rst-withheld><div rst-callout-body>{{range .Notices}}<p>{{.}}</p>{{end}}</div></div>{{end}} |
| 5 | {{if .Flash}}<div rst-callout rst-tone="{{.FlashKind | tone}}"{{if eq .FlashKind "danger"}} role="alert"{{end}}><div rst-callout-body><p>{{.Flash}}</p></div></div>{{end}} |
| 6 | |
| 7 | <section rst-stack> |
| 8 | {{if .Partial}}{{template "partial" .}}{{else}}<div rst-section-head> |
| 9 | <h1>{{len .Documents}} document{{if ne (len .Documents) 1}}s{{end}}</h1> |
| 10 | <a rst-btn="primary" href="/add">Add content</a> |
| 11 | </div> |
| 12 | {{if not .Documents}} |
| 13 | <p rst-muted>Nothing stored yet.</p> |
| 14 | {{else}} |
| 15 | {{/* The title column takes the spare width; every other column is as |
| 16 | narrow as its content and never wraps — a date broken over four |
| 17 | lines by a long title was the first thing Paul saw (2026-10-26). */}} |
| 18 | <table rst-table rst-docs> |
| 19 | <thead><tr><th>Title</th><th>Source</th><th rst-num>Passages</th><th>Updated</th><th></th></tr></thead> |
| 20 | <tbody> |
| 21 | {{range .Documents}} |
| 22 | {{/* The whole row opens the document (Paul, 2026-10-31): the title's |
| 23 | link stretches over the row, and Delete sits above it. */}} |
| 24 | <tr rst-click-row> |
| 25 | <td><a href="/documents/{{.ID}}" rst-click-link>{{.Title}}</a></td> |
| 26 | <td rst-muted>{{.Source | sourceName}}</td> |
| 27 | <td rst-muted rst-num>{{.Chunks}}</td> |
| 28 | <td rst-muted><time datetime="{{.UpdatedISO}}" title="{{.Updated}}">{{.UpdatedDay}}</time></td> |
| 29 | {{/* Delete asks first (delete.html): a link to the question, not |
| 30 | a one-click POST. */}} |
| 31 | {{/* Only memoria's own documents can be deleted here; another app's |
| 32 | is deleted in that app (§4.2). */}} |
| 33 | <td>{{if not .Sibling}}<a rst-btn="quiet compact" href="/documents/{{.ID}}/delete">Delete</a>{{end}}</td> |
| 34 | </tr> |
| 35 | {{end}} |
| 36 | </tbody> |
| 37 | </table> |
| 38 | {{end}}{{end}} |
| 39 | </section> |
| 40 | {{end}} |
| 41 | |