vole
Clone
Read only, no credentials:
https://rodent.software/vole.git
Write over SSH with a registered key:
git clone ssh://git@rodent.software:2222/vole.git
A free and open-source forge that lives in your Git repo.
Add repository search, list pagination, and theme/a11y polish
5cab7b18548e5263c01549cb61415fd7777d1758 · Keenan Nemetz · 15d ago · parent 0b26547e
Add repository search, list pagination, and theme/a11y polish The chrome and the index page search repository names and descriptions after the same read filter, so a private repository cannot appear. Issues and changes paginate at 25 rows with filters and HTMX navigation preserved. Polish from the UI plan: a light token block follows prefers-color-scheme, a skip link and focus-visible outlines help keyboard users, panels scroll horizontally on narrow screens, and the empty index/search states explain what is visible. Also fixes a flaky key assertion in the admin users test.
server/web/templates/home.html +29−4
| @@ -1,19 +1,44 @@ | |||
| 1 | 1 | {{define "index"}} | |
| 2 | 2 | {{template "header" .}} | |
| 3 | <h1>Repositories</h1> | ||
| 3 | <div class="page-head"> | ||
| 4 | <div class="page-head-main"> | ||
| 5 | <h1>Repositories</h1> | ||
| 6 | <p class="page-sub">{{if .Query}}Matches for “{{.Query}}”{{else}}Every repository you can read{{end}}</p> | ||
| 7 | </div> | ||
| 8 | </div> | ||
| 9 | |||
| 10 | <form class="filters" method="get" action="/" role="search"> | ||
| 11 | <input type="search" name="q" value="{{.Query}}" placeholder="Search repositories" aria-label="Search repositories"> | ||
| 12 | <button type="submit">{{icon "search"}}Search</button> | ||
| 13 | {{if .Query}}<a href="/">clear</a>{{end}} | ||
| 14 | </form> | ||
| 15 | |||
| 4 | 16 | {{if .Repos}} | |
| 17 | <div class="panel"> | ||
| 5 | 18 | <table> | |
| 6 | <tr><th>Name</th><th>Description</th><th>Created</th></tr> | ||
| 19 | <thead><tr><th>Name</th><th>Description</th><th>Created</th></tr></thead> | ||
| 20 | <tbody> | ||
| 7 | 21 | {{range .Repos}} | |
| 8 | 22 | <tr> | |
| 9 | 23 | <td><a href="/r/{{.Name}}">{{.Name}}</a></td> | |
| 10 | 24 | <td class="muted">{{.Description}}</td> | |
| 11 | <td class="muted">{{since .Created.Unix}}</td> | ||
| 25 | <td class="muted nowrap">{{since .Created.Unix}}</td> | ||
| 12 | 26 | </tr> | |
| 13 | 27 | {{end}} | |
| 28 | </tbody> | ||
| 14 | 29 | </table> | |
| 30 | </div> | ||
| 31 | {{else if .Query}} | ||
| 32 | <div class="empty-state"> | ||
| 33 | <p>No repositories match “{{.Query}}”.</p> | ||
| 34 | <p class="muted">Search looks at repository names and descriptions. Private repositories you cannot read are not included.</p> | ||
| 35 | <a href="/">Clear the search</a> | ||
| 36 | </div> | ||
| 15 | 37 | {{else}} | |
| 16 | <p class="muted">No public repositories.</p> | ||
| 38 | <div class="empty-state"> | ||
| 39 | <p>No repositories yet.</p> | ||
| 40 | <p class="muted">An instance admin can create one.{{if .InstanceAdmin}} <a href="/admin/repos/new">Create a repository</a>.{{end}}</p> | ||
| 41 | </div> | ||
| 17 | 42 | {{end}} | |
| 18 | 43 | {{template "footer" .}} | |
| 19 | 44 | {{end}} | |