diff options
Diffstat (limited to 'lib/DBInfoscreen.pm')
-rw-r--r-- | lib/DBInfoscreen.pm | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/lib/DBInfoscreen.pm b/lib/DBInfoscreen.pm index c784e96..d5ed88f 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'; } @@ -255,6 +273,25 @@ sub startup { } ); + $self->helper( + 'get_rt_time_class' => sub { + my ( $self, $train ) = @_; + if ( $train->{has_realtime} + and not $train->{is_bit_delayed} + and not $train->{is_delayed} ) + { + return 'on-time'; + } + if ( $train->{is_bit_delayed} ) { + return 'a-bit-delayed'; + } + if ( $train->{is_delayed} ) { + return 'delayed'; + } + return q{}; + } + ); + my $r = $self->routes; $r->get('/_redirect')->to('stationboard#redirect_to_station'); @@ -264,6 +301,8 @@ sub startup { $r->get('/_autostop')->to('static#geostop'); + $r->get('/_backend')->to('stationboard#backend_list'); + $r->get('/_datenschutz')->to('static#privacy'); $r->post('/_geolocation')->to('stationboard#stations_by_coordinates'); @@ -274,11 +313,12 @@ sub startup { $r->get('/dyn/:av/autocomplete.js')->to('stationboard#autocomplete'); - $r->get('/_wr/:train/:departure')->to('wagenreihung#wagenreihung'); + $r->get('/carriage-formation')->to('wagenreihung#wagenreihung'); $r->get('/w/*wagon')->to('wagenreihung#wagen'); $r->get('/_ajax_mapinfo/:tripid/:lineno')->to('map#ajax_route'); $r->get('/map/:tripid/:lineno')->to('map#route'); + $r->get('/coverage/:backend/:service')->to('map#coverage'); $r->get( '/z/:train/*station' => [ format => [ 'html', 'json' ] ] ) ->to( 'stationboard#station_train_details', format => undef ) ->name('train_at_station'); |