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/release_attach.html +63

@@ -0,0 +1,63 @@
1 {{define "release_attach"}}
2 {{template "header" .}}
3 {{template "repohead" (nav .Page "releases")}}
4
5 <div class="page-head">
6 <div class="page-head-main">
7 <h1>Attach files to {{.Tag}}</h1>
8 <p class="page-sub">{{if .Artifacts}}{{len .Artifacts}} file(s) attached · {{end}}A file keeps its name, or the directory you name below becomes its prefix.</p>
9 </div>
10 <div class="page-head-actions">
11 <a class="button secondary" href="/{{.Name}}/releases/{{esc .Tag}}">Back to release</a>
12 </div>
13 </div>
14
15 {{if .Error}}<div class="flash bad">{{.Error}}</div>{{end}}
16
17 {{if .Locked}}
18 <div class="empty-state">
19 <p>This release cannot take new files until the condition above changes.</p>
20 <p><a class="button secondary" href="/{{.Name}}/releases/{{esc .Tag}}">Back to release</a></p>
21 </div>
22 {{else}}
23 <form method="post" action="/{{.Name}}/releases/{{esc .Tag}}/attach" enctype="multipart/form-data" class="form-block">
24 <input type="hidden" name="csrf" value="{{.CSRF}}">
25 <div class="card form-card">
26 <label>Files
27 <input type="file" name="files" multiple required>
28 </label>
29 <label>or a directory
30 <input type="file" name="files" multiple webkitdirectory>
31 </label>
32 <label>Publish under (optional directory)
33 <input type="text" name="path" placeholder="apt" autocomplete="off">
34 </label>
35 </div>
36 <p class="muted">A file is attached under its name, or under the directory you name
37 above. A browser upload is limited to {{bytes .UploadCap}}; attach a larger set with
38 <code>vole release attach {{.Tag}} dist/*</code>.</p>
39 <div class="form-actions">
40 <button type="submit">{{icon "tag"}}Attach files</button>
41 </div>
42 </form>
43 {{end}}
44
45 {{if .Artifacts}}
46 <div class="card">
47 <h2>Attached files</h2>
48 <table>
49 <tr><th>File</th><th>Size</th><th>SHA-256</th><th></th></tr>
50 {{range .Artifacts}}
51 <tr>
52 <td><a href="/{{$.Name}}/releases/{{esc $.Tag}}/artifacts/{{.Name}}">{{.Name}}</a></td>
53 <td class="muted">{{bytes .Size}}</td>
54 <td class="muted"><code>{{short .OID}}</code></td>
55 <td><a href="/{{$.Name}}/releases/{{esc $.Tag}}/files/edit?path={{urlquery .Name}}">edit</a></td>
56 </tr>
57 {{end}}
58 </table>
59 </div>
60 {{end}}
61
62 {{template "footer" .}}
63 {{end}}