From 7789f8202f60f69ce015b1bc34eb0c076d7545b5 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 24 May 2020 18:38:08 +0200 Subject: animate train position in map --- templates/_map_infobox.html.ep | 61 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 templates/_map_infobox.html.ep (limited to 'templates/_map_infobox.html.ep') diff --git a/templates/_map_infobox.html.ep b/templates/_map_infobox.html.ep new file mode 100644 index 0000000..8f66a6f --- /dev/null +++ b/templates/_map_infobox.html.ep @@ -0,0 +1,61 @@ +
+
+ Fahrt + % if (stash('train_no')) { + <%= stash('train_no') %> + % } + von <%= stash('origin')->{name} %> + nach <%= stash('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}) + % } + % } + % elsif ($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