Add missing templates
Deploy PBT / deploy (push) Successful in 14s

This commit is contained in:
2026-09-09 20:24:05 +02:00
parent b26bc9c34f
commit d8576dc539
5 changed files with 182 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
{% extends "base.html" %}
{% block title %}Neue Fahrt PBT{% endblock %}
{% block content %}
<h2>Neue Fahrt erfassen</h2>
<form method="post">
<label for="verkehrsmittel">Verkehrsmittel</label>
<select id="verkehrsmittel" name="verkehrsmittel" required>
{% for option in verkehrsmittel_optionen %}
<option value="{{ option }}">{{ option }}</option>
{% endfor %}
</select>
<label for="linie">Linie (optional)</label>
<input type="text" id="linie" name="linie" placeholder="z.B. S3, Bus 10">
<label for="von">Von</label>
<input type="text" id="von" name="von" required>
<label for="nach">Nach</label>
<input type="text" id="nach" name="nach" required>
<label for="datum">Datum</label>
<input type="date" id="datum" name="datum" value="{{ heute }}" required>
<label for="bewertung">Bewertung (15)</label>
<select id="bewertung" name="bewertung" required>
<option value="5">★★★★★ Sehr gut</option>
<option value="4">★★★★☆ Gut</option>
<option value="3" selected>★★★☆☆ Okay</option>
<option value="2">★★☆☆☆ Schlecht</option>
<option value="1">★☆☆☆☆ Sehr schlecht</option>
</select>
<label for="kommentar">Kommentar (optional)</label>
<textarea id="kommentar" name="kommentar" rows="3"></textarea>
<button type="submit">Speichern</button>
</form>
{% endblock %}
+69
View File
@@ -0,0 +1,69 @@
<!doctype html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}PBT Öffi-Erfahrungen{% endblock %}</title>
<style>
:root { color-scheme: light dark; }
body {
font-family: system-ui, -apple-system, sans-serif;
max-width: 700px;
margin: 2rem auto;
padding: 0 1rem;
line-height: 1.5;
}
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
header h1 { font-size: 1.3rem; margin: 0; }
nav a { margin-left: 1rem; }
.flash { padding: 0.6rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.flash.error { background: #fbdada; color: #7a1c1c; }
.flash.success { background: #d8f5d8; color: #1c5e1c; }
form { display: flex; flex-direction: column; gap: 0.8rem; max-width: 420px; }
label { font-weight: 600; font-size: 0.9rem; }
input, select, textarea {
padding: 0.5rem;
font-size: 1rem;
border: 1px solid #999;
border-radius: 6px;
}
button {
padding: 0.6rem 1rem;
font-size: 1rem;
border: none;
border-radius: 6px;
background: #1a5fb4;
color: white;
cursor: pointer;
width: fit-content;
}
button.secondary { background: #999; }
table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
th, td { text-align: left; padding: 0.5rem; border-bottom: 1px solid #ddd; }
.stars { color: #d4a017; }
</style>
</head>
<body>
<header>
<h1>🚋 PBT Öffi-Erfahrungen</h1>
<nav>
{% if current_user.is_authenticated %}
<a href="{{ url_for('dashboard') }}">Meine Fahrten</a>
<a href="{{ url_for('neue_fahrt') }}">Neue Fahrt</a>
<a href="{{ url_for('logout') }}">Logout ({{ current_user.username }})</a>
{% else %}
<a href="{{ url_for('login') }}">Login</a>
<a href="{{ url_for('register') }}">Registrieren</a>
{% endif %}
</nav>
</header>
{% with messages = get_flashed_messages(with_categories=true) %}
{% for category, message in messages %}
<div class="flash {{ category }}">{{ message }}</div>
{% endfor %}
{% endwith %}
{% block content %}{% endblock %}
</body>
</html>
+41
View File
@@ -0,0 +1,41 @@
{% extends "base.html" %}
{% block title %}Meine Fahrten PBT{% endblock %}
{% block content %}
<h2>Meine Fahrten</h2>
{% if not fahrten %}
<p>Noch keine Fahrten erfasst. <a href="{{ url_for('neue_fahrt') }}">Jetzt die erste hinzufügen</a>.</p>
{% else %}
<table>
<thead>
<tr>
<th>Datum</th>
<th>Verkehrsmittel</th>
<th>Linie</th>
<th>Strecke</th>
<th>Bewertung</th>
<th></th>
</tr>
</thead>
<tbody>
{% for f in fahrten %}
<tr>
<td>{{ f.datum.strftime("%d.%m.%Y") }}</td>
<td>{{ f.verkehrsmittel }}</td>
<td>{{ f.linie or "" }}</td>
<td>{{ f.von }} → {{ f.nach }}</td>
<td class="stars">{{ "★" * f.bewertung }}{{ "☆" * (5 - f.bewertung) }}</td>
<td>
<form method="post" action="{{ url_for('fahrt_loeschen', fahrt_id=f.id) }}" onsubmit="return confirm('Fahrt wirklich löschen?');">
<button type="submit" class="secondary">Löschen</button>
</form>
</td>
</tr>
{% if f.kommentar %}
<tr><td></td><td colspan="5" style="color:#666;">{{ f.kommentar }}</td></tr>
{% endif %}
{% endfor %}
</tbody>
</table>
{% endif %}
{% endblock %}
+15
View File
@@ -0,0 +1,15 @@
{% extends "base.html" %}
{% block title %}Login PBT{% endblock %}
{% block content %}
<h2>Login</h2>
<form method="post">
<label for="username">Benutzername</label>
<input type="text" id="username" name="username" required autofocus>
<label for="password">Passwort</label>
<input type="password" id="password" name="password" required>
<button type="submit">Einloggen</button>
</form>
<p>Noch kein Konto? <a href="{{ url_for('register') }}">Jetzt registrieren</a></p>
{% endblock %}
+18
View File
@@ -0,0 +1,18 @@
{% extends "base.html" %}
{% block title %}Registrieren PBT{% endblock %}
{% block content %}
<h2>Registrieren</h2>
<form method="post">
<label for="username">Benutzername</label>
<input type="text" id="username" name="username" required autofocus>
<label for="email">E-Mail</label>
<input type="email" id="email" name="email" required>
<label for="password">Passwort</label>
<input type="password" id="password" name="password" required minlength="8">
<button type="submit">Konto erstellen</button>
</form>
<p>Schon registriert? <a href="{{ url_for('login') }}">Zum Login</a></p>
{% endblock %}