master
Steve Ayerhart 2024-01-27 13:31:48 -05:00
parent 996c7778c7
commit 11a3c94f8c
Signed by: steve
GPG Key ID: BB368A0698AE49B7
2 changed files with 1 additions and 73 deletions

View File

@ -1,12 +1,7 @@
USING: urls pcre sequences accessors kernel assocs parser quotations combinators.short-circuit regexp arrays unicode math ;
USING: combinators ;
FROM: regexp => matches? ;
USING: xml.syntax xml.writer ;
USING: json ;
USING: urls sequences accessors kernel assocs parser quotations arrays unicode math combinators json ;
USING: io io.streams.string io.encodings.utf8 io.encodings.string ;
USING: math.parser math.text.english ;
USING: calendar calendar.english calendar.format calendar.parser ;
USING: html.parser html.parser.analyzer ;
USING: http.client ;
IN: triangle-beer-league.daysmart
@ -92,49 +87,3 @@ CONSTANT: daysmart-base-url URL" https://apps.daysmartrecreation.com/dash/jsonap
now [ wednesday midnight ] [ thursday end-of-day ] bi 2dup [ 2array ] 2dip
tbl-game-events-params tbl-game-events tbl-game-events>team-schedules
[ start>> wednesday? ] partition 2array zip ;
! : render-day-header ( timestamp -- xml )
! [ day-of-week day-name ]
! [ month>> month-name ]
! [ day>> dup number>string swap ordinal-suffix append ] tri
! [XML
! <h1 class="day-header">
! <span class="day-name"><-></span>
! <span class="month"><-></span>
! <span class="day"><-></span>
! </h1>
! XML] ;
!
!
! : render-team-times ( schedule -- xml )
! [ away>> color>> [ "team " prepend ] keep ]
! [ home>> color>> [ "team " prepend ] keep ]
! [ team-schedule>time-string ] tri
! [XML
! <div class="team-times">
! <span class="at">@</span>
! <div class="teams">
! <span class=<->><-></span>
! <span class=<->><-></span>
! </div>
! <div class="time"><-></div>
! </div>
! XML] ;
!
! : render-no-games ( -- xml )
! [XML <div class="team-times"><div class="none">No Scheduled TBL games</div></div> XML] ;
!
! : render-day-schedule ( assoc -- xml )
! [ first render-day-header ]
! [ second
! dup empty?
! [ drop render-no-games ]
! [ [ render-team-times ] map ] if
! ] bi
! [XML <section class="game"> <-> <-> </section> XML] ;
!
! : tbl-games? ( -- ? )
! tbl-games empty? not ;
!
! : render-schedule ( -- )
! tbl-games [ render-day-schedule pprint-xml ] each ;

View File

@ -1,21 +0,0 @@
IN: triangle-beer-league.entities
TUPLE: team
id color ;
TUPLE: team-schedule
start home away ;
CONSTANT: teams
{
T{ team f 25475 "maroon" }
T{ team f 25476 "white" }
T{ team f 25469 "blue" }
T{ team f 25475 "teal" }
T{ team f 25471 "green" }
T{ team f 25472 "yellow" }
T{ team f 25473 "light-blue" }
T{ team f 25470 "red" }
T{ team f 25477 "orange" }
T{ team f 25474 "black" }
}