summaryrefslogtreecommitdiff
path: root/templates/route_map.html.ep
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-01-05 18:37:55 +0100
committerDaniel Friesel <derf@finalrewind.org>2020-01-05 18:37:55 +0100
commitdaad7cff7f39609f61e39a641a8928f56443d106 (patch)
tree0e167f18c0ce6a8c420e8cfac9bd61ab93343a84 /templates/route_map.html.ep
parentc6a7909fd5814ab768db5dfa8e9fea2e92525362 (diff)
map: show current / next stop name, arrival/departure time and platform2.5.7
Diffstat (limited to 'templates/route_map.html.ep')
-rw-r--r--templates/route_map.html.ep60
1 files changed, 56 insertions, 4 deletions
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 @@
-<div class="container" style="margin-top: 1ex; margin-bottom: 1ex;">
-Fahrt von <strong><%= $origin->{name} %></strong>
-nach <strong><%= $destination->{name} %></strong>
-</div>
+% if ($origin and $destination) {
+ <div class="container" style="margin-top: 1ex; margin-bottom: 1ex;">
+ Fahrt
+ % if (stash('train_no')) {
+ <strong><%= stash('train_no') %></strong>
+ % }
+ von <strong><%= $origin->{name} %></strong>
+ nach <strong><%= $destination->{name} %></strong>
+ % if (my $next = stash('next_stop')) {
+ <br/>
+ % if ($next->{type} eq 'present' and $next->{station}{dep} and $next->{station}{arr}) {
+ Aufenthalt in <strong><%= $next->{station}{name} %></strong>
+ an Gleis <strong><%= $next->{station}{platform} %></strong>
+ bis <strong><%= $next->{station}{dep}->strftime('%H:%M') %></strong>
+ % if ($next->{station}{dep_delay}) {
+ %= sprintf('(%+d)', $next->{station}{dep_delay})
+ % }
+ % }
+ % if ($next->{type} eq 'present' and $next->{station}{dep}) {
+ Abfahrt in <strong><%= $next->{station}{name} %></strong>
+ von Gleis <strong><%= $next->{station}{platform} %></strong>
+ um <strong><%= $next->{station}{dep}->strftime('%H:%M') %></strong>
+ % if ($next->{station}{dep_delay}) {
+ %= sprintf('(%+d)', $next->{station}{dep_delay})
+ % }
+ % }
+ % elsif ($next->{type} eq 'present' and $next->{station}{arr}) {
+ Endstation erreicht um
+ <strong><%= $next->{station}{arr}->strftime('%H:%M') %></strong>
+ auf Gleis <strong><%= $next->{station}{platform} %></strong>
+ % if ($next->{station}{arr_delay}) {
+ %= sprintf('(%+d)', $next->{station}{arr_delay})
+ % }
+ % }
+ % elsif ($next->{type} eq 'present') {
+ Zug steht in
+ <strong><%= $next->{station}{arr}->strftime('%H:%M') %></strong>
+ auf Gleis <strong><%= $next->{station}{platform} %></strong>
+ % }
+ % elsif ($next->{type} eq 'next' and $next->{station}{arr}) {
+ Nächster Halt:
+ <strong><%= $next->{station}{name} %></strong>
+ um <strong><%= $next->{station}{arr}->strftime('%H:%M') %></strong>
+ % if ($next->{station}{arr_delay}) {
+ %= sprintf('(%+d)', $next->{station}{arr_delay})
+ % }
+ auf Gleis <strong><%= $next->{station}{platform} %></strong>
+ % }
+ % elsif ($next->{type} eq 'next') {
+ Nächster Halt:
+ <strong><%= $next->{station}{name} %></strong>
+ auf Gleis <strong><%= $next->{station}{platform} %></strong>
+ % }
+ % }
+ </div>
+% }
<div class="container">
<div id="map" style="height: 500px;">