mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
refactor: session-based incremental TFE upload via HTMX, drop SortableJS
Replace the client-side FileArray + Sortable drag-to-reorder with a
server-side session-based upload flow:
- New endpoints: /partage/upload-tfe-file, /partage/remove-tfe-file
(and /admin/ variants) — single-file incremental upload via HTMX
multipart/form-data with progress bar support
- Session storage: uploaded files go to STORAGE_ROOT/uploads/{session_id}/
with metadata in $_SESSION['tfe_uploads']
- file-upload-queue.js reduced to single-file previews only (couverture,
note_intention, annexes thumbnails)
- ThesisFileHandler gains handleTfeFilesFromSession + writeTfeFileFromSrc
+ cleanupSessionUploads for final commit from session temp
- Sortable.min.js removed from all script tags; drag handles and ghost
CSS removed
- No file_orders[]/file_labels[] hidden field injection needed
- Upload queue survives page refresh (server-owned list)
This eliminates the SortableJS dependency entirely while keeping the
same UX: pick files, see them in a queue, remove individual files.
This commit is contained in:
@@ -555,7 +555,8 @@
|
||||
border-color: var(--accent-primary);
|
||||
}
|
||||
|
||||
.sortable-list {
|
||||
/* New-file queue items */
|
||||
.tfe-file-queue {
|
||||
list-style: none;
|
||||
margin: var(--space-2xs) 0 0;
|
||||
padding: 0;
|
||||
@@ -565,11 +566,6 @@
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
/* New-file queue items */
|
||||
.tfe-file-queue {
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.tfe-queue-empty {
|
||||
font-size: var(--step--2);
|
||||
color: var(--text-tertiary);
|
||||
@@ -591,28 +587,6 @@
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.fq-drag-handle,
|
||||
.admin-file-drag-handle {
|
||||
cursor: grab;
|
||||
color: var(--text-tertiary);
|
||||
font-size: 1.1rem;
|
||||
line-height: 1;
|
||||
padding: 0 var(--space-3xs);
|
||||
flex-shrink: 0;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.fq-drag-handle:active,
|
||||
.admin-file-drag-handle:active {
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
.fq-ghost,
|
||||
.sortable-ghost {
|
||||
opacity: 0.4;
|
||||
background: var(--accent-muted, #f0f0f0);
|
||||
}
|
||||
|
||||
.fq-icon {
|
||||
font-size: 1.3rem;
|
||||
line-height: 1;
|
||||
|
||||
Reference in New Issue
Block a user