mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
feat: file browser + relink for orphaned files + htmx fix + header cleanup + fix relinked FilePond integration + resolve acces.php conflict markers
This commit is contained in:
@@ -88,7 +88,11 @@ $websiteLabel = htmlspecialchars($_POST['website_label'] ?? '');
|
||||
<button type="button" class="btn btn--sm btn--ghost file-browser-trigger"
|
||||
data-queue-type="cover"
|
||||
data-thesis-id="<?= htmlspecialchars((string)($thesisId ?? $_GET['id'] ?? '')) ?>"
|
||||
onclick="XamxamOpenFileBrowser(this)">
|
||||
hx-get="/admin/fragments/file-browser.php"
|
||||
hx-target="#relink-modal-body"
|
||||
hx-swap="innerHTML"
|
||||
hx-trigger="click"
|
||||
onclick="document.getElementById('relink-modal').showModal(); window.__xamxamRelinkCtx = { queueType: 'cover', thesisId: '<?= htmlspecialchars((string)($thesisId ?? $_GET['id'] ?? '')) ?>' };">
|
||||
📂 Relier un fichier existant
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
@@ -110,7 +114,11 @@ $websiteLabel = htmlspecialchars($_POST['website_label'] ?? '');
|
||||
<button type="button" class="btn btn--sm btn--ghost file-browser-trigger"
|
||||
data-queue-type="note_intention"
|
||||
data-thesis-id="<?= htmlspecialchars((string)($thesisId ?? $_GET['id'] ?? '')) ?>"
|
||||
onclick="XamxamOpenFileBrowser(this)">
|
||||
hx-get="/admin/fragments/file-browser.php"
|
||||
hx-target="#relink-modal-body"
|
||||
hx-swap="innerHTML"
|
||||
hx-trigger="click"
|
||||
onclick="document.getElementById('relink-modal').showModal(); window.__xamxamRelinkCtx = { queueType: 'note_intention', thesisId: '<?= htmlspecialchars((string)($thesisId ?? $_GET['id'] ?? '')) ?>' };">
|
||||
📂 Relier un fichier existant
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
@@ -142,7 +150,11 @@ $websiteLabel = htmlspecialchars($_POST['website_label'] ?? '');
|
||||
<button type="button" class="btn btn--sm btn--ghost file-browser-trigger"
|
||||
data-queue-type="tfe"
|
||||
data-thesis-id="<?= htmlspecialchars((string)($thesisId ?? $_GET['id'] ?? '')) ?>"
|
||||
onclick="XamxamOpenFileBrowser(this)">
|
||||
hx-get="/admin/fragments/file-browser.php"
|
||||
hx-target="#relink-modal-body"
|
||||
hx-swap="innerHTML"
|
||||
hx-trigger="click"
|
||||
onclick="document.getElementById('relink-modal').showModal(); window.__xamxamRelinkCtx = { queueType: 'tfe', thesisId: '<?= htmlspecialchars((string)($thesisId ?? $_GET['id'] ?? '')) ?>' };">
|
||||
📂 Relier un fichier existant
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
@@ -166,7 +178,11 @@ $websiteLabel = htmlspecialchars($_POST['website_label'] ?? '');
|
||||
<button type="button" class="btn btn--sm btn--ghost file-browser-trigger"
|
||||
data-queue-type="annexe"
|
||||
data-thesis-id="<?= htmlspecialchars((string)($thesisId ?? $_GET['id'] ?? '')) ?>"
|
||||
onclick="XamxamOpenFileBrowser(this)">
|
||||
hx-get="/admin/fragments/file-browser.php"
|
||||
hx-target="#relink-modal-body"
|
||||
hx-swap="innerHTML"
|
||||
hx-trigger="click"
|
||||
onclick="document.getElementById('relink-modal').showModal(); window.__xamxamRelinkCtx = { queueType: 'annexe', thesisId: '<?= htmlspecialchars((string)($thesisId ?? $_GET['id'] ?? '')) ?>' };">
|
||||
📂 Relier un fichier existant
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
@@ -189,16 +205,5 @@ $websiteLabel = htmlspecialchars($_POST['website_label'] ?? '');
|
||||
|
||||
<!-- ═══════════════════ File Browser Modal (edit mode only) ═══════════════════ -->
|
||||
<?php if ($editMode): ?>
|
||||
<dialog id="relink-modal" class="relink-modal">
|
||||
<div class="relink-modal-header">
|
||||
<h3>Relier un fichier existant</h3>
|
||||
<button type="button" class="btn btn--sm btn--ghost" onclick="document.getElementById('relink-modal').close()" aria-label="Fermer">✕</button>
|
||||
</div>
|
||||
<div id="relink-modal-body">
|
||||
<p class="file-browser-loading">Chargement du navigateur de fichiers…</p>
|
||||
</div>
|
||||
<div class="relink-modal-footer">
|
||||
<small>Seuls les fichiers déjà présents dans storage/documents/ ou storage/theses/ sont listés.</small>
|
||||
</div>
|
||||
</dialog>
|
||||
<?php include APP_ROOT . '/templates/partials/form/file-browser-fragment.php'; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
25
app/templates/partials/form/file-browser-fragment.php
Normal file
25
app/templates/partials/form/file-browser-fragment.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* file-browser-fragment.php
|
||||
*
|
||||
* Shared dialog modal for the relink file browser.
|
||||
* Included by the edit form only (admin mode, edit context).
|
||||
*
|
||||
* Expected variables:
|
||||
* (none — the modal is self-contained and uses hx-get for its content)
|
||||
*/
|
||||
?>
|
||||
<dialog id="relink-modal" class="relink-modal">
|
||||
<div class="relink-modal-header">
|
||||
<h3>Relier un fichier existant</h3>
|
||||
<button type="button" class="btn btn--sm btn--ghost"
|
||||
onclick="document.getElementById('relink-modal').close()"
|
||||
aria-label="Fermer">✕</button>
|
||||
</div>
|
||||
<div id="relink-modal-body">
|
||||
<p class="file-browser-loading">Chargement du navigateur de fichiers…</p>
|
||||
</div>
|
||||
<div class="relink-modal-footer">
|
||||
<small>Seuls les fichiers déjà présents dans storage/documents/ ou storage/theses/ sont listés.</small>
|
||||
</div>
|
||||
</dialog>
|
||||
@@ -325,7 +325,14 @@ $_buildQueueFilesJson = function (array $files, string $queueType): array {
|
||||
// Include PeerTube files too — load.php now handles them
|
||||
$result[] = [
|
||||
'source' => (string)((int)$f['id']),
|
||||
'options' => ['type' => 'local'],
|
||||
'options' => [
|
||||
'type' => 'local',
|
||||
'file' => [
|
||||
'name' => $f['file_name'] ?? basename($f['file_path'] ?? ''),
|
||||
'size' => (int)($f['file_size'] ?? 0),
|
||||
'type' => $f['mime_type'] ?? 'application/octet-stream',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
return $result;
|
||||
|
||||
Reference in New Issue
Block a user