Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

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 files from the CLI and browser

c51874492382d08085b6388cea898d0d60ab9375 · Keenan Nemetz · 17d ago · parent 214e7ea6

Manage release files from the CLI and browser

Move the attach form to its own page, add move/remove operations to the CLI and browser, and simplify the release detail page to notes, files, and source links.

server/web/templates/releases.html +9−33

@@ -55,7 +55,7 @@
55 55 <td class="muted">{{if .Tagger}}{{.Tagger}}{{else}}—{{end}}</td>
56 56 <td class="muted">{{since .When}}</td>
57 57 <td><a href="/{{$.Name}}/releases/{{esc .Name}}/archive.tar">tar</a> · <a href="/{{$.Name}}/releases/{{esc .Name}}/archive.tar.gz">tar.gz</a></td>
58 {{if $.AnyEditable}}<td>{{if index $.Editable .Name}}<a href="/{{$.Name}}/releases/edit?tag={{urlquery .Name}}">edit notes</a>{{end}}</td>{{end}}
58 {{if $.AnyEditable}}<td>{{if index $.Editable .Name}}<a href="/{{$.Name}}/releases/edit?tag={{urlquery .Name}}">edit</a>{{end}}</td>{{end}}
59 59 </tr>
60 60 {{end}}
61 61 </table>
@@ -89,7 +89,10 @@ records a tagger and a message, which is what makes a tag a release.</p>
89 89 {{if .Channels}}<p class="page-sub">Channel{{if gt (len .Channels) 1}}s{{end}}:
90 90 {{range $i, $c := .Channels}}{{if $i}} · {{end}}<a href="/{{$.Name}}/channels/{{$c}}">{{$c}}</a>{{end}}</p>{{end}}
91 91 </div>
92 {{if .CanEdit}}<div class="page-head-actions"><a class="button secondary" href="/{{.Name}}/releases/edit?tag={{urlquery .Tag.Name}}">{{icon "sliders-horizontal"}}Edit notes</a></div>{{end}}
92 {{if or .CanEdit .CanAttach}}<div class="page-head-actions">
93 {{if .CanEdit}}<a class="button secondary" href="/{{.Name}}/releases/edit?tag={{urlquery .Tag.Name}}">{{icon "sliders-horizontal"}}Edit release</a>{{end}}
94 {{if .CanAttach}}<a class="button secondary" href="/{{.Name}}/releases/{{esc .Tag.Name}}/attach">{{icon "tag"}}Attach files</a>{{end}}
95 </div>{{end}}
93 96 </div>
94 97
95 98 {{if .Notes}}
@@ -101,7 +104,7 @@ records a tagger and a message, which is what makes a tag a release.</p>
101 104 {{end}}
102 105
103 106 <div class="card">
104 <h2>Artifacts</h2>
107 <h2>Files</h2>
105 108 {{if .Artifacts}}
106 109 <table>
107 110 <tr><th>File</th><th>Size</th><th>SHA-256</th><th></th></tr>
@@ -110,36 +113,14 @@ records a tagger and a message, which is what makes a tag a release.</p>
110 113 <td><a href="/{{$.Name}}/releases/{{esc $.Tag.Name}}/artifacts/{{.Name}}">{{.Name}}</a></td>
111 114 <td class="muted">{{bytes .Size}}</td>
112 115 <td class="muted"><code>{{short .OID}}</code></td>
113 <td><a href="/{{$.Name}}/releases/{{esc $.Tag.Name}}/artifacts/{{.Name}}">download</a></td>
116 <td><a href="/{{$.Name}}/releases/{{esc $.Tag.Name}}/artifacts/{{.Name}}">download</a>{{if $.CanAttach}} · <a href="/{{$.Name}}/releases/{{esc $.Tag.Name}}/files/edit?path={{urlquery .Name}}">edit</a>{{end}}</td>
114 117 </tr>
115 118 {{end}}
116 119 </table>
117 <p class="muted">Bytes live once in the instance's content-addressed store, so the same
118 file on two releases costs one copy.</p>
119 120 {{else}}
120 <p class="muted">No artifacts attached yet. Attach them here, or push the tag first and run
121 <code>vole release attach {{.Tag.Name}} dist/*</code>.</p>
121 <p class="muted">No files attached yet.{{if .CanAttach}} <a href="/{{.Name}}/releases/{{esc .Tag.Name}}/attach">Attach files</a>.{{end}}</p>
122 122 {{end}}
123 {{if .CanAttach}}
124 <form method="post" action="/{{.Name}}/releases/{{esc .Tag.Name}}/attach" enctype="multipart/form-data" class="form-block">
125 <input type="hidden" name="csrf" value="{{.CSRF}}">
126 <label>Files
127 <input type="file" name="files" multiple required>
128 </label>
129 <label>or a directory
130 <input type="file" name="files" multiple webkitdirectory>
131 </label>
132 <label>Publish under (optional directory)
133 <input type="text" name="path" placeholder="apt" autocomplete="off">
134 </label>
135 <div class="form-actions">
136 <button type="submit">{{icon "tag"}}Attach files</button>
137 </div>
138 <p class="muted">A file is attached under its name, or under the directory you name
139 above. A browser upload is limited to {{bytes .UploadCap}}; attach a larger set with
140 <code>vole release attach</code>.</p>
141 </form>
142 {{else if .ChannelLocked}}
123 {{if .ChannelLocked}}
143 124 <p class="muted">A channel targets this release, so its notes and files are fixed.
144 125 Point the channel at another release to edit this one.</p>
145 126 {{end}}
@@ -149,15 +130,10 @@ records a tagger and a message, which is what makes a tag a release.</p>
149 130 <h2>Source</h2>
150 131 <p><a href="/{{.Name}}/releases/{{esc .Tag.Name}}/archive.tar">Download .tar</a>
151 132 · <a href="/{{.Name}}/releases/{{esc .Tag.Name}}/archive.tar.gz">Download .tar.gz</a></p>
152 <p class="muted">Generated from the tag when you ask for it, not stored — the same bytes on
153 every request, so a cached copy cannot go stale.</p>
154 133 {{if .LFSPointers}}<p class="muted">This repository tracks files with Git LFS: those files appear
155 134 in the tarball as pointer files, not their contents. Clone with <code>git lfs</code> for the
156 135 real bytes.</p>{{end}}
157 136 </div>
158 137
159 <h2>{{if .Prev}}{{.Count}} commit(s) since {{.Prev}}{{else}}{{.Count}} commit(s){{end}}</h2>
160 <div class="panel">{{template "commitlist" .}}</div>
161 {{if .Capped}}<p class="muted">Showing the first {{.CappedAt}}; the rest are in the history.</p>{{end}}
162 138 {{template "footer" .}}
163 139 {{end}}