summaryrefslogtreecommitdiff
path: root/lib/DBInfoscreen.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-12-14 19:18:19 +0100
committerDaniel Friesel <derf@finalrewind.org>2020-12-14 19:18:19 +0100
commit4609b7312d67063b2cb0d5803260d7dc25475bc2 (patch)
tree5ef3cf76763c9bd883838bc2dd161fb565d86e2e /lib/DBInfoscreen.pm
parent3c85cd22395be60462959ee7d3cf59d0e939b6a3 (diff)
show expected wagon order whan real-time data is not available
work in progress.
Diffstat (limited to 'lib/DBInfoscreen.pm')
-rw-r--r--lib/DBInfoscreen.pm13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/DBInfoscreen.pm b/lib/DBInfoscreen.pm
index b04fb03..0ee9493 100644
--- a/lib/DBInfoscreen.pm
+++ b/lib/DBInfoscreen.pm
@@ -90,17 +90,25 @@ sub startup {
$self->attr(
ice_type_map => sub {
my $ice_type_map = JSON->new->utf8->decode(
- scalar read_file('share/ice_type.json') );
+ scalar read_file('share/zugbildungsplan.json') );
my $ret;
while ( my ( $k, $v ) = each %{$ice_type_map} ) {
if ( $v->{type} ) {
- $ret->{$k} = [ $v->{type}, $v->{short} ];
+ $ret->{$k}
+ = [ $v->{type}, $v->{short}, exists $v->{wagon} ? 1 : 0 ];
}
}
return $ret;
}
);
+ $self->attr(
+ train_details_db => sub {
+ return JSON->new->utf8->decode(
+ scalar read_file('share/zugbildungsplan.json') );
+ }
+ );
+
$self->helper(
hafas => sub {
my ($self) = @_;
@@ -395,6 +403,7 @@ sub startup {
$r->get('/_impressum')->to('static#imprint');
$r->get('/_wr/:train/:departure')->to('wagenreihung#wagenreihung');
+ $r->get('/zb-db/:train')->to('wagenreihung#zugbildung_db');
$r->get('/_ajax_mapinfo/:tripid/:lineno')->to('map#ajax_route');
$r->get('/map/:tripid/:lineno')->to('map#route');