mirror of
https://git.nerfingen.de/nerf/choirMail.git
synced 2025-04-19 17:11:14 +00:00
changed table layout and seperator
This commit is contained in:
parent
93a09e8402
commit
4f2a6bffda
3 changed files with 36 additions and 23 deletions
10
app/Main.hs
10
app/Main.hs
|
@ -66,13 +66,11 @@ mailText :: MailRecord -> LT.Text
|
|||
mailText record = LT.concat ["Guten Morgen,\n\n"
|
||||
, announcement record
|
||||
,"\n\ndiesen Donnerstag\n\nDurchsingen: "
|
||||
,song1 record
|
||||
,", "
|
||||
,song2 record
|
||||
,songs record
|
||||
,"\nStimmproben: "
|
||||
,voice1 record
|
||||
,", "
|
||||
,voice2 record
|
||||
,voices record
|
||||
,"\nNoten mitbringen: "
|
||||
, notes record
|
||||
,"\n\nLG\nJo^^\n" ]
|
||||
|
||||
mailSubject :: MailRecord -> T.Text
|
||||
|
|
|
@ -14,15 +14,14 @@ import Control.Monad(void)
|
|||
|
||||
data MailRecord = MailRecord {
|
||||
date :: D.Day,
|
||||
voice1 :: LT.Text,
|
||||
voice2 :: LT.Text,
|
||||
song1 :: LT.Text,
|
||||
song2 :: LT.Text,
|
||||
voices :: LT.Text,
|
||||
songs :: LT.Text,
|
||||
notes :: LT.Text,
|
||||
announcement :: LT.Text
|
||||
} deriving (Show)
|
||||
|
||||
seperator :: Char
|
||||
seperator = '\t'
|
||||
seperator = ';'
|
||||
|
||||
sepParser :: P.Parser ()
|
||||
sepParser = void $ P.char seperator
|
||||
|
@ -52,19 +51,17 @@ parseRow :: P.Parser MailRecord
|
|||
parseRow = do
|
||||
date <- dateCellParser
|
||||
sepParser
|
||||
voice1 <- textCellParser
|
||||
voices <- textCellParser
|
||||
sepParser
|
||||
voice2 <- textCellParser
|
||||
songs <- textCellParser
|
||||
sepParser
|
||||
song1 <- textCellParser
|
||||
sepParser
|
||||
song2 <- textCellParser
|
||||
notes <- textCellParser
|
||||
sepParser
|
||||
announcement <- textCellParser
|
||||
return $ MailRecord{..}
|
||||
|
||||
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 = do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue