Loading lib/DBInfoscreen.pm +2 −1 Original line number Diff line number Diff line Loading @@ -281,7 +281,8 @@ sub startup { $r->get('/map/:tripid/:lineno')->to('map#route'); $r->get( '/z/:train/*station' => 'train_at_station' ) ->to('stationboard#station_train_details'); $r->get( '/z/:train' => 'train' )->to('stationboard#train_details'); $r->get( '/z/:train' => [ format => [ 'html', 'json' ] ] ) ->to( 'stationboard#train_details', format => undef )->name('train'); $self->defaults( layout => 'app' ); Loading lib/DBInfoscreen/Controller/Stationboard.pm +37 −19 Original line number Diff line number Diff line Loading @@ -1303,8 +1303,16 @@ sub train_details { $res->{details} = [@him_details]; } $self->render( $self->param('ajax') ? '_train_details' : 'train_details', $self->respond_to( json => { json => { journey => $journey, }, }, any => { template => $self->param('ajax') ? '_train_details' : 'train_details', description => sprintf( '%s %s%s%s nach %s', $res->{train_type}, Loading @@ -1316,21 +1324,31 @@ sub train_details { departure => $res, linetype => $linetype, dt_now => DateTime->now( time_zone => 'Europe/Berlin' ), }, ); } )->catch( sub { my ($e) = @_; if ($e) { $self->render( 'exception', $self->respond_to( json => { json => { error => $e, }, status => 500, }, any => { template => 'exception', message => $e, exception => undef, snapshot => {} snapshot => {}, status => 500, }, ); } else { $self->render('not_found'); $self->render( 'not_found', status => 404 ); } } )->wait; Loading Loading
lib/DBInfoscreen.pm +2 −1 Original line number Diff line number Diff line Loading @@ -281,7 +281,8 @@ sub startup { $r->get('/map/:tripid/:lineno')->to('map#route'); $r->get( '/z/:train/*station' => 'train_at_station' ) ->to('stationboard#station_train_details'); $r->get( '/z/:train' => 'train' )->to('stationboard#train_details'); $r->get( '/z/:train' => [ format => [ 'html', 'json' ] ] ) ->to( 'stationboard#train_details', format => undef )->name('train'); $self->defaults( layout => 'app' ); Loading
lib/DBInfoscreen/Controller/Stationboard.pm +37 −19 Original line number Diff line number Diff line Loading @@ -1303,8 +1303,16 @@ sub train_details { $res->{details} = [@him_details]; } $self->render( $self->param('ajax') ? '_train_details' : 'train_details', $self->respond_to( json => { json => { journey => $journey, }, }, any => { template => $self->param('ajax') ? '_train_details' : 'train_details', description => sprintf( '%s %s%s%s nach %s', $res->{train_type}, Loading @@ -1316,21 +1324,31 @@ sub train_details { departure => $res, linetype => $linetype, dt_now => DateTime->now( time_zone => 'Europe/Berlin' ), }, ); } )->catch( sub { my ($e) = @_; if ($e) { $self->render( 'exception', $self->respond_to( json => { json => { error => $e, }, status => 500, }, any => { template => 'exception', message => $e, exception => undef, snapshot => {} snapshot => {}, status => 500, }, ); } else { $self->render('not_found'); $self->render( 'not_found', status => 404 ); } } )->wait; Loading