From b1ce2ce3aa0594f3920cc31b4171a050dc712d58 Mon Sep 17 00:00:00 2001 From: Edwin Noorlander Date: Tue, 11 Nov 2025 18:09:51 +0100 Subject: [PATCH] Add display of current image in edit modal --- public/js/app.js | 6 ++++++ templates/items.twig | 1 + 2 files changed, 7 insertions(+) diff --git a/public/js/app.js b/public/js/app.js index 203b320..ec3d0a0 100755 --- a/public/js/app.js +++ b/public/js/app.js @@ -227,6 +227,12 @@ document.addEventListener('DOMContentLoaded', function() { document.getElementById('edit_item_name').value = data.name; document.getElementById('edit_item_description').value = data.description || ''; document.getElementById('edit_location').value = data.location || ''; + const currentImageDiv = document.getElementById('current_image'); + if (data.image) { + currentImageDiv.innerHTML = '

Huidige afbeelding:

'; + } else { + currentImageDiv.innerHTML = '

Geen afbeelding

'; + } // Populate category select const categorySelect = document.getElementById('edit_item_category_id'); categorySelect.innerHTML = ''; diff --git a/templates/items.twig b/templates/items.twig index 156019d..6fa9795 100755 --- a/templates/items.twig +++ b/templates/items.twig @@ -87,6 +87,7 @@
+