From 48697c5fc9aaccdd2bf4e2b4dabe700c11e5f028 Mon Sep 17 00:00:00 2001 From: Jasper Bok Date: Sun, 13 Aug 2023 17:04:01 +0200 Subject: [PATCH] Show only three departures per stop --- TODO | 2 +- index.html | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/TODO b/TODO index b984412..4a98afa 100644 --- a/TODO +++ b/TODO @@ -4,7 +4,7 @@ [x] *.. Print times in human-readable format. [x] **. Always parse times in Dutch timezone. -[ ] *.. Show max three departures per stop. +[x] *.. Show max three departures per stop. [ ] **. Show max two departures per line per stop. [ ] **. Add Connexxion departures. [ ] **. Make the page look nice (also on mobile). diff --git a/index.html b/index.html index da8553a..da5e22f 100644 --- a/index.html +++ b/index.html @@ -16,12 +16,14 @@

{{ .Name }}

{{ .Town }}

- {{ range .Departures }}
-
{{ .RouteShortName }} | {{ .StopHeadsign }}
-
-
+ {{ range $i, $val := .Departures }} + {{ if lt $i 3 }} +
{{ $val.RouteShortName }} | {{ $val.StopHeadsign }}
+
+ {{ end }} {{ end }} + {{ end }}