% if (@{$departures}) {
% my $i = 0;
% for my $departure (@{$departures}) {
% $i++;
% my $route_str = q{};
% my $via_max = @{$departure->{via}};
% my $via_cur = 0;
% for my $stop (@{$departure->{via}}) {
% $via_cur++;
% $route_str .= $stop . ($via_cur < $via_max ? ' - ' : q{});
% }
% my $extraclasses = q{};
% if ($departure->{is_cancelled}) {
% $extraclasses .= ' cancelled';
% }
-
% my $linetype = q{};
% if ( $departure->{train} =~ m{ ^ S \s? \d{1,2} $ }x ) {
% $linetype = 'sbahn';
% }
% if (@{$departure->{replaced_by}} or @{$departure->{replacement_for}}) {
% for my $replacement (@{$departure->{replaced_by}}) {
→ <%= $replacement %>
% }
% for my $replacement (@{$departure->{replacement_for}}) {
↑ <%= $replacement %>
% }
% }
% if (not $departure->{is_cancelled}) {
% if ($departure->{sched_arrival}) {
Ankunft: <%= $departure->{sched_arrival} %>
% if ($departure->{arrival} and $departure->{arrival} ne $departure->{sched_arrival}) {
(heute: <%= $departure->{arrival} %>)
% }
% }
% if ($departure->{sched_departure}) {
Abfahrt: <%= $departure->{sched_departure} %>
% if ($departure->{departure} and $departure->{departure} ne $departure->{sched_departure}) {
(heute: <%= $departure->{departure} %>)
% }
% }
% }
% if ($departure->{route_post} and @{$departure->{route_post}}) {
Über: <%= join(' – ', @{$departure->{route_post} // q{???}}) %>
% }
% if ($departure->{moreinfo} and @{$departure->{moreinfo}}) {
Meldungen:
% for my $pair (@{$departure->{moreinfo}}) {
-
% if ($pair->[0]->isa('DateTime')) {
%= $pair->[0]->strftime('%H:%M')
% }
% else {
%= $pair->[0]
% }
:
%= $pair->[1]
% }
% }
% if ($departure->{info} and length $departure->{info}) {
%= $departure->{info}
% }
% else {
%= $route_str
% }
% if ($departure->{delay} and not $departure->{is_cancelled}) {
% if ($show_realtime) {
% if ($departure->{delay} > 0) {
(+<%= $departure->{delay} %>)
% }
% else {
(<%= $departure->{delay} %>)
% }
% }
% else {
% if ($departure->{delay} > 0) {
(+<%= $departure->{delay} %>)
% }
% else {
(<%= $departure->{delay} %>)
% }
% }
% }
% if ($show_realtime and $departure->{delay} and not $departure->{is_cancelled}) {
% }
%= $departure->{time}
% if ($show_realtime and $departure->{delay} and not $departure->{is_cancelled}) {
% }
% }
% }
% else {
No matching departures
% }