diff options
-rw-r--r-- | index.pl | 19 | ||||
-rw-r--r-- | templates/clean.html.ep | 8 |
2 files changed, 18 insertions, 9 deletions
@@ -464,6 +464,9 @@ sub handle_request { if ( $result->is_cancelled ) { $info = "Fahrt fällt aus: ${delaymsg}"; } + elsif ( $result->departure_is_cancelled ) { + $info = "Zug endet hier: ${delaymsg}"; + } elsif ( $result->delay and $result->delay > 0 ) { if ( $template eq 'clean' ) { $info = $delaymsg; @@ -759,13 +762,15 @@ sub handle_request { [ $result->sched_route_post ] ) ], - destination => $result->destination, - origin => $result->origin, - platform => $result->platform, - scheduled_platform => $result->sched_platform, - info => $info, - is_cancelled => $result->is_cancelled, - messages => { + destination => $result->destination, + origin => $result->origin, + platform => $result->platform, + scheduled_platform => $result->sched_platform, + info => $info, + is_cancelled => $result->is_cancelled, + departure_is_cancelled => $result->departure_is_cancelled, + arrival_is_cancelled => $result->arrival_is_cancelled, + messages => { delay => [ map { { timestamp => $_->[0], text => $_->[1] } } $result->delay_messages diff --git a/templates/clean.html.ep b/templates/clean.html.ep index 41dddc6..1c64c20 100644 --- a/templates/clean.html.ep +++ b/templates/clean.html.ep @@ -14,7 +14,7 @@ % $route_str .= $stop . ($via_cur < $via_max ? ' - ' : q{}); % } % my $extraclasses = q{}; -% if ($departure->{is_cancelled}) { +% if ($departure->{is_cancelled} or $departure->{departure_is_cancelled}) { % $extraclasses .= ' cancelled'; <li class="cancelled"> % } @@ -79,7 +79,11 @@ <div class="minfo">Fahrt fällt aus</div> % } % elsif (defined $departure->{delay} and $departure->{delay} > 0) { - <div class="minfo">+<%= $departure->{delay} %></div> + <div class="minfo">+<%= $departure->{delay} %> +% if ($departure->{departure_is_cancelled}) { + (endet hier) +% } + </div> % } % if (@{$departure->{replaced_by}}) { % for my $replacement (@{$departure->{replaced_by}}) { |