summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2014-12-14 11:26:44 +0100
committerDaniel Friesel <derf@finalrewind.org>2014-12-14 11:26:44 +0100
commit171e80c6c7c334a6fac22e835d72e31a5cf2d2ec (patch)
tree6f0c7f0ba214ae8ccd1b31983e1e6f4b4a390894
parentae695c817f92ae9be39afb0cef07fdd52c2d5393 (diff)
support arrivals with negative delay (i.e. trains which arrive too early)
-rw-r--r--public/default.css12
-rw-r--r--templates/clean.html.ep12
2 files changed, 23 insertions, 1 deletions
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 @@
<span class="countdown">
% if ($departure->{delay} and not $departure->{is_cancelled}) {
% if ($show_realtime) {
-<span class="delaynorm">(<%= sprintf('+%d', $departure->{delay}) %>)</span>
+% if ($departure->{delay} > 0) {
+<span class="delaynorm">(+<%= $departure->{delay} %>)</span>
% }
% else {
+<span class="undelaynorm">(<%= $departure->{delay} %>)</span>
+% }
+% }
+% else {
+% if ($departure->{delay} > 0) {
<span class="delay">(+<%= $departure->{delay} %>)</span>
% }
+% else {
+<span class="undelay">(<%= $departure->{delay} %>)</span>
+% }
+% }
% }
<span class="platform">
%= $departure->{platform}