Journey: add regional-only filter and service notices
- connection_type setting (all/regional/long_distance) restricts EFA trip requests via inclMOT_N params, so ICE/IC/EC can be filtered out for commutes that only care about regional/local transit. - Surface leg.infos[].infoLinks titles (real disruption/outage notices from EFA) on each journey row, marked with a red warning icon.
This commit is contained in:
1 parent
d5757a00df
commit
06b90ffe6c
3 files changed
+62
-6
No files matched your search
+4
-1
@@ -141,8 +141,11 @@ def create_app(config, screens: dict, scheduler) -> Flask:
|
||||
except (TypeError, ValueError):
|
||||
results = 3
|
||||
update_minutes = max(1, int(request.form.get("update_minutes", 2) or 2))
|
||||
connection_type = request.form.get("connection_type", "all")
|
||||
if connection_type not in ("all", "regional", "long_distance"):
|
||||
connection_type = "all"
|
||||
|
||||
updates = {"results": results, "update_minutes": update_minutes}
|
||||
updates = {"results": results, "update_minutes": update_minutes, "connection_type": connection_type}
|
||||
journey_screen = screens["journey"]
|
||||
|
||||
if origin_query:
|
||||
|
||||
@@ -52,6 +52,15 @@
|
||||
<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 }}">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="connection_type">Connections</label>
|
||||
<select id="connection_type" name="connection_type">
|
||||
<option value="all" {{ "selected" if settings.connection_type == "all" or not settings.connection_type }}>All</option>
|
||||
<option value="regional" {{ "selected" if settings.connection_type == "regional" }}>Regional only (no ICE/IC/EC)</option>
|
||||
<option value="long_distance" {{ "selected" if settings.connection_type == "long_distance" }}>Long-distance only (ICE/IC/EC)</option>
|
||||
</select>
|
||||
<p class="hint">"Regional only" hides ICE/IC/EC long-distance trains -- just S-Bahn, regional trains, buses, trams etc.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit">Save</button>
|
||||
|
||||
Reference in new issue
Block a user