Upload files to "frontend/templates/partials"

This commit is contained in:
Thierry 2026-04-01 23:26:17 +02:00
parent c9685c4ce2
commit c4b3c41718
4 changed files with 331 additions and 21 deletions

View file

@ -0,0 +1,61 @@
{% if error %}
<div class="alert alert-error">
<span>{{ error }}</span>
</div>
{% elif not pointclouds %}
<p class="text-base-content/40 text-sm text-center py-8">
Aucun nuage disponible sur le serveur.
</p>
{% else %}
<p class="text-xs text-base-content/40 mb-3">{{ pointclouds|length }} nuage(s)</p>
<div class="overflow-x-auto">
<table class="table table-sm">
<thead>
<tr>
<th>ID</th>
<th>Taille</th>
<th>Fichiers</th>
<th>Créé le</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for pc in pointclouds %}
<tr>
<td class="font-mono text-xs max-w-[120px] truncate" title="{{ pc.id }}">{{ pc.id }}</td>
<td>{{ pc.size_mb }} MB</td>
<td>{{ pc.file_count }}</td>
<td>{{ pc.created|datetimeformat }}</td>
<td>
<div class="flex gap-1 flex-wrap">
<a href="/admin/debug/{{ pc.id }}" class="btn btn-xs btn-ghost" title="Debug">🔍</a>
<a href="/viewer/{{ pc.id }}" class="btn btn-xs" target="_blank" title="Visualiser">👁️</a>
<!-- ✅ Bouton crop : charge crop_section.html dans #crop-panel (hors de ce div) -->
<button
type="button"
class="btn btn-xs btn-warning"
title="Cropper ce nuage"
hx-get="/crop?pc_id={{ pc.id }}"
hx-target="#crop-panel"
hx-swap="innerHTML"
hx-on:htmx:after-swap="document.getElementById('crop-panel').scrollIntoView({behavior:'smooth'})"
>✂️ Crop</button>
<button
type="button"
class="btn btn-xs btn-error"
title="Supprimer"
hx-delete="/admin/delete/{{ pc.id }}"
hx-target="#cloud-list-body"
hx-swap="innerHTML"
hx-confirm="Supprimer le nuage {{ pc.id }} ?"
>🗑️</button>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}