From 3fecda6c117948b43efa2dcee69d370a7861088c Mon Sep 17 00:00:00 2001 From: Helge Jung <hej@c3pb.de> Date: Mon, 23 Dec 2024 01:57:32 +0100 Subject: [PATCH] assembly map editing: individual styles for existing assemblies w/ indication if assembly position has been published or not --- src/core/templates/core/map.html | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/core/templates/core/map.html b/src/core/templates/core/map.html index 0d2b5aa1d..931542903 100644 --- a/src/core/templates/core/map.html +++ b/src/core/templates/core/map.html @@ -132,11 +132,28 @@ {% endif %} function styleAssemblies(feature) { - return {color: 'red'}; + if (feature.properties.published) { + return { + color: "#CCFFCC", + weight: 2, + } + } else { + return { + color: "#FFCCCC", + weight: 1, + dashArray: "4 4", + dashOffset: "0", + } + } } function handleAssemblyFeature (feature, layer) { - layer.bindTooltip('<b>' + feature.properties.slug + '</b><br>' + feature.properties.name, {permanent: false, opacity: 0.75}) + layer.bindTooltip( + '<b>' + feature.properties.slug + '</b><br>' + + feature.properties.name + + (feature.properties.published ? '' : '<br>NOT PUBLISHED'), + {permanent: false, opacity: 0.75}, + ) } function loadAssemblies(activeFloor) { -- GitLab