phase 1 backup - support for multi-file versioned upload
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
const autosaveStatus = document.getElementById('autosave-status');
|
||||
const csrf = getCookie('csrftoken');
|
||||
const csrfHeader = csrf ? { 'X-CSRFToken': csrf } : {};
|
||||
const FIELDS = ['title', 'summary', 'category', 'description', 'caption', 'version_name', 'changelog'];
|
||||
const FIELDS = ['title', 'summary', 'category', 'description', 'version_name', 'changelog'];
|
||||
|
||||
function setStatus(text, state) {
|
||||
autosaveStatus.innerHTML = text;
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
zones[kind] = {
|
||||
zone,
|
||||
kind,
|
||||
single: kind === 'thumbnail' || kind === 'version',
|
||||
single: kind === 'thumbnail',
|
||||
drop: zone.querySelector('.drop-zone'),
|
||||
input: zone.querySelector('input[type=file]'),
|
||||
preview: zone.querySelector('.upload-preview, #media-preview'),
|
||||
preview: zone.querySelector('.file-preview-grid, .upload-preview'),
|
||||
batch: zone.querySelector('.upload-batch'),
|
||||
current: null,
|
||||
busy: false,
|
||||
@@ -78,6 +78,15 @@
|
||||
name.textContent = upload.filename || '';
|
||||
card.appendChild(name);
|
||||
|
||||
if (z.kind === 'media') {
|
||||
const cap = document.createElement('input');
|
||||
cap.type = 'text';
|
||||
cap.className = 'file-caption';
|
||||
cap.name = 'caption_' + upload.uuid;
|
||||
cap.placeholder = 'caption…';
|
||||
card.appendChild(cap);
|
||||
}
|
||||
|
||||
if (upload.removable !== false) {
|
||||
const remove = document.createElement('button');
|
||||
remove.type = 'button';
|
||||
|
||||
Reference in New Issue
Block a user