summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-05-30 18:24:29 +0200
committerDaniel Friesel <derf@finalrewind.org>2021-05-30 18:24:29 +0200
commit1cac79ba31858b496c03762a66eb86680ff3a3da (patch)
treecf9029ba81b48347714a5ffa894d01c1315a1674
parentdfbbf9fead33864c196ec6097b5360bfb45b610b (diff)
add delay
-rwxr-xr-xbin/nvm4
-rw-r--r--static/v0/css/wip.css23
-rw-r--r--templates/departure_list.html7
3 files changed, 24 insertions, 10 deletions
diff --git a/bin/nvm b/bin/nvm
index 7fe000a..d75f16e 100755
--- a/bin/nvm
+++ b/bin/nvm
@@ -62,6 +62,10 @@ class Departure:
else:
self.sort_by = 0
+ if self.delay:
+ self.delay = self.delay // 60
+ self.delay = f"{self.delay:+.0f}"
+
def set_relative(self, now):
minutes = (self.sort_by - now) // 60
if minutes < 1:
diff --git a/static/v0/css/wip.css b/static/v0/css/wip.css
index 965f5ec..a5f9424 100644
--- a/static/v0/css/wip.css
+++ b/static/v0/css/wip.css
@@ -42,13 +42,13 @@ ul.departures > li.cancelled {
ul.departures li .line {
position: absolute;
- bottom: 0;
+ bottom: 2px;
left: 2px;
max-width: 6em;
max-height: 3ex;
- max-width: 4em;
+ max-width: 5em;
overflow: hidden;
- font-size: 150%;
+ font-size: 140%;
background-color: #eeeeee;
font-weight: bold;
padding-left: 0.1em;
@@ -76,29 +76,33 @@ ul.departures li .bus {
ul.departures li .dest {
position: absolute;
bottom: 0;
- left: 4em;
+ left: 5em;
width: 70%;
overflow: hidden;
background-color: transparent;
- font-size: 160%;
+ font-size: 150%;
color: black;
}
ul.departures li .destsuffix {
position: absolute;
top: 1px;
- left: 6.5em;
+ left: 7.6em;
width: 70%;
height: 1.2em;
overflow: hidden;
}
+ul.departures li .time .delay {
+ padding-right: 1ex;
+ color: #ff0000;
+}
+
ul.departures li .time {
position: absolute;
right: 5px;
- top: 4px;
+ top: 1px;
background-color: transparent;
- font-size: 100%;
padding-left: 0.2em;
color: black;
}
@@ -109,7 +113,8 @@ ul.departures li .platform {
right: 5px;
overflow: hidden;
background-color: transparent;
- font-size: 150%;
+ font-size: 140%;
+ font-weight: bold;
color: black;
}
diff --git a/templates/departure_list.html b/templates/departure_list.html
index 37f259b..e234a2c 100644
--- a/templates/departure_list.html
+++ b/templates/departure_list.html
@@ -31,7 +31,12 @@
{% if departure.cancelled and departure.plannedWhen %}
<span class="time" aria-label="um {{ departure.plannedWhen }}">{{ departure.plannedWhen.strftime("%H:%M") }}</span>
{% else %}
- <span class="time" aria-label="in {{ departure.relativeWhen }}">{{ departure.relativeWhen }}</span>
+ <span class="time" aria-label="Abfahrtszeit: {{ departure.relativeWhen }}">
+ {% if departure.delay %}
+ <span class="delay" aria-label="{{ departure.delay }} Minuten Verspätung">({{ departure.delay }})</span>
+ {% endif %}
+ {{ departure.relativeWhen }}
+ </span>
{% endif %}
{% if departure.platform %}
<span class="platform" aria-label="Gleis/Bussteig {{ departure.platform }}">{{ departure.platform }}</span>