diff options
author | Daniel Friesel <derf@finalrewind.org> | 2022-07-26 14:51:57 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2022-07-26 14:51:57 +0200 |
commit | 960de27f0eca0fcb2549c8271a384230c4a6b06f (patch) | |
tree | 43514cc0c80092b28439c6e7039b8968cf131a33 /lib/Travelynx/Controller | |
parent | 35338125bcf5c503ec57b857ed2d11c547eca4ab (diff) |
move get_connecting_trains out of _cancelled_departure template
Diffstat (limited to 'lib/Travelynx/Controller')
-rwxr-xr-x | lib/Travelynx/Controller/Traveling.pm | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm index 937c740..991526e 100755 --- a/lib/Travelynx/Controller/Traveling.pm +++ b/lib/Travelynx/Controller/Traveling.pm @@ -351,8 +351,15 @@ sub status_card { $self->render( '_checked_in', journey => $status ); } elsif ( $status->{cancellation} ) { - $self->render( '_cancelled_departure', - journey => $status->{cancellation} ); + my @connecting_trains = $self->get_connecting_trains( + eva => $status->{cancellation}{dep_eva}, + destination_name => $status->{cancellation}{arr_name} + ); + $self->render( + '_cancelled_departure', + journey => $status->{cancellation}, + connections => \@connecting_trains + ); } else { $self->render( '_checked_out', journey => $status ); @@ -628,8 +635,17 @@ sub station { = grep { $_->type . ' ' . $_->train_no eq $train } @results; } else { - @connecting_trains = $self->get_connecting_trains( - eva => $status->{station_eva} ); + my $user = $self->get_user_status; + if ( $user->{cancellation} ) { + @connecting_trains = $self->get_connecting_trains( + eva => $user->{cancellation}{dep_eva}, + destination_name => $user->{cancellation}{arr_name} + ); + } + else { + @connecting_trains = $self->get_connecting_trains( + eva => $status->{station_eva} ); + } } $self->render( |