um Poolfahrzeuge erweitert

This commit is contained in:
Erik Thiele
2026-05-19 20:22:18 +02:00
parent 60a5dc39b2
commit 0199a21a66
12 changed files with 487 additions and 43 deletions

View File

@@ -3,12 +3,12 @@
{% block content %}
<div class="page-section-title">
<h1>Ausgabe</h1>
<p>Tuerchips und Parkkarten an bestehende User ausgeben.</p>
<p>Tuerchips, Parkkarten und Poolfahrzeuge an bestehende User ausgeben.</p>
</div>
<section class="card form-card">
<div class="card-body">
<h2 class="card-title"><i class="ti ti-key me-1"></i>Chip oder Parkkarte ausgeben</h2>
<h2 class="card-title"><i class="ti ti-key me-1"></i>Medium ausgeben</h2>
<form method="post" action="{{ url_for('assign_asset') }}">
<div class="mb-3">
<label class="form-label">User</label>
@@ -21,17 +21,39 @@
</div>
<div class="mb-3">
<label class="form-label">Typ</label>
<select class="form-select" name="asset_type" required>
<option value="chip">Tuerchip</option>
<option value="parking_card">Parkkarte</option>
<select class="form-select" name="asset_type" id="asset_type" required>
<option value="chip" {% if selected_asset_type == 'chip' %}selected{% endif %}>Tuerchip</option>
<option value="parking_card" {% if selected_asset_type == 'parking_card' %}selected{% endif %}>Parkkarte</option>
<option value="pool_vehicle" {% if selected_asset_type == 'pool_vehicle' %}selected{% endif %}>Poolfahrzeug</option>
</select>
</div>
<div class="mb-3">
<label class="form-label">Kennung</label>
<input class="form-control" type="text" name="asset_code" required placeholder="z. B. CHIP-1001">
<label class="form-label" id="asset_code_label">{% if selected_asset_type == 'pool_vehicle' %}Kennzeichen{% else %}Kennung{% endif %}</label>
<input class="form-control" type="text" name="asset_code" id="asset_code" required placeholder="{% if selected_asset_type == 'pool_vehicle' %}z. B. GZ-CC-123{% else %}{{ input_placeholder }}{% endif %}">
</div>
<button class="btn btn-primary" type="submit"><i class="ti ti-check me-1"></i>Ausgabe speichern</button>
</form>
</div>
</section>
<script>
(() => {
const select = document.getElementById("asset_type");
const label = document.getElementById("asset_code_label");
const input = document.getElementById("asset_code");
if (!select || !label || !input) return;
const syncField = () => {
if (select.value === "pool_vehicle") {
label.textContent = "Kennzeichen";
input.placeholder = "z. B. GZ-CC-123";
} else {
label.textContent = "Kennung";
input.placeholder = select.value === "chip" ? "z. B. CHIP-1001" : "z. B. PARK-2001";
}
};
select.addEventListener("change", syncField);
syncField();
})();
</script>
{% endblock %}

View File

