shelfy/templates/media_list.pages.tmpl
2025-06-21 18:44:12 +02:00

66 lines
1.6 KiB
Cheetah

<!-- 1) Breadcrumb -->
<div class="mb-4 text-sm">
{{if .CurrentSub}}
<a
hx-get="/api/paths/{{.PathID}}/media"
hx-target="#content"
hx-swap="innerHTML"
>🔙 Racine</a>
&nbsp;/&nbsp;{{.CurrentSub}}
{{end}}
</div>
<!-- 2) Sous-dossiers -->
{{if .Dirs}}
<div class="grid grid-cols-4 gap-4 mb-6">
{{range .Dirs}}
<div class="card p-3 rounded shadow hover:shadow-lg transition">
<a
hx-get="/api/paths/{{$.PathID}}/media?sub={{.SubPath | urlquery}}"
hx-target="#content"
hx-swap="innerHTML"
class="flex flex-col items-center text-center"
>
<i class="fas fa-folder fa-2x mb-2"></i>
<span class="truncate">{{.Name}}</span>
</a>
</div>
{{end}}
</div>
{{end}}
<!-- 3) Médias -->
{{if .MediaItems}}
<div class="grid grid-cols-4 gap-4">
{{range .MediaItems}}
<div class="card p-2 rounded shadow hover:shadow-lg transition">
<a
hx-get="/media/{{.MediaPartID}}?path={{.FilePath | urlquery}}"
hx-target="#content"
hx-swap="innerHTML"
class="block"
>
<img
src="{{.ThumbURL}}"
alt="{{.Title}}"
class="w-full h-32 object-cover rounded mb-2"
/>
<h3 class="text-sm font-semibold truncate">{{.Title}}</h3>
{{if .DurationFmt}}
<small class="text-xs text-gray-500">{{.DurationFmt}}</small>
{{end}}
</a>
</div>
{{end}}
</div>
{{end}}
<!-- 4) Pas de contenu -->
{{if not .Dirs}}{{if not .MediaItems}}
<p class="text-center text-gray-500">Aucun dossier ni média dans ce répertoire.</p>
{{end}}{{end}}