From 1612bb5aec55af06f66012ff2627f533e7a57c67 Mon Sep 17 00:00:00 2001
From: stuebinm
Date: Sat, 28 Jan 2023 21:10:14 +0100
Subject: better web interface & css
---
lib/GTFS.hs | 14 ++++++--
lib/Server/ControlRoom.hs | 84 ++++++++++++++++++++++++++++++++++++-----------
lib/Server/GTFS_RT.hs | 16 ++++-----
messages/de.msg | 18 +++++++++-
messages/en.msg | 7 ++++
5 files changed, 108 insertions(+), 31 deletions(-)
diff --git a/lib/GTFS.hs b/lib/GTFS.hs
index af4d03b..2bcfdd5 100644
--- a/lib/GTFS.hs
+++ b/lib/GTFS.hs
@@ -153,8 +153,18 @@ instance Show Time where
show (Time seconds _ _) = ""
+|pad (seconds `div` 3600)|+":"
+|pad ((seconds `mod` 3600) `div` 60)|+
- {- if seconds `mod` 60 /= 0 then -}":"+|pad (seconds `mod` 60)|+""
- -- else ""
+ if seconds `mod` 60 /= 0 then":"+|pad (seconds `mod` 60)|+""
+ else ""
+ where
+ pad num =
+ if length str < 2 then "0"<>str else str
+ where str = show num
+
+showTimeWithSeconds :: Time -> String
+showTimeWithSeconds (Time seconds _ _) = ""
+ +|pad (seconds `div` 3600)|+":"
+ +|pad ((seconds `mod` 3600) `div` 60)|+
+ ":"+|pad (seconds `mod` 60)|+""
where
pad num =
if length str < 2 then "0"<>str else str
diff --git a/lib/Server/ControlRoom.hs b/lib/Server/ControlRoom.hs
index f08abcb..2be0b3e 100644
--- a/lib/Server/ControlRoom.hs
+++ b/lib/Server/ControlRoom.hs
@@ -32,7 +32,7 @@ import Data.Pool (Pool)
import Data.Text (Text)
import qualified Data.Text as T
import Data.Time (UTCTime (..), getCurrentTime,
- utctDay)
+ utctDay, addDays)
import Data.Time.Calendar (Day)
import Data.Time.Format.ISO8601 (iso8601Show)
import Data.UUID (UUID)
@@ -125,10 +125,14 @@ instance Yesod ControlRoom where
^{pageHead}