From daad7cff7f39609f61e39a641a8928f56443d106 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 5 Jan 2020 18:37:55 +0100 Subject: map: show current / next stop name, arrival/departure time and platform --- templates/route_map.html.ep | 60 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 4 deletions(-) (limited to 'templates') diff --git a/templates/route_map.html.ep b/templates/route_map.html.ep index 4b38fc4..e8473a5 100644 --- a/templates/route_map.html.ep +++ b/templates/route_map.html.ep @@ -1,7 +1,59 @@ -
-Fahrt von <%= $origin->{name} %> -nach <%= $destination->{name} %> -
+% if ($origin and $destination) { +
+ Fahrt + % if (stash('train_no')) { + <%= stash('train_no') %> + % } + von <%= $origin->{name} %> + nach <%= $destination->{name} %> + % if (my $next = stash('next_stop')) { +
+ % if ($next->{type} eq 'present' and $next->{station}{dep} and $next->{station}{arr}) { + Aufenthalt in <%= $next->{station}{name} %> + an Gleis <%= $next->{station}{platform} %> + bis <%= $next->{station}{dep}->strftime('%H:%M') %> + % if ($next->{station}{dep_delay}) { + %= sprintf('(%+d)', $next->{station}{dep_delay}) + % } + % } + % if ($next->{type} eq 'present' and $next->{station}{dep}) { + Abfahrt in <%= $next->{station}{name} %> + von Gleis <%= $next->{station}{platform} %> + um <%= $next->{station}{dep}->strftime('%H:%M') %> + % if ($next->{station}{dep_delay}) { + %= sprintf('(%+d)', $next->{station}{dep_delay}) + % } + % } + % elsif ($next->{type} eq 'present' and $next->{station}{arr}) { + Endstation erreicht um + <%= $next->{station}{arr}->strftime('%H:%M') %> + auf Gleis <%= $next->{station}{platform} %> + % if ($next->{station}{arr_delay}) { + %= sprintf('(%+d)', $next->{station}{arr_delay}) + % } + % } + % elsif ($next->{type} eq 'present') { + Zug steht in + <%= $next->{station}{arr}->strftime('%H:%M') %> + auf Gleis <%= $next->{station}{platform} %> + % } + % elsif ($next->{type} eq 'next' and $next->{station}{arr}) { + Nächster Halt: + <%= $next->{station}{name} %> + um <%= $next->{station}{arr}->strftime('%H:%M') %> + % if ($next->{station}{arr_delay}) { + %= sprintf('(%+d)', $next->{station}{arr_delay}) + % } + auf Gleis <%= $next->{station}{platform} %> + % } + % elsif ($next->{type} eq 'next') { + Nächster Halt: + <%= $next->{station}{name} %> + auf Gleis <%= $next->{station}{platform} %> + % } + % } +
+% }
-- cgit v1.2.3