% if (@{$departures}) {
% my $i = 0;
% my $dt_now = DateTime->now;
% 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';
-
% }
% else {
-
% }
% my $linetype = 'bahn';
% if ( $departure->{train_type} eq 'S' ) {
% $linetype = 'sbahn';
% }
% elsif ( $departure->{train_type} eq 'IC'
% or $departure->{train_type} eq 'ICE'
% or $departure->{train_type} eq 'EC' ) {
% $linetype = 'fern';
% }
% if ($departure->{train_type} and $departure->{train_no}) {
%= $departure->{train_type}
% }
% if ($departure->{train_line} ) {
%= $departure->{train_line}
% }
% elsif ($departure->{train_no}) {
<%= $departure->{train_no} %>
% }
% else {
%= $departure->{train}
% }
% if (@{$departure->{replaced_by}} or @{$departure->{replacement_for}}) {
% for my $replacement (@{$departure->{replaced_by}}) {
→ <%= $replacement %>
% }
% for my $replacement (@{$departure->{replacement_for}}) {
↑ <%= $replacement %>
% }
% }
% if ($departure->{info} and length $departure->{info}) {
%= $departure->{info}
% }
% else {
%= $route_str
% }
% }
% }
% else {
Keine Abfahrten gefunden.
Möglicherweise ist der Filter zu restriktiv, oder an dieser Station fahren
momentan keine Züge.
% }