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.
Manage release channels from the releases page
de72893e35f2fe73bb1741b88dcbabdfb238c8b0 · Keenan Nemetz · 17d ago · parent 529a8457
Manage release channels from the releases page Channels no longer have a separate listing page. Releases shows the channel list, a badge on each target release, and a maintainer form that creates, moves, and clears channels with the same validation and audit record as the CLI.
server/web/templates/releases.html +58−3
| @@ -5,20 +5,75 @@ | |||
| 5 | 5 | <div class="page-head"> | |
| 6 | 6 | <div class="page-head-main"> | |
| 7 | 7 | <h1>Releases</h1> | |
| 8 | <p class="page-sub">{{if .Tags}}{{len .Tags}} tag(s){{if .Lightweight}} · {{.Lightweight}} lightweight{{end}}{{else}}Tags with notes, artifacts, and archives.{{end}}</p> | ||
| 9 | <p class="muted"><a href="/{{.Name}}/channels">Channels</a> — stable names for the release they currently point at.</p> | ||
| 8 | <p class="page-sub">{{if .Tags}}{{len .Tags}} tag(s){{if .Lightweight}} · {{.Lightweight}} lightweight{{end}}{{else}}Tags with notes, artifacts, and archives.{{end}}{{if .Channels}} · {{len .Channels}} channel(s){{end}}</p> | ||
| 10 | 9 | </div> | |
| 11 | 10 | {{if .CanManage}}<div class="page-head-actions"><a class="button" href="/{{.Name}}/releases/new">{{icon "plus"}}New release</a></div>{{end}} | |
| 12 | 11 | </div> | |
| 13 | 12 | ||
| 13 | {{if or .Channels .ManageChannels}} | ||
| 14 | <div class="card" id="channels"> | ||
| 15 | <h2>Channels</h2> | ||
| 16 | <p class="muted">A channel is a stable name for the release it currently points at. | ||
| 17 | Its URL serves that release's attached files.</p> | ||
| 18 | {{if .Channels}} | ||
| 19 | <table> | ||
| 20 | <tr><th>Channel</th><th>Release</th><th>Updated</th><th>Description</th>{{if .ManageChannels}}<th></th>{{end}}</tr> | ||
| 21 | {{range .Channels}} | ||
| 22 | <tr> | ||
| 23 | <td><a href="/{{$.Name}}/channels/{{.Name}}"><code>{{.Name}}</code></a></td> | ||
| 24 | <td>{{if .Dangling}}<span class="label">dangling</span> <span class="muted">{{.Release}}</span>{{else}}<a href="/{{$.Name}}/releases/{{esc .Target}}">{{.Target}}</a>{{end}}</td> | ||
| 25 | <td class="muted">{{if .UpdatedBy}}{{.UpdatedBy}} · {{end}}{{since .UpdatedAt.Unix}}</td> | ||
| 26 | <td class="md">{{.Body}}</td> | ||
| 27 | {{if $.ManageChannels}}<td class="muted"> | ||
| 28 | <a href="/{{$.Name}}/releases?channel={{urlquery .Name}}#channel-form">edit</a> | ||
| 29 | <form method="post" action="/{{$.Name}}/channels/{{.Name}}/clear" class="inline" data-confirm="Clear the {{.Name}} channel? The release and its files stay."> | ||
| 30 | <input type="hidden" name="csrf" value="{{$.CSRF}}"> | ||
| 31 | <button class="link" type="submit">clear</button> | ||
| 32 | </form> | ||
| 33 | </td>{{end}} | ||
| 34 | </tr> | ||
| 35 | {{end}} | ||
| 36 | </table> | ||
| 37 | {{else}} | ||
| 38 | <p class="muted">No channels yet.</p> | ||
| 39 | {{end}} | ||
| 40 | |||
| 41 | {{if .ManageChannels}} | ||
| 42 | <h3 id="channel-form">{{if .ChannelForm.Editing}}Edit channel {{.ChannelForm.Name}}{{else}}New channel{{end}}</h3> | ||
| 43 | {{if .ChannelForm.Error}}<div class="flash bad">{{.ChannelForm.Error}}</div>{{end}} | ||
| 44 | <form method="post" action="/{{.Name}}/channels" class="form-block"> | ||
| 45 | <input type="hidden" name="csrf" value="{{.CSRF}}"> | ||
| 46 | {{if .ChannelForm.Editing}}<input type="hidden" name="editing" value="1">{{end}} | ||
| 47 | <div class="form-card"> | ||
| 48 | <label>Name | ||
| 49 | <input type="text" name="channel" value="{{.ChannelForm.Name}}" {{if .ChannelForm.Editing}}readonly{{else}}required pattern="[a-z0-9][a-z0-9-]*" maxlength="32" placeholder="stable" autocomplete="off"{{end}}> | ||
| 50 | </label> | ||
| 51 | <label>Release | ||
| 52 | <input type="text" name="tag" value="{{.ChannelForm.Tag}}" required list="channel-tags" placeholder="v1.0.0" autocomplete="off"> | ||
| 53 | <datalist id="channel-tags">{{range .Tags}}{{if .Annotated}}<option value="{{.Name}}">{{end}}{{end}}</datalist> | ||
| 54 | </label> | ||
| 55 | <label>Description | ||
| 56 | <textarea name="description" rows="2" maxlength="8192" placeholder="Optional note shown on this page.">{{.ChannelForm.Description}}</textarea> | ||
| 57 | </label> | ||
| 58 | </div> | ||
| 59 | <div class="form-actions"> | ||
| 60 | {{if .ChannelForm.Editing}}<a class="button secondary" href="/{{.Name}}/releases#channels">Cancel</a>{{end}} | ||
| 61 | <button type="submit">{{icon "tag"}}{{if .ChannelForm.Editing}}Save channel{{else}}Create channel{{end}}</button> | ||
| 62 | </div> | ||
| 63 | </form> | ||
| 64 | {{end}} | ||
| 65 | </div> | ||
| 66 | {{end}} | ||
| 67 | |||
| 14 | 68 | {{if .Tags}} | |
| 15 | 69 | <div class="panel"> | |
| 16 | 70 | <table> | |
| 17 | <tr><th>Tag</th><th>Notes</th><th>Tagger</th><th>Age</th><th>Source</th>{{if .CanManage}}<th></th>{{end}}</tr> | ||
| 71 | <tr><th>Tag</th><th>Notes</th>{{if .Channels}}<th>Channels</th>{{end}}<th>Tagger</th><th>Age</th><th>Source</th>{{if .CanManage}}<th></th>{{end}}</tr> | ||
| 18 | 72 | {{range .Tags}} | |
| 19 | 73 | <tr> | |
| 20 | 74 | <td><a href="/{{$.Name}}/releases/{{esc .Name}}">{{.Name}}</a>{{if not .Annotated}} <span class="label">lightweight</span>{{end}}</td> | |
| 21 | 75 | <td class="muted">{{.Subject}}</td> | |
| 76 | {{if $.Channels}}<td class="label-row">{{range $c := index $.ChannelsByTag .Name}}<a class="label" href="/{{$.Name}}/channels/{{$c}}">{{$c}}</a>{{end}}</td>{{end}} | ||
| 22 | 77 | <td class="muted">{{if .Tagger}}{{.Tagger}}{{else}}—{{end}}</td> | |
| 23 | 78 | <td class="muted">{{since .When}}</td> | |
| 24 | 79 | <td><a href="/{{$.Name}}/releases/{{esc .Name}}/archive.tar">tar</a> · <a href="/{{$.Name}}/releases/{{esc .Name}}/archive.tar.gz">tar.gz</a></td> | |