From a5d4ead1795882d25da7eda53680d2a84590693d Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 3 Jul 2026 20:53:00 -0400 Subject: feat: admin map can add new and rename areas. works with empty directories now. --- internal/admin/templates/duplicate-rooms.html | 5 +-- internal/admin/templates/map.html | 46 +++++++++++++++++++-------- 2 files changed, 35 insertions(+), 16 deletions(-) (limited to 'internal/admin/templates') diff --git a/internal/admin/templates/duplicate-rooms.html b/internal/admin/templates/duplicate-rooms.html index 4e603bb..9533460 100644 --- a/internal/admin/templates/duplicate-rooms.html +++ b/internal/admin/templates/duplicate-rooms.html @@ -64,9 +64,9 @@ function checkDups() { } function deleteDupFile(path) { - if (!confirm('Delete this file?\n\n' + path)) return; API.post('/api/rooms/resolve-duplicate', {path: path, action: 'delete'}).then(function() { notify('Deleted', 'success'); + updateUndoBar(); checkDups(); }).catch(function(e) { notify('Delete failed: ' + e.message, 'error'); @@ -77,9 +77,9 @@ function renameDupFile(path, inputId) { var el = document.getElementById(inputId); var newID = parseInt(el.value, 10); if (!newID || newID <= 0) { notify('Enter a valid new room ID', 'error'); return; } - if (!confirm('Rename this file to ID ' + newID + '?\n\n' + path)) return; API.post('/api/rooms/resolve-duplicate', {path: path, action: 'rename', new_id: newID}).then(function() { notify('Renamed to ' + newID, 'success'); + updateUndoBar(); checkDups(); }).catch(function(e) { notify('Rename failed: ' + e.message, 'error'); @@ -89,5 +89,6 @@ function renameDupFile(path, inputId) { function esc(s) { return String(s || '').replace(/&/g,'&').replace(//g,'>'); } function escAttr(s) { return String(s || '').replace(/&/g,'&').replace(/"/g,'"'); } checkDups(); +window.refreshPage = checkDups; {{end}} diff --git a/internal/admin/templates/map.html b/internal/admin/templates/map.html index 3bcbb30..1e45f8e 100644 --- a/internal/admin/templates/map.html +++ b/internal/admin/templates/map.html @@ -7,20 +7,38 @@
-
- - Z=0 - - - Area: - - Zoom: - - - +
+
+ Area: + + + + + + + + Z=0 + + + Zoom: + + + + +
+ + + +
+
+ + + +
+
-- cgit v1.2.3