feat(windkarte): slugPrefix enforcement, name→gebiets_nr, name field removed
- RustyCMS: SchemaDefinition.slug_prefix + auto-prepend in create_entry - wind_area/wind_map schemas: slugPrefix config, name field removed - wind_area entries: name→gebiets_nr (faktische Gebietsnummer, GeoJSON-Join-Key) - WindkarteMap/WindAreaPanel: Join + Anzeige auf gebiets_nr Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -36,7 +36,7 @@
|
|||||||
<div class="flex items-start justify-between gap-3 border-b border-stein-200 px-5 py-4">
|
<div class="flex items-start justify-between gap-3 border-b border-stein-200 px-5 py-4">
|
||||||
<div class="min-w-0">
|
<div class="min-w-0">
|
||||||
<div class="flex items-center gap-2 flex-wrap">
|
<div class="flex items-center gap-2 flex-wrap">
|
||||||
<span class="text-xl font-semibold text-stein-800">{area.name}</span>
|
<span class="text-xl font-semibold text-stein-800">{area.gebiets_nr}</span>
|
||||||
{#if area.status}
|
{#if area.status}
|
||||||
<span class="rounded-full px-2 py-0.5 text-xs font-medium {STATUS_CLASS[area.status] ?? 'bg-stein-100 text-stein-600'}">
|
<span class="rounded-full px-2 py-0.5 text-xs font-medium {STATUS_CLASS[area.status] ?? 'bg-stein-100 text-stein-600'}">
|
||||||
{STATUS_LABEL[area.status] ?? area.status}
|
{STATUS_LABEL[area.status] ?? area.status}
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
maxZoom: 16,
|
maxZoom: 16,
|
||||||
}).addTo(map);
|
}).addTo(map);
|
||||||
|
|
||||||
const byName = Object.fromEntries(areas.map((a) => [a.name, a]));
|
const byNr = Object.fromEntries(areas.map((a) => [a.gebiets_nr, a]));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const geoRes = await fetch(geojsonUrl);
|
const geoRes = await fetch(geojsonUrl);
|
||||||
@@ -85,7 +85,7 @@
|
|||||||
return style(s, false);
|
return style(s, false);
|
||||||
},
|
},
|
||||||
onEachFeature: (feature, layer) => {
|
onEachFeature: (feature, layer) => {
|
||||||
const cmsArea = byName[feature.properties?.name] ?? null;
|
const cmsArea = byNr[feature.properties?.name] ?? null;
|
||||||
if (cmsArea) feature.properties.cms = cmsArea;
|
if (cmsArea) feature.properties.cms = cmsArea;
|
||||||
|
|
||||||
layer.on("click", async () => {
|
layer.on("click", async () => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
export type WindArea = {
|
export type WindArea = {
|
||||||
_slug: string;
|
_slug: string;
|
||||||
name: string;
|
gebiets_nr: string;
|
||||||
bezeichnung?: string;
|
bezeichnung?: string;
|
||||||
status?: "rechtskraeftig" | "entwurf_2" | "entwurf_3";
|
status?: "rechtskraeftig" | "entwurf_2" | "entwurf_3";
|
||||||
flaeche_ha?: number;
|
flaeche_ha?: number;
|
||||||
|
|||||||
Reference in New Issue
Block a user