diff options
Diffstat (limited to 'lib/DBInfoscreen.pm')
-rw-r--r-- | lib/DBInfoscreen.pm | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/lib/DBInfoscreen.pm b/lib/DBInfoscreen.pm index c33a703..1fd3674 100644 --- a/lib/DBInfoscreen.pm +++ b/lib/DBInfoscreen.pm @@ -187,9 +187,27 @@ sub startup { my ( $self, $occupancy ) = @_; my @symbols - = (qw(help_outline person_outline people priority_high)); + = ( + qw(help_outline person_outline people priority_high not_interested) + ); my $text = 'Auslastung unbekannt'; + if ( $occupancy eq 'MANY_SEATS' ) { + $occupancy = 1; + } + elsif ( $occupancy eq 'FEW_SEATS' ) { + $occupancy = 2; + } + elsif ( $occupancy eq 'STANDING_ONLY' ) { + $occupancy = 3; + } + elsif ( $occupancy eq 'FULL' ) { + $occupancy = 4; + } + + if ( $occupancy > 3 ) { + $text = 'Voraussichtlich überfüllt'; + } if ( $occupancy > 2 ) { $text = 'Sehr hohe Auslastung erwartet'; } @@ -279,15 +297,18 @@ sub startup { $r->get('/_ajax_mapinfo/:tripid/:lineno')->to('map#ajax_route'); $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/*station' => [ format => [ 'html', 'json' ] ] ) + ->to( 'stationboard#station_train_details', format => undef ) + ->name('train_at_station'); + $r->get( '/z/:train' => [ format => [ 'html', 'json' ] ] ) + ->to( 'stationboard#train_details', format => undef )->name('train'); $self->defaults( layout => 'app' ); $r->get('/')->to('stationboard#handle_request'); $r->get('/multi/*station')->to('stationboard#handle_request'); - $r->get('/*station')->to('stationboard#handle_request'); + $r->get( '/*station' => [ format => [ 'html', 'json' ] ] ) + ->to( 'stationboard#handle_request', format => undef ); $self->types->type( json => 'application/json; charset=utf-8' ); |