Skip to main content

max / makenotwork

5.2 KB · 98 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 the address to land on when the run
8 finishes: the script reads both, and a described region carries no host
9 dataset. `data-upload-goes` is the same attribute the described uploads
10 already answer to (`static/upload.js`), so the surface names where it goes
11 once rather than the script rebuilding the URL from an item id.
12
13 Whether this region can be described was counted on 2026-08-30 and the
14 answer is written down in `crate::quasi::item_files`, "Can the uploader move
15 to the description layer?". Short version: the progress surface and the
16 success/error surfaces need no new vocabulary and are the host's to draw
17 already, and the one shape that is missing is a queue of picked files with a
18 field per row. `quasi_router::Repeating` is the near miss and its own docs
19 rule it out; the answer is a ruling in `quasi-router` and `makeover-layout`
20 rather than a change here. -#}
21 <div class="version-upload" id="version-upload"
22 data-upload-goes="/dashboard/item/{{ item.id }}?tab=files">
23
24 <!-- New Version Form -->
25 <div id="new-version-form">
26 {#- The version number and the notes beside it, described:
27 `crate::quasi::upload_field::version_details`. The grid is this
28 template's, because two questions sitting in two columns is a fact
29 about this panel and not about either question. -#}
30 <div class="item-version-upload-grid">
31 {{ crate::quasi::upload_field::version_details()|safe }}
32 </div>
33
34 {#- What the queue takes, how many of them, and the help beside it is
35 described: `crate::quasi::upload_field::version_queue`. It carries
36 no destination on purpose, because nothing is sent until Upload All
37 names the version.
38
39 The picker sits above the rows it fills rather than below them,
40 which is also the order the described field's own label reads in. -#}
41 {{ crate::quasi::upload_field::version_queue()|safe }}
42
43 {#- A slot per picked file, each named by its file and asking for the
44 label that names its platform:
45 `crate::quasi::upload_field::version_file_queue`. The slots come
46 from the picker above, which is why no add control is drawn. -#}
47 {{ crate::quasi::upload_field::version_file_queue()|safe }}
48
49 {#- Where the run begins and that it waits:
50 `crate::quasi::upload_field::version_upload_all`. The host makes
51 the calls, so the script finds this control by the address it
52 carries rather than by an id. -#}
53 {{ crate::quasi::upload_field::version_upload_all(item.id.as_str())|safe }}
54 </div>
55
56 {#- One described field per version that has no file yet. Each carries its
57 own address, so picking a file uploads it to that version and nothing
58 has to remember which button was pressed.
59
60 Shown rather than revealed. The reveal was an "Upload File" button in
61 the version's table row that unhid the panel here, and a described cell
62 holds leaves and acts rather than a region to unhide. See
63 `crate::quasi::item_files`, "What the reveal dance cost". -#}
64 {% for version in versions %}{% if !version.has_file %}
65 {#- `data-upload-goes` rather than `data-upload-refreshes`: that one names a
66 control to click, and it named the tab *button* `#tab-files`, which the
67 described strip (`6b24f2df`) stopped emitting. The item's audio upload
68 already lands here the same way. -#}
69 <div class="existing-version-upload" id="existing-version-upload-{{ version.id }}"
70 data-upload-goes="/dashboard/item/{{ item.id }}?tab=files">
71 <label>Add a file to v{{ version.number }}</label>
72 {{ crate::quasi::upload_field::existing_version(version.id.as_str())|safe }}
73 </div>
74 {% endif %}{% endfor %}
75
76 <!-- Shared upload progress/status (outside both forms so always visible) -->
77 <div class="upload-progress hidden" id="version-upload-progress">
78 <div class="progress-info">
79 <span id="version-upload-filename">filename.zip</span>
80 <span id="version-upload-percent">0%</span>
81 </div>
82 <div class="progress-bar-container">
83 <div class="progress-bar" id="version-progress-bar"></div>
84 </div>
85 <div class="item-version-upload-speed" id="version-upload-speed"></div>
86 <button type="button" class="btn-secondary" id="cancel-version-upload-btn">Cancel</button>
87 </div>
88
89 <div class="upload-success hidden" id="version-upload-success">
90 <span>Upload complete.</span>
91 </div>
92
93 <div class="upload-error hidden" id="version-upload-error">
94 <span class="error-message" id="version-error-message"></span>
95 <button type="button" class="btn-secondary" id="retry-version-upload-btn">Try Again</button>
96 </div>
97 </div>
98