The API (HAFAS via db-vendo-client) covers all public transport in one system, not just trains -- verified with a mocked bus-stop response (Bus 14/Bus 9/Bus 66 mixed with a regional train, all rendering correctly, no code changes needed since nothing in check()/render() ever filtered by mode). Fixed the "Train departures" wording in code comments and settings UI, which was misleadingly train-specific. Also added an explicit "Found: <station>" confirmation toast on a successful station lookup, distinct from the generic "Saved." toast -- previously the only feedback was a passive "Currently: X" hint, easy to miss and not obviously tied to the save you just did.
52 lines
2.0 KiB
HTML
52 lines
2.0 KiB
HTML
{% extends "base.html" %}
|
|
{% block content %}
|
|
<h1>Departures</h1>
|
|
|
|
{% if error %}
|
|
<div class="toast error">{{ error }}</div>
|
|
{% endif %}
|
|
{% if request.args.get('found') %}
|
|
<div class="toast">Found: {{ request.args.get('found') }}</div>
|
|
{% endif %}
|
|
|
|
<p class="hint" style="margin: -0.5rem 0 1.25rem;">
|
|
Uses the free, unofficial db-vendo-client API (v6.db.transport.rest) --
|
|
no key needed, but it's a community-run service, not official Deutsche
|
|
Bahn infrastructure. Expect occasional downtime; the screen shows a plain
|
|
"not available" message rather than breaking when that happens.
|
|
</p>
|
|
|
|
<form method="post">
|
|
<div class="card">
|
|
<div class="section-label">Station</div>
|
|
<div class="field">
|
|
<label for="station">Station or stop name</label>
|
|
<input type="text" id="station" name="station" placeholder="e.g. Berlin Hauptbahnhof">
|
|
<p class="hint">Works for bus/tram/subway stops too, not just train stations -- search by name the same way either way.</p>
|
|
{% if settings.station_label %}
|
|
<p class="hint">Currently: {{ settings.station_label }}</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="section-label">Display</div>
|
|
<div class="field">
|
|
<label for="results">Departures to show</label>
|
|
<select id="results" name="results">
|
|
<option value="3" {{ "selected" if settings.results == 3 }}>3</option>
|
|
<option value="5" {{ "selected" if settings.results == 5 or not settings.results }}>5</option>
|
|
<option value="8" {{ "selected" if settings.results == 8 }}>8</option>
|
|
</select>
|
|
</div>
|
|
<div class="field">
|
|
<label for="update_minutes">Update every (minutes)</label>
|
|
<input type="number" id="update_minutes" name="update_minutes" min="1" value="{{ settings.update_minutes or 2 }}">
|
|
<p class="hint">Departure boards change often, so this defaults much shorter than Weather's -- but same rule applies: the panel only actually redraws when something in the list changed.</p>
|
|
</div>
|
|
</div>
|
|
|
|
<button type="submit">Save</button>
|
|
</form>
|
|
{% endblock %}
|