USING: accessors namespaces kernel sequences arrays urls present farkup ; USING: math.parser math.text.english ; USING: io.sockets.secure io.servers ; USING: furnace.actions furnace.boilerplate furnace.utilities furnace.chloe-tags ; USING: calendar calendar.english ; USING: html.forms ; USING: http.server http.server.dispatchers http.server.static ; USING: triangle-beer-league.daysmart ; IN: triangle-beer-league SYMBOLS: key-password key-file dh-file ; ! DTO TUPLE: schedule header schedules ; TUPLE: tbl < dispatcher ; : ( -- action ) { tbl "tbl" } >>template ; : timestamp>day-header ( timestamp -- str ) [ day-of-week day-name ] [ month>> month-name ] [ day>> dup number>string swap ordinal-suffix append ] tri 3array " " join ; : tbl-games>schedule ( game-schedules -- schedules ) [ [ first timestamp>day-header ] [ second ] bi schedule boa ] map ; : ( -- action ) [ tbl-games tbl-games>schedule "schedule" set-value ] >>init { tbl "schedule" } >>template ; : ( -- responder ) tbl new-dispatcher "resource:work/triangle-beer-league" >>default "schedule" add-responder { tbl "tbl-common" } >>template ; : ( -- threaded-server ) f >>secure 8080 >>insecure ; : start-tbl-site ( -- server ) main-responder set-global start-server ; : start-tbl ( -- ) start-tbl-site wait-for-server ; MAIN: start-tbl