% if ($error) {
Zugfahrt nicht gefunden.
% if ($journey->{cancelled}) { Ausgefallene Fahrt von % } % else { Fahrt von % } <%= $journey->{from_name} %> nach <%= $journey->{to_name} %> am <%= $journey->{sched_departure}->strftime('%d.%m.%Y') %>
Zug | <%= $journey->{type} %> <%= $journey->{no} %> % if ($journey->{line}) { (Linie <%= $journey->{line} %>) % } |
---|---|
Abfahrt | % if ($journey->{cancelled}) { cancel (Plan: <%= $journey->{sched_departure}->strftime('%H:%M'); %>) % } % elsif ($journey->{rt_departure} != $journey->{sched_departure}) { %= $journey->{rt_departure}->strftime('%H:%M'); (<%= sprintf('%+d', ($journey->{rt_departure}->epoch - $journey->{sched_departure}->epoch) / 60) %>, Plan: <%= $journey->{sched_departure}->strftime('%H:%M'); %>) % } % else { %= $journey->{sched_departure}->strftime('%H:%M'); % } |
Ankunft | % if ($journey->{cancelled}) { cancel % if ($journey->{sched_arrival}->epoch != 0) { (Plan: <%= $journey->{sched_arrival}->strftime('%H:%M'); %>) % } % } % elsif ($journey->{rt_arrival}->epoch == 0 and $journey->{sched_arrival}->epoch == 0) { timer_off % } % elsif ($journey->{rt_arrival} != $journey->{sched_arrival}) { %= $journey->{rt_arrival}->strftime('%H:%M'); (<%= sprintf('%+d', ($journey->{rt_arrival}->epoch - $journey->{sched_arrival}->epoch) / 60) %>, Plan: <%= $journey->{sched_arrival}->strftime('%H:%M'); %>) % } % else { %= $journey->{sched_arrival}->strftime('%H:%M'); % } |
Entfernung | % my $distance = get_travel_distance($journey->{from_name}, $journey->{to_name}, $journey->{route}); % my $beeline = get_travel_distance($journey->{from_name}, $journey->{to_name}, [$journey->{from_name}, $journey->{to_name}]); % if ($distance > 0.1) { ca. <%= sprintf('%.f', $distance) %> km % } (Luftlinie: <%= sprintf('%.f', $beeline) %> km) |
Meldungen |
% for my $message (@{$journey->{messages} // []}) {
% my ($ts, $msg) = @{$message};
<%= $ts->strftime('%d.%m.%Y %H:%M') %> : <%= $msg %> % } |
Route |
% my $within = 0;
% my $at_startstop = 0;
% for my $station (@{$journey->{route}}) {
% if ($station eq $journey->{from_name}) {
% $within = 1; $at_startstop = 1;
% }
% elsif ($station eq $journey->{to_name}) {
% $within = 0; $at_startstop = 1;
% }
% else {
% $at_startstop = 0;
% }
% if ($at_startstop or $within) {
<%= $station %>
% }
% else {
<%= $station %>
% }
% } |