summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-01-16 20:32:32 +0100
committerDaniel Friesel <derf@finalrewind.org>2019-01-16 20:32:32 +0100
commitf9ef51bdb6f6e2de74f699442f748db5c565d1f3 (patch)
tree1dca0cd885b607f6123ca49656eccb804b391fdd
parent14966d5a6e71d7394fa05b4cf722a5b1512c547a (diff)
show previous route as well
-rw-r--r--index.pl7
l---------public/static/v6 (renamed from public/static/v5)0
-rw-r--r--templates/app.html.ep69
-rw-r--r--templates/layouts/default.html.ep2
4 files changed, 56 insertions, 22 deletions
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/v6
index 945c9b4..945c9b4 120000
--- a/public/static/v5
+++ b/public/static/v6
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}}) {
- <div class="mroute">
- Über:
-% my $first = 0;
-% for my $stop (@{$departure->{route_post_diff} // q{???}}) {
-% if ($first++) {
- <span class="separator">–</span>
+% if (@{$departure->{route_pre_diff}}) {
+ <div class="mroute">
+ Von:
+% my $first = 0;
+% for my $stop (@{$departure->{route_pre_diff}}) {
+% if ($first++) {
+ <span class="separator">–</span>
+% }
+ <a href="/<%= $stop->{name} %>#<%= $departure->{train_type} . $departure->{train_no} %>" class="
+% if ($stop->{isAdditional}) {
+ additional-stop
+% }
+% elsif ($stop->{isCancelled}) {
+ cancelled-stop
+% }
+% elsif ($self->is_important($stop->{name})) {
+ important-stop
+% }
+% else {
+ generic-stop
+% }
+ "><%= $stop->{name} %></a>
% }
- <a href="/<%= $stop->{name} %>#<%= $departure->{train_type} . $departure->{train_no} %>" class="
-% if ($stop->{isAdditional}) {
- additional-stop
-% }
-% elsif ($stop->{isCancelled}) {
- cancelled-stop
-% }
-% elsif ($self->is_important($stop->{name})) {
- important-stop
-% }
-% else {
- generic-stop
+ </div> <!-- mroute -->
+% }
+% if (@{$departure->{route_post_diff}}) {
+ <div class="mroute">
+ Nach:
+% my $first = 0;
+% for my $stop (@{$departure->{route_post_diff}}) {
+% if ($first++) {
+ <span class="separator">–</span>
+% }
+ <a href="/<%= $stop->{name} %>#<%= $departure->{train_type} . $departure->{train_no} %>" class="
+% if ($stop->{isAdditional}) {
+ additional-stop
+% }
+% elsif ($stop->{isCancelled}) {
+ cancelled-stop
+% }
+% elsif ($self->is_important($stop->{name})) {
+ important-stop
+% }
+% else {
+ generic-stop
+% }
+ "><%= $stop->{name} %></a>
% }
- "><%= $stop->{name} %></a>
-% }
- </div> <!-- mroute -->
+ </div> <!-- mroute -->
+% }
% }
% 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 @@
<meta http-equiv="refresh" content="<%= $self->stash('refresh_interval') %>"/>
% }
- % 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;