diff options
author | Daniel Friesel <derf@finalrewind.org> | 2018-11-26 18:33:50 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2018-11-26 18:33:50 +0100 |
commit | 9e92134e0441444f46f11c244d80081809f41fcb (patch) | |
tree | cedb58a93f7825b355367c3c74fbfe28851e8302 /index.pl | |
parent | b41f8a18ce3878e06345d0faf70b0e1e57407e8e (diff) |
add quick&dirty wagon order integration
Diffstat (limited to 'index.pl')
-rw-r--r-- | index.pl | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -6,6 +6,7 @@ use Cache::File; use File::Slurp qw(read_file write_file); use List::Util qw(max); use List::MoreUtils qw(); +use Travel::Status::DE::DBWagenreihung; use Travel::Status::DE::HAFAS; use Travel::Status::DE::HAFAS::StopFinder; use Travel::Status::DE::IRIS; @@ -824,6 +825,9 @@ sub handle_request { map { $_->type . q{ } . $_->train_no } $result->replacement_for ], + wr_link => $result->sched_departure + ? $result->sched_departure->strftime('%Y%m%d%H%M') + : undef, } ); } @@ -1010,6 +1014,23 @@ get '/_impressum' => sub { $self->render( 'imprint', hide_opts => 1 ); }; +get '/_wr/:train/:departure' => sub { + my $self = shift; + my $train = $self->stash('train'); + my $departure = $self->stash('departure'); + + my $wr = Travel::Status::DE::DBWagenreihung->new( + departure => $departure, + train_number => $train, + ); + + $self->render( + 'wagenreihung', + wr => $wr, + hide_opts => 1, + ); +}; + app->defaults( layout => 'default' ); app->sessions->default_expiration( 3600 * 24 * 28 ); |