diff --git a/public/css/editor.css b/public/css/editor.css
index 500032d..a9e8fed 100644
--- a/public/css/editor.css
+++ b/public/css/editor.css
@@ -142,7 +142,7 @@
.route-control-actions {
display: grid;
- grid-template-columns: 1fr;
+ grid-template-columns: auto minmax(0, 1fr);
gap: .5rem;
margin-top: .85rem;
padding-top: .75rem;
@@ -171,7 +171,15 @@
align-items: center;
display: inline-flex;
justify-content: center;
- font-weight: 700;
+ min-height: 2.75rem;
+ min-width: 2.75rem;
+ padding: .5rem;
+}
+
+.editor-button-icon {
+ display: block;
+ height: 1.65rem;
+ width: 1.65rem;
}
.editor-media-actions {
diff --git a/public/images/icons/route-management.svg b/public/images/icons/route-management.svg
new file mode 100644
index 0000000..6f4e871
--- /dev/null
+++ b/public/images/icons/route-management.svg
@@ -0,0 +1,5 @@
+
diff --git a/public/index.html b/public/index.html
index 40d6283..b6b7769 100644
--- a/public/index.html
+++ b/public/index.html
@@ -140,7 +140,9 @@
-
+
diff --git a/public/js/editor-ui.js b/public/js/editor-ui.js
index 68e8c1f..b2af412 100644
--- a/public/js/editor-ui.js
+++ b/public/js/editor-ui.js
@@ -336,7 +336,9 @@ globalThis.Wegwichtel = globalThis.Wegwichtel || {};
const actions = document.createElement('div');
actions.className = classes.iconRow;
actions.appendChild(iconButton('Strecke bearbeiten', '✎', 'edit-route'));
- actions.appendChild(iconButton('Strecke löschen', '×', 'delete-route', false, true));
+ if (routeSource(route) === 'local') {
+ actions.appendChild(iconButton('Strecke löschen', '×', 'delete-route', false, true));
+ }
item.append(label, actions);
return item;
}
@@ -1184,13 +1186,9 @@ globalThis.Wegwichtel = globalThis.Wegwichtel || {};
async function deleteRouteFromList(route) {
const id = routeId(route);
- if (!id) return;
+ if (!id || routeSource(route) !== 'local') return;
- if (routeSource(route) === 'local') {
- ns.LocalRoutes.remove(id);
- } else {
- await sendDelete(`/routes/${encodeURIComponent(id)}`);
- }
+ ns.LocalRoutes.remove(id);
if (routeId(state.currentRoute) === id && state.currentSource === routeSource(route)) {
state.currentRoute = null;
@@ -1214,7 +1212,9 @@ globalThis.Wegwichtel = globalThis.Wegwichtel || {};
await loadRoute(route);
return;
}
- if (action === 'delete-route') await deleteRouteFromList(route);
+ if (action === 'delete-route' && routeSource(route) === 'local') {
+ await deleteRouteFromList(route);
+ }
}
async function deletePoiFromList(poi) {
diff --git a/test/editor-ui.test.js b/test/editor-ui.test.js
index 0b7ec1b..9d01b26 100644
--- a/test/editor-ui.test.js
+++ b/test/editor-ui.test.js
@@ -19,7 +19,8 @@ test('editor markup and source describe local draft creation instead of immediat
const css = await read('public/css/editor.css');
const ui = await read('public/js/editor-ui.js');
- assert.match(html, /id="editor-button"/);
+ assert.match(html, /id="editor-button"[^>]+aria-label="Streckenverwaltung öffnen"/);
+ assert.match(html, /class="editor-button-icon"[^>]+src="images\/icons\/route-management\.svg"[^>]+alt=""/);
assert.match(html, /