Add CSV upload for references
This commit is contained in:
parent
b426020a76
commit
46f2a303dc
2 changed files with 143 additions and 1 deletions
33
index.html
33
index.html
|
|
@ -51,7 +51,8 @@
|
|||
<!-- ── Bulk edit popover ─────────────────────────────────────── -->
|
||||
<div id="bulk-edit-popover" hidden>
|
||||
<button id="btn-open-bulk-refs">📎 Bulk Edit References</button>
|
||||
<button id="btn-upload-csv">📂 Upload from CSV</button>
|
||||
<button id="btn-upload-csv">📂 Upload Tunes from CSV</button>
|
||||
<button id="btn-upload-refs-csv">🔗 Upload References from CSV</button>
|
||||
</div>
|
||||
|
||||
<!-- ── Bulk edit references modal ───────────────────────────── -->
|
||||
|
|
@ -255,6 +256,36 @@
|
|||
</div>
|
||||
</dialog>
|
||||
|
||||
<!-- ── References CSV upload modal ───────────────────────────── -->
|
||||
<dialog id="upload-refs-csv-modal">
|
||||
<h2>Upload References from CSV</h2>
|
||||
<details id="refs-csv-format-details" open>
|
||||
<summary>Expected format</summary>
|
||||
<p style="font-size:.85rem;margin:.5rem 0 .4rem">One reference per row. Tune matched by name — must already exist.</p>
|
||||
<table class="csv-format-table">
|
||||
<thead><tr><th>Column</th><th>Required</th><th>Notes</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>tune_name</td><td>Yes</td><td>Must match an existing tune (case-insensitive)</td></tr>
|
||||
<tr><td>link</td><td></td><td>URL</td></tr>
|
||||
<tr><td>site</td><td></td><td>Site name — created if new</td></tr>
|
||||
<tr><td>musician1</td><td></td><td>Musician name — created if new</td></tr>
|
||||
<tr><td>musician2</td><td></td><td></td></tr>
|
||||
<tr><td>musician3</td><td></td><td></td></tr>
|
||||
<tr><td>musician4</td><td></td><td></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="csv-format-note">Rows where the tune name is not found are skipped with a warning in the results.</p>
|
||||
</details>
|
||||
<div id="refs-csv-upload-area">
|
||||
<input type="file" id="refs-csv-file-input" accept=".csv,.tsv,text/csv" />
|
||||
</div>
|
||||
<div id="refs-csv-results" hidden></div>
|
||||
<div class="modal-actions">
|
||||
<button id="btn-refs-csv-import" disabled>Import</button>
|
||||
<button id="btn-refs-csv-cancel">Cancel</button>
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
<!-- Tooltip for truncated mobile text -->
|
||||
<div id="mob-tooltip" hidden></div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue