160 lines
6.2 KiB
HTML
160 lines
6.2 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}Straßenverwaltung - {{ APP_TITLE }}{% endblock %}
|
|
|
|
{% block content %}
|
|
<p><a href="{{ url_for('admin.dashboard', tenant=session.tenant_code) }}">← Zurück zum Dashboard</a></p>
|
|
<h1>Straßenverwaltung</h1>
|
|
|
|
<div style="display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; margin-bottom: 0.75rem;">
|
|
<label style="margin: 0;">Name filtern
|
|
<input type="text" id="streetNameFilter" placeholder="z. B. Haupt" oninput="applyStreetFilters()">
|
|
</label>
|
|
<label style="margin: 0;">State
|
|
<select id="streetStateFilter" onchange="applyStreetFilters()">
|
|
<option value="">alle</option>
|
|
<option value="unbearbeitet">unbearbeitet</option>
|
|
<option value="zugewiesen">zugewiesen</option>
|
|
<option value="erledigt">erledigt</option>
|
|
</select>
|
|
</label>
|
|
<label style="margin: 0;">Gruppe
|
|
<select id="streetGroupFilter" onchange="applyStreetFilters()">
|
|
<option value="">alle</option>
|
|
{% for gruppe in gruppen %}
|
|
<option value="{{ gruppe.id }}">{{ gruppe.aliasname or gruppe.id }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</label>
|
|
</div>
|
|
|
|
<table id="strassenTable">
|
|
<thead>
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>Name</th>
|
|
<th>State</th>
|
|
<th>Gruppe</th>
|
|
<th>HN Min</th>
|
|
<th>HN Max</th>
|
|
<th>BBox</th>
|
|
<th>Aktionen</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for strasse in strassen %}
|
|
<tr data-id="{{ strasse.id }}" data-bbox="{{ strasse.bbox or '' }}">
|
|
<td>{{ strasse.id }}</td>
|
|
<td>{{ strasse.name }}</td>
|
|
<td>
|
|
<select onchange="updateStrasse({{ strasse.id }}, {state: this.value})">
|
|
<option value="unbearbeitet" {% if strasse.state == 'unbearbeitet' %}selected{% endif %}>unbearbeitet</option>
|
|
<option value="zugewiesen" {% if strasse.state == 'zugewiesen' %}selected{% endif %}>zugewiesen</option>
|
|
<option value="erledigt" {% if strasse.state == 'erledigt' %}selected{% endif %}>erledigt</option>
|
|
</select>
|
|
</td>
|
|
<td>
|
|
<select onchange="updateStrasse({{ strasse.id }}, {group_id: this.value})">
|
|
<option value="">-</option>
|
|
{% for gruppe in gruppen %}
|
|
<option value="{{ gruppe.id }}" {% if strasse.group_id == gruppe.id %}selected{% endif %}>{{ gruppe.aliasname or gruppe.id }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</td>
|
|
<td>{{ strasse.hn_min or '-' }}</td>
|
|
<td>{{ strasse.hn_max or '-' }}</td>
|
|
<td style="word-break: break-all;">{{ strasse.bbox or '-' }}</td>
|
|
<td>
|
|
<button onclick="editStrasse({{ strasse.id }})">✎</button>
|
|
<button onclick="showStreetHistory({{ strasse.id }})">Historie</button>
|
|
<button class="secondary" onclick="deleteStrasse({{ strasse.id }})">🗑</button>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
|
|
<button onclick="openCreateStrasseModal()">Neue Straße</button>
|
|
<button onclick="document.getElementById('csvFile').click()">Import CSV</button>
|
|
<input type="file" id="csvFile" accept=".csv" style="display:none" onchange="importCSV(this)">
|
|
<button onclick="document.getElementById('houseNumberCsvFile').click()">
|
|
Hausnummern importieren ({{ house_number_count }})
|
|
</button>
|
|
<input type="file" id="houseNumberCsvFile" accept=".csv" style="display:none"
|
|
onchange="importHouseNumbers(this)">
|
|
<p style="margin-top: 2rem;"><a href="{{ url_for('admin.dashboard', tenant=session.tenant_code) }}">← Zurück zum Dashboard</a></p>
|
|
|
|
<!-- Create/Edit Strasse Modal -->
|
|
<dialog id="strasseModal">
|
|
<article>
|
|
<header>
|
|
<a href="#close" aria-label="Close" class="close" onclick="closeStrasseModal()"></a>
|
|
<h3 id="strasseModalTitle">Straße</h3>
|
|
</header>
|
|
<input type="hidden" id="strasseId">
|
|
<label>Name
|
|
<input type="text" id="strasseName">
|
|
</label>
|
|
<label>Hausnummer minimal
|
|
<input type="number" id="strasseHnMin">
|
|
</label>
|
|
<label>Hausnummer maximal
|
|
<input type="number" id="strasseHnMax">
|
|
</label>
|
|
<label>Bounding Box (JSON Array)
|
|
<textarea id="strasseBbox"></textarea>
|
|
</label>
|
|
<label>State
|
|
<select id="strasseState">
|
|
<option value="unbearbeitet">unbearbeitet</option>
|
|
<option value="zugewiesen">zugewiesen</option>
|
|
<option value="erledigt">erledigt</option>
|
|
</select>
|
|
</label>
|
|
<label>Gruppe
|
|
<select id="strasseGroup">
|
|
<option value="">-</option>
|
|
{% for gruppe in gruppen %}
|
|
<option value="{{ gruppe.id }}">{{ gruppe.aliasname or gruppe.id }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</label>
|
|
<footer>
|
|
<button onclick="closeStrasseModal()">Abbrechen</button>
|
|
<button onclick="saveStrasse()">Speichern</button>
|
|
</footer>
|
|
</article>
|
|
</dialog>
|
|
|
|
<!-- History Modal -->
|
|
<dialog id="streetHistoryModal">
|
|
<article style="max-width: 800px;">
|
|
<header>
|
|
<a href="#close" aria-label="Close" class="close" onclick="closeStreetHistoryModal()"></a>
|
|
<h3>Straßen-Historie</h3>
|
|
</header>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Datum</th>
|
|
<th>Von</th>
|
|
<th>Nach</th>
|
|
<th>Gruppe</th>
|
|
<th>Aktion</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="streetHistoryBody">
|
|
</tbody>
|
|
</table>
|
|
<footer>
|
|
<button onclick="closeStreetHistoryModal()">Schließen</button>
|
|
</footer>
|
|
</article>
|
|
</dialog>
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
<script>window.CMBNET_ADMIN_RELOAD_WATCH = true;</script>
|
|
<script src="{{ url_for('static', filename='js/views/admin_strassen.js') }}"></script>
|
|
{% endblock %}
|