Compare commits
5 Commits
1c383dd973
...
3dfebfb50c
| Author | SHA1 | Date |
|---|---|---|
|
|
3dfebfb50c | 1 month ago |
|
|
f9c4ce1bd8 | 1 month ago |
|
|
ae971ed873 | 1 month ago |
|
|
230e3b8271 | 1 month ago |
|
|
e7ce8375fd | 1 month ago |
@ -1,22 +1,13 @@
|
|||||||
"""
|
|
||||||
URL configuration for chartacapsa project.
|
|
||||||
|
|
||||||
The `urlpatterns` list routes URLs to views. For more information please see:
|
|
||||||
https://docs.djangoproject.com/en/6.0/topics/http/urls/
|
|
||||||
Examples:
|
|
||||||
Function views
|
|
||||||
1. Add an import: from my_app import views
|
|
||||||
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
|
||||||
Class-based views
|
|
||||||
1. Add an import: from other_app.views import Home
|
|
||||||
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
|
||||||
Including another URLconf
|
|
||||||
1. Import the include() function: from django.urls import include, path
|
|
||||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
|
||||||
"""
|
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.urls import path
|
from django.urls import path, include
|
||||||
|
from django.conf import settings
|
||||||
|
from django.conf.urls.static import static
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('admin/', admin.site.urls),
|
path('admin/', admin.site.urls),
|
||||||
|
path('', include('gebiete.urls')), # Dashboard auf der Startseite
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# Wichtig für statische Dateien und GeoJSON im Debug-Modus
|
||||||
|
if settings.DEBUG:
|
||||||
|
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
|
||||||
|
|||||||
@ -0,0 +1,44 @@
|
|||||||
|
# Generated by Django 6.0.6 on 2026-06-09 22:31
|
||||||
|
|
||||||
|
import django.db.models.deletion
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
initial = True
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Person',
|
||||||
|
fields=[
|
||||||
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('name', models.CharField(max_length=100, verbose_name='Name')),
|
||||||
|
('telefon', models.CharField(blank=True, max_length=20, verbose_name='Telefonnummer')),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'verbose_name': 'Person',
|
||||||
|
'verbose_name_plural': 'Personen',
|
||||||
|
},
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Gebiet',
|
||||||
|
fields=[
|
||||||
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('nummer', models.IntegerField(unique=True, verbose_name='Gebiets-Nummer')),
|
||||||
|
('name', models.CharField(max_length=150, verbose_name='Name/Bezeichnung')),
|
||||||
|
('beschreibung', models.TextField(blank=True, verbose_name='Beschreibung/Notizen')),
|
||||||
|
('zuletzt_bearbeitet', models.DateField(blank=True, null=True, verbose_name='Zuletzt bearbeitet')),
|
||||||
|
('karte', models.ImageField(blank=True, upload_to='gebietskarten/', verbose_name='Gebietskarte (Bild)')),
|
||||||
|
('aktuell_vergeben_an', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='gebiete', to='gebiete.person', verbose_name='Aktuell vergeben an')),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'verbose_name': 'Gebiet',
|
||||||
|
'verbose_name_plural': 'Gebiete',
|
||||||
|
'ordering': ['nummer'],
|
||||||
|
},
|
||||||
|
),
|
||||||
|
]
|
||||||
@ -0,0 +1,273 @@
|
|||||||
|
{
|
||||||
|
"type": "FeatureCollection",
|
||||||
|
"features": [
|
||||||
|
{
|
||||||
|
"type": "Feature",
|
||||||
|
"geometry": {
|
||||||
|
"coordinates": [
|
||||||
|
[
|
||||||
|
[
|
||||||
|
8.786209,
|
||||||
|
50.794333
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.787689,
|
||||||
|
50.795065
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.787196,
|
||||||
|
50.795323
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.786616,
|
||||||
|
50.795262
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.78594,
|
||||||
|
50.795085
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.784803,
|
||||||
|
50.794841
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.783945,
|
||||||
|
50.794733
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.783548,
|
||||||
|
50.794638
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.783162,
|
||||||
|
50.794489
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.782936,
|
||||||
|
50.794251
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.782657,
|
||||||
|
50.793593
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.782572,
|
||||||
|
50.793275
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.783237,
|
||||||
|
50.793193
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.783741,
|
||||||
|
50.793247
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.783934,
|
||||||
|
50.793153
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.784106,
|
||||||
|
50.793064
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.784471,
|
||||||
|
50.793119
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.784932,
|
||||||
|
50.793288
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.785307,
|
||||||
|
50.793498
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.785876,
|
||||||
|
50.794055
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.786209,
|
||||||
|
50.794333
|
||||||
|
]
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"type": "Polygon"
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"name": "Richtsberg 2",
|
||||||
|
"id": 2
|
||||||
|
},
|
||||||
|
"id": "66bk4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Feature",
|
||||||
|
"geometry": {
|
||||||
|
"coordinates": [
|
||||||
|
[
|
||||||
|
[
|
||||||
|
8.785018,
|
||||||
|
50.793295
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.78549,
|
||||||
|
50.793634
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.787496,
|
||||||
|
50.793119
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.786756,
|
||||||
|
50.79303
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.786584,
|
||||||
|
50.79244
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.787045,
|
||||||
|
50.791837
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.786756,
|
||||||
|
50.791498
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.783698,
|
||||||
|
50.789653
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.783001,
|
||||||
|
50.790196
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.783913,
|
||||||
|
50.79067
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.784438,
|
||||||
|
50.791335
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.783247,
|
||||||
|
50.790528
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.78284,
|
||||||
|
50.790575
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.781831,
|
||||||
|
50.79044
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.780737,
|
||||||
|
50.790813
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.780318,
|
||||||
|
50.792508
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.782593,
|
||||||
|
50.793241
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.783709,
|
||||||
|
50.793227
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.784385,
|
||||||
|
50.793051
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.78476,
|
||||||
|
50.793207
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.784889,
|
||||||
|
50.793241
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.785018,
|
||||||
|
50.793295
|
||||||
|
]
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"type": "Polygon"
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"name": "Richtsberg 3"
|
||||||
|
},
|
||||||
|
"id": "ZdDc0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Feature",
|
||||||
|
"geometry": {
|
||||||
|
"coordinates": [
|
||||||
|
[
|
||||||
|
[
|
||||||
|
8.789207,
|
||||||
|
50.795072
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.788832,
|
||||||
|
50.795329
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.787362,
|
||||||
|
50.794895
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.786193,
|
||||||
|
50.794326
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.785495,
|
||||||
|
50.793695
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.786654,
|
||||||
|
50.793275
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.787566,
|
||||||
|
50.793152
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.788617,
|
||||||
|
50.793593
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.789282,
|
||||||
|
50.794109
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.789358,
|
||||||
|
50.7944
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.789883,
|
||||||
|
50.794692
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.789926,
|
||||||
|
50.794902
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8.789207,
|
||||||
|
50.795072
|
||||||
|
]
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"type": "Polygon"
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"name": "Richtsberg-1",
|
||||||
|
"id": 3
|
||||||
|
},
|
||||||
|
"id": "kLn2l"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -0,0 +1 @@
|
|||||||
|
./beta_gebiet.geojson
|
||||||
|
After Width: | Height: | Size: 11 KiB |
@ -0,0 +1,63 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="de">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>🗃️ KartenKiste - Dashboard</title>
|
||||||
|
<!-- Leaflet CSS & JS einbinden -->
|
||||||
|
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" />
|
||||||
|
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
<style>
|
||||||
|
body { font-family: sans-serif; background: #F4F7F6; margin: 0; padding: 20px; }
|
||||||
|
#map { height: 500px; width: 100%; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
|
||||||
|
.container { max-width: 1200px; margin: 0 auto; }
|
||||||
|
h1 { color: #2C3E50; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<h1>🗺️ Gebietsübersicht</h1>
|
||||||
|
<!-- Hier wird die Karte gerendert -->
|
||||||
|
<div id="map"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// 1. Karte initialisieren und auf Deutschland/Ihre Region zentrieren
|
||||||
|
// (Koordinaten [Breitengrad, Längengrad], Zoomstufe)
|
||||||
|
const map = L.map('map').setView([51.1657, 10.4515], 6);
|
||||||
|
|
||||||
|
// 2. OpenStreetMap Kacheln hinzufügen (Clean & Modern Layout)
|
||||||
|
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||||
|
maxZoom: 19,
|
||||||
|
}).addTo(map);
|
||||||
|
|
||||||
|
// 3. GeoJSON-Daten aus dem Django Static-Ordner laden
|
||||||
|
fetch('/static/data/card.geojson')
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(geoJsonData => {
|
||||||
|
// GeoJSON zur Karte hinzufügen mit Styling
|
||||||
|
const geoJsonLayer = L.geoJSON(geoJsonData, {
|
||||||
|
style: function(feature) {
|
||||||
|
return {
|
||||||
|
color: '#A8C3B6', /* Unser Salbeigrün als Grenze */
|
||||||
|
weight: 2,
|
||||||
|
fillColor: '#D0E7DE', /* Unser Soft-Mint als Fläche */
|
||||||
|
fillOpacity: 0.5
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onEachFeature: function(feature, layer) {
|
||||||
|
// Popup-Inhalt beim Klick auf ein Gebiet
|
||||||
|
// Ersetzt 'name' mit dem Feldnamen aus Ihrer uMap-Eigenschaft
|
||||||
|
const gebietName = feature.properties.name || "Unbekanntes Gebiet";
|
||||||
|
layer.bindPopup(`<strong>Gebiet:</strong> ${gebietName}`);
|
||||||
|
}
|
||||||
|
}).addTo(map);
|
||||||
|
|
||||||
|
// Karte automatisch so zoomen, dass alle Gebiete sichtbar sind
|
||||||
|
map.fitBounds(geoJsonLayer.getBounds());
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Fehler beim Laden der GeoJSON:', error));
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
from django.urls import path
|
||||||
|
from . import views
|
||||||
|
|
||||||
|
app_name = 'gebiete'
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
path('', views.dashboard, name='dashboard'),
|
||||||
|
]
|
||||||
@ -1,3 +1,7 @@
|
|||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
|
|
||||||
# Create your views here.
|
# Create your views here.
|
||||||
|
from django.shortcuts import render
|
||||||
|
|
||||||
|
def dashboard(request):
|
||||||
|
return render(request, 'gebiete/dashboard.html')
|
||||||
|
|||||||
@ -0,0 +1,5 @@
|
|||||||
|
asgiref==3.11.1
|
||||||
|
Django==6.0.6
|
||||||
|
django-jazzmin==3.0.4
|
||||||
|
pillow==12.2.0
|
||||||
|
sqlparse==0.5.5
|
||||||
Loading…
Reference in new issue