From 1725719f07c99e7de67fa6b2981d060c1a385d81 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 5 Jun 2015 10:41:46 +0200 Subject: clean template: indicate changed platforms --- index.pl | 17 +++++++++-------- public/default.css | 4 ++++ templates/clean.html.ep | 12 +++++++++--- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/index.pl b/index.pl index 46a9c66..b1c61dd 100644 --- a/index.pl +++ b/index.pl @@ -116,7 +116,7 @@ helper 'json_route_diff' => sub { push( @json_route, { - name => $route[ $route_idx ], + name => $route[$route_idx], isAdditional => 1, isCancelled => 0 } @@ -127,7 +127,7 @@ helper 'json_route_diff' => sub { push( @json_route, { - name => $sched_route[ $sched_idx ], + name => $sched_route[$sched_idx], isAdditional => 0, isCancelled => 1 } @@ -497,12 +497,13 @@ sub handle_request { [ $result->sched_route_post ] ) ], - destination => $result->destination, - origin => $result->origin, - platform => $platform, - info => $info, - is_cancelled => $result->is_cancelled, - messages => { + destination => $result->destination, + origin => $result->origin, + platform => $platform, + scheduled_platform => $result->sched_platform, + info => $info, + is_cancelled => $result->is_cancelled, + messages => { delay => [ map { { timestamp => $_->[0], text => $_->[1] } } $result->delay_messages diff --git a/public/default.css b/public/default.css index 68706db..74c6bae 100644 --- a/public/default.css +++ b/public/default.css @@ -238,6 +238,10 @@ div.displayclean li .countdown .platform { font-weight: bold; } +div.displayclean li .countdown .changed-platform { + color:#ff0000; +} + div.displayclean li .time { color:#000000; font-size:2.4em; diff --git a/templates/clean.html.ep b/templates/clean.html.ep index 61ee6d6..2eb63ea 100644 --- a/templates/clean.html.ep +++ b/templates/clean.html.ep @@ -71,7 +71,7 @@ % elsif (defined $departure->{delay} and $departure->{delay} > 0) {
+<%= $departure->{delay} %>
% } - + % if (not $departure->{is_cancelled}) {
% if ($departure->{sched_arrival}) { @@ -138,7 +138,7 @@ % } % } - + % if ($departure->{info} and length $departure->{info}) { %= $departure->{info} @@ -171,7 +171,13 @@ % } % } % } - +% if ($departure->{scheduled_platform} and $departure->{platform} and +% $departure->{scheduled_platform} ne $departure->{platform}) { + +% } +% else { + +% } %= $departure->{platform} -- cgit v1.2.3