@@ -118,7 +118,7 @@
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
gap: 1rem;
}
@@ -162,6 +162,11 @@
border-radius: 999px;
background: rgba(255, 255, 255, 0.18);
font-size: 1.5rem;
flex: 0 0 auto;
}
.card.stat-card-pool .stat-icon {
margin-right: 0.15rem;
}
.card.stat-card.stat-card-users {
@@ -489,7 +494,7 @@
<img class="navbar-brand-logo me-3" src="{{ url_for('static', filename='cancom.svg') }}" alt="CANCOM Logo">
<span class="navbar-brand-wordmark">
<strong>CANCOM BU Sued/West</strong>
<span>Tuerchip und Parkkartenverwaltung</span>
<span>Tuerchip-, Parkkarten- und Poolfahrzeugverwaltung</span>
</span>
</div>
<div class="navbar-nav flex-row order-md-last top-actions">

View File

@@ -51,6 +51,15 @@
<div class="stat-icon"><i class="ti ti-credit-card"></i></div>
</div>
</div>
<div class="card stat-card stat-card-pool" style="background: linear-gradient(135deg, #1f6f8b 0%, #14505f 100%); color: #ffffff;">
<div class="card-body">
<div>
<div class="stat-label">Poolfahrzeuge</div>
<div class="stat-value">{{ stats.active_pool_vehicles }}</div>
</div>
<div class="stat-icon"><i class="ti ti-car"></i></div>
</div>
</div>
</div>
</div>
</section>
@@ -70,6 +79,7 @@
<th>Abteilung</th>
<th>Tuerchip</th>
<th>Parkkarte</th>
<th>Poolfahrzeug</th>
</tr>
</thead>
<tbody>
@@ -94,6 +104,14 @@
-
{% endif %}
</td>
<td>
{% if user.pool_vehicle_code %}
{{ user.pool_vehicle_code }}<br>
<span class="muted">seit {{ user.pool_vehicle_assigned_at }}</span>
{% else %}
-
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>

View File

@@ -3,7 +3,7 @@
{% block content %}
<section class="card card-md login-card">
<div class="card-body">
<h2 class="text-center mb-4"><i class="ti ti-lock me-1"></i>Signage Admin</h2>
<h2 class="text-center mb-4"><i class="ti ti-lock me-1"></i>Chipverwaltung</h2>
<form method="post" action="{{ url_for('login') }}">
<div class="mb-3">
<label class="form-label">Benutzername</label>

View File

@@ -279,7 +279,7 @@
<td>{{ asset_labels[transaction.asset_type] }}</td>
</tr>
<tr>
<th>Kennung</th>
<th>{% if transaction.asset_type == 'pool_vehicle' %}Kennzeichen{% else %}Kennung{% endif %}</th>
<td>{{ transaction.asset_code }}</td>
</tr>
<tr>

View File

@@ -3,12 +3,12 @@
{% block content %}
<div class="page-section-title">
<h1>Rueckgabe</h1>
<p>Ausgegebene Tuerchips und Parkkarten wieder zuruecknehmen.</p>
<p>Ausgegebene Tuerchips, Parkkarten und Poolfahrzeuge wieder zuruecknehmen.</p>
</div>
<section class="card form-card">
<div class="card-body">
<h2 class="card-title"><i class="ti ti-arrow-back-up me-1"></i>Chip oder Parkkarte zuruecknehmen</h2>
<h2 class="card-title"><i class="ti ti-arrow-back-up me-1"></i>Medium zuruecknehmen</h2>
<form method="post" action="{{ url_for('return_asset') }}">
<div class="mb-3">
<label class="form-label">User</label>
@@ -21,13 +21,27 @@
</div>
<div class="mb-3">
<label class="form-label">Typ</label>
<select class="form-select" name="asset_type" required>
<option value="chip">Tuerchip</option>
<option value="parking_card">Parkkarte</option>
<select class="form-select" name="asset_type" id="asset_type" required>
<option value="chip" {% if selected_asset_type == 'chip' %}selected{% endif %}>Tuerchip</option>
<option value="parking_card" {% if selected_asset_type == 'parking_card' %}selected{% endif %}>Parkkarte</option>
<option value="pool_vehicle" {% if selected_asset_type == 'pool_vehicle' %}selected{% endif %}>Poolfahrzeug</option>
</select>
</div>
<button class="btn btn-primary" type="submit"><i class="ti ti-check me-1"></i>Rueckgabe speichern</button>
</form>
</div>
</section>
<script>
(() => {
const select = document.getElementById("asset_type");
if (!select) return;
const syncField = () => {
select.title = select.value === "pool_vehicle" ? "Poolfahrzeug" : select.options[select.selectedIndex].text;
};
select.addEventListener("change", syncField);
syncField();
})();
</script>
{% endblock %}