vole
Site
Clone
Read only, no credentials:
https://rodent.software/vole.git
Write over SSH with a registered key:
git clone ssh://git@rodent.software/vole.git
Self-hosted forge that lives in your Git repo.
Keep channels above a paginated release list
77d3fde66af0594afabd4860317dbeb95d78558f · Keenan Nemetz · 15d ago · parent ef3a07d6
Keep channels above a paginated release list Channels are few and releases can run to hundreds, so the channel list now sits first and stays on every page while the tag list pages underneath it at the same 25 rows the issue, change, and run lists use. The pager keeps `?page=` on the releases URL, and the first page keeps the bare URL. The total is the tag count, so the lightweight note still describes the whole repository, and the editable column is decided from every tag rather than the current page so it does not disappear between pages. The regression test builds 31 tags and one channel, then checks both pages: the channel section stays above the releases, page one links to page two, and page two links back to the bare URL. Refs 01M7QSTRTDSAAH7MW0YC1G1TD3.
server/web/templates/releases.html +40−39
| @@ -2,6 +2,45 @@ | |||
| 2 | 2 | {{template "header" .}} | |
| 3 | 3 | {{template "repohead" (nav .Page "releases")}} | |
| 4 | 4 | ||
| 5 | <section id="channels" class="release-section"> | ||
| 6 | <div class="page-head"> | ||
| 7 | <div class="page-head-main"> | ||
| 8 | <h1>Channels</h1> | ||
| 9 | <p class="page-sub">A stable name for a release, so its files stay at one URL when the release moves.</p> | ||
| 10 | </div> | ||
| 11 | {{if .ManageChannels}}<div class="page-head-actions"> | ||
| 12 | <a class="button secondary" href="/{{.Name}}/releases/channels/new">{{icon "plus"}}New channel</a> | ||
| 13 | </div>{{end}} | ||
| 14 | </div> | ||
| 15 | {{if .Channels}} | ||
| 16 | <div class="panel"> | ||
| 17 | <table> | ||
| 18 | <tr><th>Channel</th><th>Release</th><th>Updated</th><th>Description</th>{{if .ManageChannels}}<th></th>{{end}}</tr> | ||
| 19 | {{range .Channels}} | ||
| 20 | <tr> | ||
| 21 | <td><a href="/{{$.Name}}/channels/{{.Name}}"><code>{{.Name}}</code></a></td> | ||
| 22 | <td>{{if .Dangling}}<span class="label">dangling</span> <span class="muted">{{.Release}}</span>{{else}}<a href="/{{$.Name}}/releases/{{esc .Target}}">{{.Target}}</a>{{end}}</td> | ||
| 23 | <td class="muted">{{if .UpdatedBy}}{{.UpdatedBy}} · {{end}}{{since .UpdatedAt.Unix}}</td> | ||
| 24 | <td class="md">{{.Body}}</td> | ||
| 25 | {{if $.ManageChannels}}<td class="muted"> | ||
| 26 | <a href="/{{$.Name}}/releases/channels/edit?channel={{urlquery .Name}}">edit</a> | ||
| 27 | <form method="post" action="/{{$.Name}}/channels/{{.Name}}/clear" class="inline" data-confirm="Clear the {{.Name}} channel? The release and its files stay."> | ||
| 28 | <input type="hidden" name="csrf" value="{{$.CSRF}}"> | ||
| 29 | <button class="link" type="submit">clear</button> | ||
| 30 | </form> | ||
| 31 | </td>{{end}} | ||
| 32 | </tr> | ||
| 33 | {{end}} | ||
| 34 | </table> | ||
| 35 | </div> | ||
| 36 | {{else}} | ||
| 37 | <div class="empty-state"> | ||
| 38 | <p>No channels yet.</p> | ||
| 39 | <p class="muted">A channel gives a release's files a URL that stays put.</p> | ||
| 40 | </div> | ||
| 41 | {{end}} | ||
| 42 | </section> | ||
| 43 | |||
| 5 | 44 | <section id="releases" class="release-section"> | |
| 6 | 45 | <div class="page-head"> | |
| 7 | 46 | <div class="page-head-main"> | |
| @@ -29,6 +68,7 @@ | |||
| 29 | 68 | {{end}} | |
| 30 | 69 | </table> | |
| 31 | 70 | </div> | |
| 71 | {{template "pager" .Pager}} | ||
| 32 | 72 | {{else}} | |
| 33 | 73 | <div class="empty-state"> | |
| 34 | 74 | <p>No releases yet.</p> | |
| @@ -42,45 +82,6 @@ git push --follow-tags</pre> | |||
| 42 | 82 | records a tagger and a message, which is what makes a tag a release.</p> | |
| 43 | 83 | {{end}} | |
| 44 | 84 | </section> | |
| 45 | |||
| 46 | <section id="channels" class="release-section"> | ||
| 47 | <div class="page-head"> | ||
| 48 | <div class="page-head-main"> | ||
| 49 | <h1>Channels</h1> | ||
| 50 | <p class="page-sub">A stable name for a release, so its files stay at one URL when the release moves.</p> | ||
| 51 | </div> | ||
| 52 | {{if .ManageChannels}}<div class="page-head-actions"> | ||
| 53 | <a class="button secondary" href="/{{.Name}}/releases/channels/new">{{icon "plus"}}New channel</a> | ||
| 54 | </div>{{end}} | ||
| 55 | </div> | ||
| 56 | {{if .Channels}} | ||
| 57 | <div class="panel"> | ||
| 58 | <table> | ||
| 59 | <tr><th>Channel</th><th>Release</th><th>Updated</th><th>Description</th>{{if .ManageChannels}}<th></th>{{end}}</tr> | ||
| 60 | {{range .Channels}} | ||
| 61 | <tr> | ||
| 62 | <td><a href="/{{$.Name}}/channels/{{.Name}}"><code>{{.Name}}</code></a></td> | ||
| 63 | <td>{{if .Dangling}}<span class="label">dangling</span> <span class="muted">{{.Release}}</span>{{else}}<a href="/{{$.Name}}/releases/{{esc .Target}}">{{.Target}}</a>{{end}}</td> | ||
| 64 | <td class="muted">{{if .UpdatedBy}}{{.UpdatedBy}} · {{end}}{{since .UpdatedAt.Unix}}</td> | ||
| 65 | <td class="md">{{.Body}}</td> | ||
| 66 | {{if $.ManageChannels}}<td class="muted"> | ||
| 67 | <a href="/{{$.Name}}/releases/channels/edit?channel={{urlquery .Name}}">edit</a> | ||
| 68 | <form method="post" action="/{{$.Name}}/channels/{{.Name}}/clear" class="inline" data-confirm="Clear the {{.Name}} channel? The release and its files stay."> | ||
| 69 | <input type="hidden" name="csrf" value="{{$.CSRF}}"> | ||
| 70 | <button class="link" type="submit">clear</button> | ||
| 71 | </form> | ||
| 72 | </td>{{end}} | ||
| 73 | </tr> | ||
| 74 | {{end}} | ||
| 75 | </table> | ||
| 76 | </div> | ||
| 77 | {{else}} | ||
| 78 | <div class="empty-state"> | ||
| 79 | <p>No channels yet.</p> | ||
| 80 | <p class="muted">A channel gives a release's files a URL that stays put.</p> | ||
| 81 | </div> | ||
| 82 | {{end}} | ||
| 83 | </section> | ||
| 84 | 85 | {{template "footer" .}} | |
| 85 | 86 | {{end}} | |
| 86 | 87 | ||