summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Travelynx/Controller')
-rwxr-xr-xlib/Travelynx/Controller/Traveling.pm25
1 files changed, 18 insertions, 7 deletions
diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm
index ce4ab8e..937c740 100755
--- a/lib/Travelynx/Controller/Traveling.pm
+++ b/lib/Travelynx/Controller/Traveling.pm
@@ -622,10 +622,15 @@ sub station {
map { [ $_, $_->departure->epoch // $_->sched_departure->epoch ] }
@results;
+ my @connecting_trains;
if ($train) {
@results
= grep { $_->type . ' ' . $_->train_no eq $train } @results;
}
+ else {
+ @connecting_trains = $self->get_connecting_trains(
+ eva => $status->{station_eva} );
+ }
$self->render(
'departures',
@@ -633,19 +638,25 @@ sub station {
results => \@results,
station => $status->{station_name},
related_stations => $status->{related_stations},
+ connections => \@connecting_trains,
title => "travelynx: $status->{station_name}",
);
}
)->catch(
sub {
my ($status) = @_;
- $self->render(
- 'landingpage',
- version => $self->app->config->{version} // 'UNKNOWN',
- with_autocomplete => 1,
- with_geolocation => 1,
- error => $status->{errstr}
- );
+ if ( $status->{errstr} ) {
+ $self->render(
+ 'landingpage',
+ version => $self->app->config->{version} // 'UNKNOWN',
+ with_autocomplete => 1,
+ with_geolocation => 1,
+ error => $status->{errstr}
+ );
+ }
+ else {
+ $self->render( 'exception', exception => $status );
+ }
}
)->wait;
$self->users->mark_seen( uid => $self->current_user->{id} );