changed table layout and seperator

This commit is contained in:
Dennis Frieberg 2023-12-10 19:35:58 +01:00
parent 93a09e8402
commit 4f2a6bffda
Signed by: nerf
GPG key ID: 42DED0E2D8F04FB6
3 changed files with 36 additions and 23 deletions

View file

@ -66,13 +66,11 @@ mailText :: MailRecord -> LT.Text
mailText record = LT.concat ["Guten Morgen,\n\n" mailText record = LT.concat ["Guten Morgen,\n\n"
, announcement record , announcement record
,"\n\ndiesen Donnerstag\n\nDurchsingen: " ,"\n\ndiesen Donnerstag\n\nDurchsingen: "
,song1 record ,songs record
,", "
,song2 record
,"\nStimmproben: " ,"\nStimmproben: "
,voice1 record ,voices record
,", " ,"\nNoten mitbringen: "
,voice2 record , notes record
,"\n\nLG\nJo^^\n" ] ,"\n\nLG\nJo^^\n" ]
mailSubject :: MailRecord -> T.Text mailSubject :: MailRecord -> T.Text

View file

@ -14,15 +14,14 @@ import Control.Monad(void)
data MailRecord = MailRecord { data MailRecord = MailRecord {
date :: D.Day, date :: D.Day,
voice1 :: LT.Text, voices :: LT.Text,
voice2 :: LT.Text, songs :: LT.Text,
song1 :: LT.Text, notes :: LT.Text,
song2 :: LT.Text,
announcement :: LT.Text announcement :: LT.Text
} deriving (Show) } deriving (Show)
seperator :: Char seperator :: Char
seperator = '\t' seperator = ';'
sepParser :: P.Parser () sepParser :: P.Parser ()
sepParser = void $ P.char seperator sepParser = void $ P.char seperator
@ -52,19 +51,17 @@ parseRow :: P.Parser MailRecord
parseRow = do parseRow = do
date <- dateCellParser date <- dateCellParser
sepParser sepParser
voice1 <- textCellParser voices <- textCellParser
sepParser sepParser
voice2 <- textCellParser songs <- textCellParser
sepParser sepParser
song1 <- textCellParser notes <- textCellParser
sepParser
song2 <- textCellParser
sepParser sepParser
announcement <- textCellParser announcement <- textCellParser
return $ MailRecord{..} return $ MailRecord{..}
parseFirstRow :: P.Parser () parseFirstRow :: P.Parser ()
parseFirstRow = void (P.string "Datum\tStimmprobe 1\tStimmprobe 2\tLied 1\tLied 2\tWeitere Ansagen" >> P.endOfLine) parseFirstRow = void (P.string "Datum;Stimmproben;Lieder;Noten;Weitere Ansagen" >> P.endOfLine)
parseTable :: P.Parser [MailRecord] parseTable :: P.Parser [MailRecord]
parseTable = do parseTable = do

View file

@ -1,12 +1,15 @@
{ {
"nodes": { "nodes": {
"flake-utils": { "flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": { "locked": {
"lastModified": 1676283394, "lastModified": 1692799911,
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=", "narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073", "rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -17,11 +20,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1678086707, "lastModified": 1693355128,
"narHash": "sha256-y1uXdxzinIne4FW3TF7DCtxEB9gAbQ4qnbpYzhvkFm8=", "narHash": "sha256-+ZoAny3ZxLcfMaUoLVgL9Ywb/57wP+EtsdNGuXUJrwg=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "21eda9bc80bef824a037582b1e5a43ba74e92daa", "rev": "a63a64b593dcf2fe05f7c5d666eb395950f36bc9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -36,6 +39,21 @@
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",