From 6ac58a47c1fa39b19ca3ad3a6d2a09ccb32abf55 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Rapha=C3=ABl=20Gertz?= <git@rapsys.eu>
Date: Sun, 3 Nov 2024 05:35:14 +0100
Subject: [PATCH] New index listing albums and resources

---
 templates/index.html.twig | 38 ++++++++++++++++++++++----------------
 1 file changed, 22 insertions(+), 16 deletions(-)

diff --git a/templates/index.html.twig b/templates/index.html.twig
index b7fd158..0c95ed5 100644
--- a/templates/index.html.twig
+++ b/templates/index.html.twig
@@ -1,19 +1,25 @@
 {% extends '@RapsysTree/_base.html.twig' %}
 {% block content %}
-	<article>
-		<header>
-			<h2><a href="{{ path('rapsystree') }}">{{ title.section }}</a></h2>
-			<p>{{ description }}</p>
-		</header>
-		<div>
-			{% for id, path in roots %}
-				<section>
-					<header>
-						<h3><a href="{{ path('rapsystree_directory', {path: id}) }}">{{ id }}</a></h3>
-					</header>
-					TODO: list of images ?
-				</section>
-			{% endfor %}
-		</div>
-	</article>
+	{% if albums is defined and albums %}
+		{% for id, album in albums %}
+			<article>
+				<header>
+					<h2><a href="{{ album.link }}">{{ album.slug }}</a></h2>
+				</header>
+				{% if album.assets is defined and album.assets %}
+					{% for id, asset in album.assets %}
+						<section>
+							<header>
+								<h3><a href="{{ asset.link }}">{{ asset.path }}</a></h3>
+							</header>
+							<p>
+								TODO: miniature if target is a file or image list when directory ?
+							</p>
+						</section>
+					{% endfor %}
+				{% endif %}
+			</article>
+		{% endfor %}
+		{# TODO: XXX: add next and prev links ? #}
+	{% endif %}
 {% endblock %}
-- 
2.41.3