From 7960114f71720f2c2fa86e74be4b80812edaef36 Mon Sep 17 00:00:00 2001
From: Daniel Friesel
Date: Sun, 19 May 2019 08:55:23 +0200
Subject: Work in progress: show connections when arriving soon
At the moment, the heuristic used to determine connection targets is quite
simple: $station is a target iff there were at least two trips in the past
6 weeks with checkin at the current destination station and checkout at
$station.
Todo / enhanhement options:
* Consider current origin station as well, i.e.: $station is a target
iff there were at least two trips in the past 6 weeks which are preceded by
a trip from the current origin station and (same as above)
* Make connection links clickable once the current journey has ended.
Connections need to be added to _checked_out as well for this to work.
---
templates/_checked_in.html.ep | 35 ++++++++++++++++++++++++++++++++++-
1 file changed, 34 insertions(+), 1 deletion(-)
(limited to 'templates/_checked_in.html.ep')
diff --git a/templates/_checked_in.html.ep b/templates/_checked_in.html.ep
index 48e866c..39bc1e3 100644
--- a/templates/_checked_in.html.ep
+++ b/templates/_checked_in.html.ep
@@ -77,8 +77,41 @@
% }
+ % if (defined $journey->{arrival_countdown} and $journey->{arrival_countdown} < (20*60)) {
+ % if (my @connections = get_connecting_trains()) {
+ Verbindungen
+
+ % for my $res (@connections) {
+ % my ($train, $via) = @{$res};
+
+ <%= $train->line %> |
+ <%= $via %> |
+ <%= $train->departure->strftime('%H:%M') %>
+ % if ($train->departure_delay) {
+ %= sprintf('(%+d)', $train->departure_delay)
+ % }
+ Gleis <%= $train->platform %> |
+
+ % }
+
+
+ % for my $res (@connections) {
+ % my ($train, $via) = @{$res};
+
+ <%= $train->line %> |
+ <%= $via %> |
+ <%= $train->departure->strftime('%H:%M') %>
+ % if ($train->departure_delay) {
+ %= sprintf('(%+d)', $train->departure_delay)
+ % }
+ | Gleis <%= $train->platform %> |
+
+ % }
+
+ % }
+ % }
% if (defined $journey->{arrival_countdown} and $journey->{arrival_countdown} <= 0) {
-
+
Der automatische Checkout erfolgt in wenigen Minuten. Zum Umsteigen:
Aktuelle Station erneut in der Liste auswählen. Zum Weiterfahren im
aktuellen Zug: Neues Ziel wählen.
--
cgit v1.2.3