From f9ef51bdb6f6e2de74f699442f748db5c565d1f3 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 16 Jan 2019 20:32:32 +0100 Subject: show previous route as well --- index.pl | 7 ++++ public/static/v5 | 1 - public/static/v6 | 1 + templates/app.html.ep | 69 +++++++++++++++++++++++++++------------ templates/layouts/default.html.ep | 2 +- 5 files changed, 57 insertions(+), 23 deletions(-) delete mode 120000 public/static/v5 create mode 120000 public/static/v6 diff --git a/index.pl b/index.pl index 7bf6e5f..c502d3e 100644 --- a/index.pl +++ b/index.pl @@ -797,6 +797,13 @@ sub handle_request { train_no => $result->train_no, via => [ $result->route_interesting(3) ], scheduled_route => [ $result->sched_route ], + route_pre => [ $result->route_pre ], + route_pre_diff => [ + $self->json_route_diff( + [ $result->route_pre ], + [ $result->sched_route_pre ] + ) + ], route_post => [ $result->route_post ], route_post_diff => [ $self->json_route_diff( diff --git a/public/static/v5 b/public/static/v5 deleted file mode 120000 index 945c9b4..0000000 --- a/public/static/v5 +++ /dev/null @@ -1 +0,0 @@ -. \ No newline at end of file diff --git a/public/static/v6 b/public/static/v6 new file mode 120000 index 0000000..945c9b4 --- /dev/null +++ b/public/static/v6 @@ -0,0 +1 @@ +. \ No newline at end of file diff --git a/templates/app.html.ep b/templates/app.html.ep index 5c511ce..b2dd257 100644 --- a/templates/app.html.ep +++ b/templates/app.html.ep @@ -158,29 +158,56 @@ % } % if ($departure->{route_post_diff} and @{$departure->{route_post_diff}}) { -
- Über: -% my $first = 0; -% for my $stop (@{$departure->{route_post_diff} // q{???}}) { -% if ($first++) { - +% if (@{$departure->{route_pre_diff}}) { +
+ Von: +% my $first = 0; +% for my $stop (@{$departure->{route_pre_diff}}) { +% if ($first++) { + +% } + <%= $stop->{name} %> % } - + Nach: +% my $first = 0; +% for my $stop (@{$departure->{route_post_diff}}) { +% if ($first++) { + +% } + <%= $stop->{name} %> % } - "><%= $stop->{name} %> -% } -
+
+% } % } % if ($departure->{moreinfo} and @{$departure->{moreinfo}}) { Meldungen: diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep index 4da20b6..d039e10 100644 --- a/templates/layouts/default.html.ep +++ b/templates/layouts/default.html.ep @@ -8,7 +8,7 @@ % } - % my $av = 'v5'; # asset version + % my $av = 'v6'; # asset version %= stylesheet "/static/${av}/default.css" %= stylesheet "/static/${av}/jquery-ui.min.css" % my $force_mobile = param('force_mobile') // -1; -- cgit v1.2.3