Skip to main content

max / makenotwork

5.0 KB · 103 lines History Blame Raw
1 {#- The upload machine, and only that: the versions table above it is described
2 (`crate::quasi::item_files`). This is the bespoke region that panel mounts,
3 which is where markup driven by client-side state belongs -- a queue, a
4 progress bar, a speed readout, a cancel, a retry and an error surface, all
5 of it `static/item-upload.js`.
6
7 The wrapper keeps its own id and `data-item-id`: the script reads them, and
8 a described region carries no host dataset.
9
10 Whether this region can be described was counted on 2026-08-30 and the
11 answer is written down in `crate::quasi::item_files`, "Can the uploader move
12 to the description layer?". Short version: the progress surface and the
13 success/error surfaces need no new vocabulary and are the host's to draw
14 already, and the one shape that is missing is a queue of picked files with a
15 field per row. `quasi_router::Repeating` is the near miss and its own docs
16 rule it out; the answer is a ruling in `quasi-router` and `makeover-layout`
17 rather than a change here. -#}
18 <div class="version-upload" id="version-upload" data-item-id="{{ item.id }}">
19
20 <!-- New Version Form -->
21 <div id="new-version-form">
22 <div class="item-version-upload-grid">
23 <div class="form-group">
24 <label for="new-version-number">Version Number</label>
25 <input type="text" id="new-version-number" placeholder="e.g., 1.0">
26 </div>
27 <div class="form-group">
28 <label for="version-changelog">Notes (optional)</label>
29 <input type="text" id="version-changelog" placeholder="What changed in this version...">
30 </div>
31 </div>
32
33 <div class="form-group">
34 <label>Files</label>
35 <div class="upload-hint item-version-upload-hint">Add one file per platform. Each gets its own label (e.g. "macOS (arm)", "Linux (x86_64)").</div>
36
37 <table class="item-version-upload-file-table" id="version-file-table">
38 <thead>
39 <tr>
40 <th>File</th>
41 <th>Label</th>
42 <th></th>
43 </tr>
44 </thead>
45 <tbody id="version-file-rows"></tbody>
46 </table>
47
48 {#- What the queue takes and how many of them is described, not
49 written out here: `crate::quasi::upload_field::version_queue`.
50 It carries no destination on purpose, because nothing is sent
51 until Upload All names the version. -#}
52 <div class="item-version-upload-add-row" id="version-file-picker">
53 {{ crate::quasi::upload_field::version_queue()|safe }}
54 </div>
55 </div>
56
57 <button class="btn-primary" id="create-version-btn">Upload All</button>
58 </div>
59
60 {#- One described field per version that has no file yet. Each carries its
61 own address, so picking a file uploads it to that version and nothing
62 has to remember which button was pressed.
63
64 Shown rather than revealed. The reveal was an "Upload File" button in
65 the version's table row that unhid the panel here, and a described cell
66 holds leaves and acts rather than a region to unhide. See
67 `crate::quasi::item_files`, "What the reveal dance cost". -#}
68 {% for version in versions %}{% if !version.has_file %}
69 {#- `data-upload-goes` rather than `data-upload-refreshes`: that one names a
70 control to click, and it named the tab *button* `#tab-files`, which the
71 described strip (`6b24f2df`) stopped emitting. The item's audio upload
72 already lands here the same way. -#}
73 <div class="existing-version-upload" id="existing-version-upload-{{ version.id }}"
74 data-upload-goes="/dashboard/item/{{ item.id }}?tab=files">
75 <label>Add a file to v{{ version.number }}</label>
76 {{ crate::quasi::upload_field::existing_version(version.id.as_str())|safe }}
77 </div>
78 {% endif %}{% endfor %}
79
80 <!-- Shared upload progress/status (outside both forms so always visible) -->
81 <div class="upload-progress hidden" id="version-upload-progress">
82 <div class="item-version-upload-queue" id="version-upload-queue"></div>
83 <div class="progress-info">
84 <span id="version-upload-filename">filename.zip</span>
85 <span id="version-upload-percent">0%</span>
86 </div>
87 <div class="progress-bar-container">
88 <div class="progress-bar" id="version-progress-bar"></div>
89 </div>
90 <div class="item-version-upload-speed" id="version-upload-speed"></div>
91 <button type="button" class="btn-secondary" id="cancel-version-upload-btn">Cancel</button>
92 </div>
93
94 <div class="upload-success hidden" id="version-upload-success">
95 <span>Upload complete.</span>
96 </div>
97
98 <div class="upload-error hidden" id="version-upload-error">
99 <span class="error-message" id="version-error-message"></span>
100 <button type="button" class="btn-secondary" id="retry-version-upload-btn">Try Again</button>
101 </div>
102 </div>
103