summaryrefslogtreecommitdiff
path: root/index.pl
diff options
context:
space:
mode:
Diffstat (limited to 'index.pl')
-rw-r--r--index.pl21
1 files changed, 21 insertions, 0 deletions
diff --git a/index.pl b/index.pl
index d274caa..f270a23 100644
--- a/index.pl
+++ b/index.pl
@@ -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 );