From 4c206f01c7ac8a4211560f1d75b1ba9c8ef8b624 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 1 Nov 2014 20:37:32 +0100 Subject: clean template: mark cancelled departures with strike-through --- index.pl | 17 +++++++++-------- public/default.css | 6 ++++++ templates/clean.html.ep | 6 +++++- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/index.pl b/index.pl index 14c5381..ad17284 100644 --- a/index.pl +++ b/index.pl @@ -247,14 +247,15 @@ sub handle_request { push( @departures, { - time => $result->time, - train => $result->train, - via => [ $result->route_interesting(3) ], - destination => $result->destination, - platform => $platform, - info => $info, - moreinfo => $moreinfo, - delay => $delay, + time => $result->time, + train => $result->train, + via => [ $result->route_interesting(3) ], + destination => $result->destination, + platform => $platform, + info => $info, + is_cancelled => $result->is_cancelled, + moreinfo => $moreinfo, + delay => $delay, } ); } diff --git a/public/default.css b/public/default.css index b603966..7fc054c 100644 --- a/public/default.css +++ b/public/default.css @@ -120,6 +120,12 @@ div.displayclean li .dest { overflow: hidden; } +div.displayclean li .cancelled { + text-decoration: line-through; + text-decoration-color: red; + -moz-text-decoration-color: red; +} + div.displayclean li .countdown { color:#000000; font-size:3em; diff --git a/templates/clean.html.ep b/templates/clean.html.ep index 329d89d..c013cd6 100644 --- a/templates/clean.html.ep +++ b/templates/clean.html.ep @@ -49,7 +49,11 @@ % } % } - +% my $extraclasses = q{}; +% if ($departure->{is_cancelled}) { +% $extraclasses .= ' cancelled'; +% } + %= $departure->{destination} -- cgit v1.2.3