From f5a6a5927bfcc4a2b82c34db5041bfe3a49b95e6 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 21 Aug 2021 12:11:35 +0200 Subject: refresh departure list every minute --- templates/departure_list.html | 81 +++++++++++++----------------------------- templates/departures_page.html | 35 ++++++++++++++++++ 2 files changed, 59 insertions(+), 57 deletions(-) create mode 100644 templates/departures_page.html (limited to 'templates') diff --git a/templates/departure_list.html b/templates/departure_list.html index a9cda01..66e2900 100644 --- a/templates/departure_list.html +++ b/templates/departure_list.html @@ -1,59 +1,26 @@ - - - - {{ title }} - {% include 'header.html' %} - - - -{% include 'navbar.html' %} - -
-
- {% if warning %} -
-
- {{ warning["lead"] }} - {{ warning["body"] }} -
{{ warning["code"] }}
-
-
+{% for departure in departures %} +
  • + {{ departure.line.name }} + {% if departure.suffix %} + {{ departure.suffix }} {% endif %} - {% if not departures %} -
    Keine Abfahrten innerhalb der nächsten zwei Stunden
    + {{ departure.direction }} + + {% if departure.cancelled and departure.plannedWhen %} + + fällt aus + {{ departure.plannedWhen.strftime("%H:%M") }} + + {% else %} + + {% if departure.delay %} + ({{ departure.delay }}) + {% endif %} + {{ departure.relativeWhen }} + {% endif %} -
      - {% for departure in departures %} -
    • - {{ departure.line.name }} - {% if departure.suffix %} - {{ departure.suffix }} - {% endif %} - {{ departure.direction }} - - {% if departure.cancelled and departure.plannedWhen %} - - fällt aus - {{ departure.plannedWhen.strftime("%H:%M") }} - - {% else %} - - {% if departure.delay %} - ({{ departure.delay }}) - {% endif %} - {{ departure.relativeWhen }} - - {% endif %} - {% if departure.platform %} - {{ departure.platform }} - {% endif %} -
    • - {% endfor %} -
    -
  • -
    - -{% include 'footer.html' %} - - - + {% if departure.platform %} + {{ departure.platform }} + {% endif %} + +{% endfor %} diff --git a/templates/departures_page.html b/templates/departures_page.html new file mode 100644 index 0000000..52733c4 --- /dev/null +++ b/templates/departures_page.html @@ -0,0 +1,35 @@ + + + + {{ title }} + {% include 'header.html' %} + + + + +{% include 'navbar.html' %} + +
    +
    + {% if warning %} +
    +
    + {{ warning["lead"] }} + {{ warning["body"] }} +
    {{ warning["code"] }}
    +
    +
    + {% endif %} + {% if not departures %} +
    Keine Abfahrten innerhalb der nächsten zwei Stunden
    + {% endif %} +
      + {% include 'departure_list.html' %} +
    +
    +
    + +{% include 'footer.html' %} + + + -- cgit v1.2.3