summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/nvm6
-rw-r--r--templates/departure_list.html6
2 files changed, 11 insertions, 1 deletions
diff --git a/bin/nvm b/bin/nvm
index 61be2a5..86d491c 100755
--- a/bin/nvm
+++ b/bin/nvm
@@ -428,6 +428,12 @@ class Line:
self.name = self.name[3:]
self.css_class = "bus"
+ self.productName = obj.get("productName", 0)
+ if "fahrtNr" in obj:
+ self.fahrtNr = int(self.fahrtNr)
+ else:
+ self.fahrtNr = None
+
def __repr__(self):
return self.name
diff --git a/templates/departure_list.html b/templates/departure_list.html
index dee05b5..090e47c 100644
--- a/templates/departure_list.html
+++ b/templates/departure_list.html
@@ -1,5 +1,9 @@
{% for departure in departures %}
- <li class="{{ departure.classes }}" data-timestamp="{{ departure.sort_by }}">
+ {% if departure.line.productName and departure.line.fahrtNr %}
+ <li class="{{ departure.classes }}" data-timestamp="{{ departure.sort_by }}" id="{{departure.line.productName}}{{departure.line.fahrtNr}}">
+ {% else %}
+ <li class="{{ departure.classes }}" data-timestamp="{{ departure.sort_by }}">
+ {% endif %}
<a href="/trip/{{ departure.tripId }}?line={{ departure.quoted_line_name }}&amp;highlight={{ departure.quoted_stop_name }}&amp;platform={{ departure.quoted_platform() }}">
<span class="line {{ departure.line.css_class }}">{{ departure.line.name }}</span>
{% if departure.direction_area %}