summaryrefslogtreecommitdiff
path: root/index.pl
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-05-07 19:08:16 +0200
committerDaniel Friesel <derf@finalrewind.org>2015-05-07 19:08:16 +0200
commitd57aea18371f939c8e84ebf9af04a7dd9c6a8033 (patch)
tree8b2259b20412104171e87be6f393b198f5de5883 /index.pl
parenta772bb7fef43421ed18a52b1cb1d7bd010e3cf93 (diff)
more details in moreinfo popup0.07
Diffstat (limited to 'index.pl')
-rw-r--r--index.pl46
1 files changed, 35 insertions, 11 deletions
diff --git a/index.pl b/index.pl
index 652ea60..3b698e8 100644
--- a/index.pl
+++ b/index.pl
@@ -250,13 +250,12 @@ sub handle_request {
$result->delay, $delaymsg ? q{: } : q{}, $delaymsg );
}
}
- if ( $result->replacement_for and $template ne 'clean') {
- for my $rep ($result->replacement_for) {
- $info = sprintf('Ersatzzug für %s %s %s%s',
- $rep->type,
- $rep->train_no,
- $info ? '+++ ' : q{},
- $info // q{}
+ if ( $result->replacement_for and $template ne 'clean' ) {
+ for my $rep ( $result->replacement_for ) {
+ $info = sprintf(
+ 'Ersatzzug für %s %s %s%s',
+ $rep->type, $rep->train_no,
+ $info ? '+++ ' : q{}, $info // q{}
);
}
}
@@ -426,11 +425,28 @@ sub handle_request {
push(
@departures,
{
- time => $time,
+ time => $time,
+ sched_arrival => $result->sched_arrival
+ ? $result->sched_arrival->strftime('%H:%M')
+ : undef,
+ sched_departure => $result->sched_departure
+ ? $result->sched_departure->strftime('%H:%M')
+ : undef,
+ arrival => $result->arrival
+ ? $result->arrival->strftime('%H:%M')
+ : undef,
+ departure => $result->departure
+ ? $result->departure->strftime('%H:%M')
+ : undef,
train => $result->train,
+ train_type => $result->type,
+ train_line => $result->line_no,
+ train_no => $result->train_no,
via => [ $result->route_interesting(3) ],
scheduled_route => [ $result->sched_route ],
+ route_post => [ $result->route_post ],
destination => $result->destination,
+ origin => $result->origin,
platform => $platform,
info => $info,
is_cancelled => $result->can('is_cancelled')
@@ -451,9 +467,17 @@ sub handle_request {
additional_stops => [ $result->additional_stops ],
canceled_stops => [ $result->canceled_stops ],
replaced_by => $result->can('replaced_by')
- ? [ map { $_->type . q{ } . $_->train_no } $result->replaced_by ] : [],
- replacement_for => $result->can('replacement_for')
- ? [ map { $_->type . q{ } . $_->train_no } $result->replacement_for ] : [],
+ ? [
+ map { $_->type . q{ } . $_->train_no }
+ $result->replaced_by
+ ]
+ : [],
+ replacement_for => $result->can('replacement_for')
+ ? [
+ map { $_->type . q{ } . $_->train_no }
+ $result->replacement_for
+ ]
+ : [],
}
);
}