From 171e80c6c7c334a6fac22e835d72e31a5cf2d2ec Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 14 Dec 2014 11:26:44 +0100 Subject: support arrivals with negative delay (i.e. trains which arrive too early) --- public/default.css | 12 ++++++++++++ templates/clean.html.ep | 12 +++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/public/default.css b/public/default.css index e59676b..17818d0 100644 --- a/public/default.css +++ b/public/default.css @@ -155,12 +155,24 @@ div.displayclean li .countdown .delay { padding-right:7px; } +div.displayclean li .countdown .undelay { + font-size:1em; + color:#006600; + padding-right:7px; +} + div.displayclean li .countdown .delaynorm { font-size:0.9em; color:#BB3333; padding-right:7px; } +div.displayclean li .countdown .undelaynorm { + font-size:0.9em; + color:#338833; + padding-right:7px; +} + div.displayclean li .countdown .platform { font-weight: bold; } diff --git a/templates/clean.html.ep b/templates/clean.html.ep index 215f098..2b191e0 100644 --- a/templates/clean.html.ep +++ b/templates/clean.html.ep @@ -64,11 +64,21 @@ % if ($departure->{delay} and not $departure->{is_cancelled}) { % if ($show_realtime) { -(<%= sprintf('+%d', $departure->{delay}) %>) +% if ($departure->{delay} > 0) { +(+<%= $departure->{delay} %>) % } % else { +(<%= $departure->{delay} %>) +% } +% } +% else { +% if ($departure->{delay} > 0) { (+<%= $departure->{delay} %>) % } +% else { +(<%= $departure->{delay} %>) +% } +% } % } %= $departure->{platform} -- cgit v1.2.3