From c088e0d5f9f6f3d795ad726d6ff4528ec6e59654 Mon Sep 17 00:00:00 2001
From: Dominic <git@msrd0.de>
Date: Tue, 28 Jan 2025 16:59:54 +0100
Subject: [PATCH] wrap long template/imageselect with scroll

---
 frontend/src/main.less                | 33 +++++++++++++++++++++++----
 schilder2000/templates/schild.html.j2 |  2 +-
 2 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/frontend/src/main.less b/frontend/src/main.less
index 92a20ee..cd1db51 100644
--- a/frontend/src/main.less
+++ b/frontend/src/main.less
@@ -269,11 +269,6 @@ main {
 			place-self: center;
 		}
 
-		img {
-			width: 10rem;
-			background-color: #fff;
-		}
-
 		.option-border {
 			border: @option_border solid var(--fg-dark);
 			border-radius: 3 * @option_border;
@@ -329,6 +324,34 @@ main {
 	}
 }
 
+.templateselect {
+	overflow: scroll;
+	// a row is roughly 15rem
+	max-height: 40rem;
+}
+
+.imageselect {
+	overflow: scroll;
+	// a row is roughly 10rem
+	max-height: 25rem;
+}
+
+.icon-container {
+	width: 10rem;
+	height: 10rem;
+
+	display: flex;
+	align-items: center;
+	justify-content: center;
+
+	img {
+		background-color: #fff;
+
+		max-width: 100%;
+		max-height: 100%;
+	}
+}
+
 .flash {
 	border: 1px solid transparent;
 	border-radius: 4px;
diff --git a/schilder2000/templates/schild.html.j2 b/schilder2000/templates/schild.html.j2
index 1b256f4..5b65aa5 100644
--- a/schilder2000/templates/schild.html.j2
+++ b/schilder2000/templates/schild.html.j2
@@ -57,7 +57,7 @@
 									checked
 								{%- endif -%}
 							/>
-							<label for="img:{{ img }}" class="option-border">
+							<label for="img:{{ img }}" class="option-border icon-container">
 								<img src="{{ url_for('instance.static', filename='img/'+img) }}" title="{{ img }}" />
 							</label>
 						</div>
-- 
GitLab