/
keep-the-records.scm
1950 lines (1817 loc) · 109 KB
/
keep-the-records.scm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;;; WARNING user/club names should be cleaned, null and / are illegal characters
(use numbers) ;; !IMPORTANT! needs to come before other eggs, may segfault otherwise (020111)
(use awful message-digest-port sha2 posix http-session spiffy-cookies html-tags html-utils srfi-13 srfi-19 regex srfi-69 doctype http-session srfi-18 crypt)
(include "macs.scm")
(load "utils")
(load "storage-funcs")
(load "demo-data")
(load "handlers")
(load "pdf")
(load "awana-data-dsl")
(load "sections")
(load "rest")
(define is-production? (make-parameter (file-exists? "/keep-the-records/i-am-production")))
;;; production
(if (is-production?) (load "production") #f)
;;; Settings
(enable-ajax #t)
(ajax-library "https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js")
(enable-session #t)
(enable-web-repl "/web-repl")
(session-cookie-setter
(lambda (sid)
(set-cookie! (session-cookie-name) sid secure: (is-production?) httponly: #t)))
(define (developer-access?)
(or (development-mode?) (string=? ($session 'user) "t@thintz.com")))
(web-repl-access-control developer-access?)
(valid-password?
(lambda (user password)
(if (eq? (user-email user) 'not-found)
#f
(password-matches? user password))))
;(when (not (db:db)) (db:db (db:open-db "ktr-db")))
(define (is-current? url path)
(if (string-match (regexp (++ url ".*")) path)
#t
#f))
(define (main-tab-class is-current)
(++ "main-tab-item" (if is-current " main-tab-item-current" "")))
(define (define-awana-app-page path content #!key
(css '())
(title "Keep The Records")
(no-session #f)
(login-path #f)
(headers "")
(no-ajax #t)
(tab 'none))
(define-page (if (regexp? path) path (regexp path))
(lambda (actual-path)
(handle-exceptions
exn
(if (eq? exn 'permission-denied)
"PERMISSION DENIED! If you think this is an error, please email me at t@thintz.com"
(abort exn))
(let ((club (first (string-split actual-path "/"))))
(when (and (not (or (string=? club "user") (string=? club "club") (string=? club "sign-up") (string=? club "process-sign-up")))
(not (or (string=? ($session 'club) club) (string=? ($session 'user) "t@thintz.com"))))
(error 'permission-denied))
(++ (if (and (session-valid? (read-cookie "awful-cookie")) ($session 'demo))
(<div> class: "demo"
(<div> class: "demo-contents"
"This is a DEMO"
" "
(<a> class: "demo-sign-up" href: (++ "/" club "/sign-up") "Interested in the full version?")))
"")
(<div> class: "container_12"
(if (and (session-valid? (read-cookie "awful-cookie")) ($session 'user))
(<div> class: "grid_12 info-bar text-right full-width"
(user-name ($session 'user)) " | "
(<a> href: (++ "/" club "/account-settings") "My Info") " | "
(<a> href: "/sign-out" "Signout"))
"")
(if (neq? tab 'none)
(<div> class: "grid_12 menu-bar full-width"
(<div> class: "mmi-c"
(folds* (lambda (str url)
(<a> class: (++ "main-menu-item"
(if (eq? tab (string->symbol (string-downcase str)))
" main-menu-item-current" ""))
href: (++ "/" club "/" (string-downcase str) "/" url) str))
'(("Clubbers" "find")
;("Leaders" "find")
;("Stats" "attendance")
("Admin" "leaders"))))
(<div> class: "logo"
(<a> class: "main-logo" href: "http://keeptherecords.com" "Keep The Records")))
"")
(<div> class: "grid_12 main-tab-bar full-width"
(cond
((eq? tab 'clubbers)
(folds* (lambda (t)
(<a> href: (++ "/" club "/clubbers/" (string-downcase t))
class: (main-tab-class (is-current? (++ "/" club "/clubbers/"
(string-downcase t)) actual-path))
t))
'(("Dashboard") ("Attendance")
("Awards")
("Find") ("Release") ("Sections"))))
((eq? tab 'leaders)
(folds* (lambda (t)
(<a> href: (++ "/" club "/leaders/" (string-downcase t))
class: (main-tab-class (is-current? (++ "/" club "/leaders/"
(string-downcase t)) actual-path))
t))
'(("Find"))))
((eq? tab 'stats)
(++ (<a> href: (++ "/" club "/stats/attendance")
class: (main-tab-class
(is-current? (++ "/" club "/stats/attendance") actual-path))
"Attendance")
(<a> href: (++ "/" club "/stats/sections")
class: (main-tab-class
(is-current? (++ "/" club "/stats/sections") actual-path))
"Sections")
(<a> href: (++ "/" club "/stats/club")
class: (main-tab-class
(is-current? (++ "/" club "/stats/club") actual-path))
"Club")))
((eq? tab 'admin)
(++ (<a> href: (++ "/" club "/admin/leaders")
class: (main-tab-class
(is-current? (++ "/" club "/admin/leaders") actual-path))
"Leaders")
(<a> href: (++ "/" club "/admin/clubbers")
class: (main-tab-class
(is-current? (++ "/" club "/admin/clubbers") actual-path))
"Clubbers")))
((eq? tab 'none) "")))
(<div> class: "selected-tab-container" (if (regexp? path) (content actual-path) (content))))))))
css: (append '("https://fonts.googleapis.com/css?family=Tangerine:regular,bold&subset=latin"
"https://fonts.googleapis.com/css?family=Neucha&subset=latin"
"https://fonts.googleapis.com/css?family=Josefin+Sans+Std+Light"
"https://fonts.googleapis.com/css?family=Vollkorn&subset=latin"
"https://fonts.googleapis.com/css?family=Permanent+Marker"
"/css/reset.css" "/css/960.css" "/css/master.css?ver=5") css)
title: title
no-session: no-session
no-ajax: no-ajax
headers: (++ (insert-file "analytics.html") headers)
doctype: doctype-html))
;;; development reload
(define-page "/reloadme"
(lambda ()
(when (developer-access?)
(load-apps (awful-apps))
"Reloaded"))
no-session: #t)
;;; club/user create
(define-awana-app-page "/club/register"
(lambda ()
(add-javascript "$(document).ready(function() { $('#club-register-form').validationEngine('attach'); $('#church').focus(); });")
(<div> class: "grid_12"
(<form> action: "/club/create" id: "club-register-form"
(<h1> class: "action" "Create Club")
(<span> class: "form-context" "Church or Association Name") (<br>)
(<input> class: "text validate[required,custom[onlyLetterSp]]" type: "text" id: "church" name: "church")
(<h1> class: "action" "Create Your Account")
(<span> class: "form-context" "Name") (<br>)
(<input> class: "text validate[required,custom[onlyLetterSp],custom[ktr-name]]" type: "text" id: "name" name: "name") (<br>)
(<span> class: "form-context" "Email") (<br>)
(<input> class: "text validate[required,custom[email]" type: "text" id: "email" name: "email") (<br>)
(<span> class: "form-context" "Phone") (<br>)
(<input> class: "text validate[custom[ktr-phone]]" type: "text" id: "phone" name: "phone") (<br>)
(<span> class: "form-context" "Birthday") (<br>)
(<input> class: "text validate[custom[ktr-date]]" type: "text" id: "birthday" name: "birthday") (<br>)
(<span> class: "form-context" "Address") (<br>)
(<input> class: "text" type: "text" id: "address" name: "address") (<br>)
(<span> class: "form-context" "Password") (<br>)
(<input> class: "text validate[required,minSize[16]]" type: "password" id: "password" name: "password") (<br>)
(<span> class: "form-context" "Password Again") (<br>)
(<input> class: "text validate[required,equals[password]]" type: "password" id: "password-again" name: "password-again") (<br>)
(<input> type: "submit" value: "Create Club" class: "create"))))
css: '("/css/validation-engine.jquery.css" "/css/club-register.css?v=2")
headers: (++ (include-javascript "/js/jquery.validation-engine.js")
(include-javascript "/js/jquery.validation-engine-en.js"))
no-ajax: #f
no-session: #t
tab: 'none)
;;; user login/create
(define (generate-password password)
(crypt password))
(define (password-matches? user password)
(if (and (eq? (user-pw-type user) 'sha512) (string=? (call-with-output-digest (sha512-primitive) (cut display password <>)) (user-pw user)))
(begin (user-pw user (generate-password password))
(user-pw-type user 'crypt)
#t)
(string=? (crypt password (user-pw user)) (user-pw user))))
(define (send-welcome-email email club name)
(send-mail subject: "Welcome to Keep The Records - Awana Record Keeping"
from: "t@keeptherecords.com"
from-name: "Keep The Records"
to: email
reply-to: "t@keeptherecords.com"
html: (++ (<p> "Welcome, " name "!")
(<p> "You now have access to " (club-name club) "'s Keep The Records, Awana Record Keeping program. To login and start using the program you can go to " (<a> href: "https://a.keeptherecords.com" "https://a.keeptherecords.com") ". You can also find the login link at the KtR blog - " (<a> href: "http://keeptherecords.com" "http://keeptherecords.com") ".")
(<p> "If you ever have any questions or just want to give me feedback, just email Thomas Hintz at " (<a> href: "mailto:t@keeptherecords.com" "t@keeptherecords.com") ". Also, please feel free to follow the KtR blog at " (<a> href: "http://keeptherecords.com/blog" "http://keeptherecords.com/blog") ".")
(<p> "If you enjoy using KtR, than please recommend it to your friends. I want to help as many Awana clubs as I can. Taking good records and being able to see what works and what doesn't is critical to running a great Awana program.")
(<p>)
(<p> "Thanks and God Bless!")
(<p> "Thomas Hintz - Creator of KtR"))))
(define-login-trampoline "/login-trampoline"
hook: (lambda (user)
(print "logging in")
(print "check1" (session-valid? (sid)))
(if (sid)
(begin ($session-set! 'user user)
($session-set! 'club (user-club user)))
#f)))
(login-page-path "/user/login")
(define-awana-app-page (login-page-path)
(lambda ()
(add-javascript "$(document).ready(function() { $('#user').focus(); });")
(<div> class: "grid_12"
(<form> action: "/login-trampoline" method: "POST"
(<h1> class: "action" "Login to Keep the Records")
(<span> class: "form-context" "Email") (<br>)
(<input> class: "text" type: "text" id: "user" name: "user") (<br>)
(<span> class: "form-context" "Password") (<br>)
(<input> class: "text" type: "password" id: "password" name: "password") (<br>)
(<input> class: "create" type: "submit" value: "Enjoy KtR!"))))
no-ajax: #f
css: '("/css/club-register.css?ver=2")
no-session: #t)
(define-page (regexp "/sign-out")
(lambda (path)
(session-destroy! (read-cookie "awful-cookie"))
(delete-cookie! "awful-cookie")
"You have been logged out"))
(define-awana-app-page (regexp "/[^/]*/join-club")
(lambda (path)
(++ (<h1> "Join A Club")
"To begin, you must be authorized to work with an Awana club."
(<br>) (<br>)
"You can either:"
(<ul> (<li> (<a> href: "/club/authorize-me" "Ask for authorization from an existing club"))
(<li> (<a> href: "/club/register" "Create a new club"))))))
(define (as-db-unique proc unique-val start-val)
(when (> start-val 2000) (abort 'no-unique-val-found))
(if (eq? (proc (++ unique-val (number->string start-val))) 'not-found)
(++ unique-val (number->string start-val))
(as-db-unique proc unique-val (+ start-val 1))))
;;; demo pages
(define-page "/demo"
(lambda ()
(let ((new-sid (session-create)))
(sid new-sid)
(set-cookie! (session-cookie-name) new-sid)
($session-set! 'demo #t)
(let ((u-name (as-db-unique (lambda (u-n) (user-email u-n)) "demo" 1)))
(setup-demo u-name)
(html-page
""
headers: (<meta> http-equiv: "refresh"
content: (++ "0;url=/" (user-club u-name) "/clubbers/dashboard"))))))
no-session: #t)
;;; club pages
(define-awana-app-page "/club/create"
(lambda ()
(let* ((church ($ 'church))
(club (as-db-unique (lambda (c) (club-name c)) (name->id church) 0))
(u-name ($ 'name))
(u-email ($ 'email))
(u-phone ($ 'phone))
(u-birthday ($ 'birthday))
(u-address ($ 'address))
(u-pw ($ 'password))
(u-pw2 ($ 'password-again)))
(if (and (string=? u-pw u-pw2) (eq? (user-name u-email) 'not-found))
(begin (club-name club church)
(user-name u-email u-name)
(user-club u-email club)
(user-email u-email u-email)
(user-phone u-email u-phone)
(user-birthday u-email u-birthday)
(user-address u-email u-address)
(user-pw u-email (generate-password u-pw))
(user-pw-type u-email 'crypt)
(club-users club (cons u-email (club-users club)))
(send-welcome-email u-email club u-name)
(handle-exceptions
exn
'error
(send-mail from: "momentum@keeptherecords.com" from-name: "Momentum" to: "t@thintz.com" reply-to: "momentum@keeptherecords.com" subject: "New Club Register!"
html: (++ "Good work!\n\n" u-email " just registered " church " as " club)))
(html-page
""
headers: (<meta> http-equiv: "refresh"
content: (++ "0;url=" "/user/login"))))
(if (eq? (user-name u-email) 'not-found)
"Passwords don't match, please go back and re-enter your info."
"Email already in use."))))
no-session: #t)
;;; clubber pages
(define (clubber->url club clubber #!key (class #f))
(<a> href: (++ "/" club "/clubbers/info/" clubber) class: (if class class "") (name club clubber)))
(define-awana-app-page (regexp "/[^/]*/clubbers/dashboard")
(lambda (path)
(define (birthday-table club clubbers)
(<table>
(fold (lambda (c o)
(++ o
(<tr> (<td> class: "c-cell clubber-url-cell" (clubber->url club c class: "clubber-url"))
(<td> class: "c-cell clubber-birthday" (birthday club c))
(<td> class: "c-cell clubber-club-level" (club-level club c)))))
""
clubbers)))
(let ((club (get-club path))
(date-start (week-start (current-date-0000)))
(date-end (week-end (current-date-0000))))
(add-javascript "$('#from-date').datepicker(); $('#to-date').datepicker();")
(ajax "get-birthdays" ".dt" 'change
(lambda ()
(birthday-table club (birthdays-within club (db:list "clubs" club "clubbers")
(string->date ($ 'from-date) "~m/~d/~Y")
(string->date ($ 'to-date) "~m/~d/~Y"))))
arguments: '((from-date . "$('#from-date').val()")
(to-date . "$('#to-date').val()"))
target: "birthdays")
(++ (<div> class: "grid_12"
(<div> class: "column-header padding" (club-name club))
(<div> class: "column-body padding"
(folds* (lambda (t s)
(++ (<a> href: (++ "/" club "/clubbers/" (string-downcase t))
class: "misc-links"
(<div> class: "misc-border"
(<img> src: (++ "/images/" (string-downcase t) ".png")
class: "misc-icons") s))))
'(("Missed" "Absent") ("Add" "Add Clubber") ("Allergies" "Allergies") ("Dues" "Dues")
("New" "First Time") ("Points" "Points")))))
(<div> class: "clear")
(<div> class: "grid_12"
(<div> class: "column-header padding" "Birthdays")
(<div> class: "info-header padding"
"From "
(<input> class: "dt" id: "from-date" name: "from-date"
value: (date->string date-start "~m/~d/~Y"))
" to "
(<input> class: "dt" id: "to-date" name: "to-date"
value: (date->string date-end "~m/~d/~Y")))
(<div> class: "column-body padding" id: "birthdays"
(birthday-table club (birthdays-within club (db:list "clubs" club "clubbers")
date-start date-end))))
(<div> class: "clear")
(<div> class: "grid_12"
(<a> href: "http://www.icons-land.com"
class: "cit" "Some Icons used with permission from Icons Land.")))))
no-ajax: #f
headers: (++ (include-javascript "https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js")
(include-javascript "/js/jquery-ui-1.8.11.custom.min.js"))
css: '("/css/dashboard.css?ver=0" "/css/ui-lightness/jquery-ui-1.8.11.custom.css")
tab: 'clubbers)
(define (get-club path)
(first (string-split path "/")))
(define (grade-index grade)
(cond ((string=? grade "age-2-or-3") 1) ((string=? grade "pre-k") 2) ((string=? grade "K") 3)
((string=? grade "1") 4) ((string=? grade "2") 5) ((string=? grade "3") 6) ((string=? grade "4") 7)
((string=? grade "5") 8) ((string=? grade "6") 9) ((string=? grade "7") 10) ((string=? grade "8") 11)
((string=? grade "9") 12) ((string=? grade "10") 13) ((string=? grade "11") 14) ((string=? grade "12") 15)))
(define (club-index club)
(cond ((string=? club "Puggles") 1)
((string=? club "Cubbies") 2)
((string=? club "Sparks") 3)
((string=? club "TnT") 4)
((string=? club "Trek") 5)
((string=? club "Journey") 6)))
(define-awana-app-page (regexp "/[^/]*/clubbers/(add|info/[^/]*/edit)")
(lambda (path)
(let* ((club (get-club path))
(edit (> (length (string-split path "/")) 3))
(c-name (if edit (get-clubber path) #f)))
(ajax "lookup-parent" 'parent-name-1 '(change blur)
(lambda ()
(if ($ 'p-name)
(map (lambda (data)
(cond ((string=? data "name") `(parent-name-1 . ,(parent-name club ($ 'p-name))))
((string=? data "spouse") `(parent-name-2 . ,(parent-spouse club ($ 'p-name))))
(#t `(,(string->symbol data) .
,(db:read "clubs" club "parents" ($ 'p-name) data)))))
(db:list "clubs" club "parents" ($ 'p-name)))
'()))
success: "$.each(response, function(id, html) { $('#' + id).val(html).addClass('filled').watermark(''); })"
update-targets: #t
method: 'GET
arguments: '((p-name . "parentIds[parentNames.indexOf($('#parent-name-1').val())]")))
(++ (<div> class: "clear")
(<div> class: "grid_12" (<div> class: "success" id: "success" (if ($ 'success) "Clubber Added Successfully" "")))
(<div> class: "grid_6 column-header" (<div> class: "padding" "Child"))
(<div> class: "grid_6 column-header" (<div> class: "padding" "Parent/Guardian"))
(<div> class: "clear clear-no-space")
(<form> action: (++ "/" club "/clubbers/create") id: "add-clubber-form"
(if edit (hidden-input 'edit (++ "/" club "/clubbers/info/" c-name)) "")
(if ($ 'from) (hidden-input 'from ($ 'from)) "")
(<div> class: "grid_6 column-body on-top"
(<div> class: "padding"
(<table> (<tr> (<td> class: "label" (<span> class: "label-name" id: "label-name" "Name"))
(<td> (<input> id: "name" class: "jq_watermark name validate[required,custom[onlyLetterSp],custom[ktr-name]]"
value: (if edit (name club c-name) "")
title: "First Last" name: "name")))
(<tr> (<td> class: "label" (<span> class: "label grade" "Grade"))
(<td> (combo-box "grade" '(("age-2-or-3" "Age 2 or 3")
("pre-k" "Pre-k") "K" "1"
"2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12")
selectedindex: (if edit (grade-index (grade club c-name)) 0)
name: "grade" class: "grade validate[required]" first-empty: #t)))
(<tr> (<td> class: "label" (<span> class: "label birthday" "Birthday"))
(<td> (<input> class: "jq_watermark birthday validate[required,custom[ktr-date]]" id: "birthday"
value: (if edit (birthday club c-name) "")
title: "mm/dd/yyyy" name: "birthday")))
(<tr> (<td> class: "label" (<span> class: "label club" id: "label-club" "Club"))
(<td> (combo-box "club-level"
'("Puggles" "Cubbies" "Sparks" "TnT" "Trek" "Journey")
value: (if edit (club-level club c-name) "")
selectedindex: (if edit
(club-index (club-level club c-name))
0)
name: "club-level" class: "club validate[required]" first-empty: #t)))
(<tr> (<td> class: "label" (<span> class: "label allergies" "Allergies"))
(<td> (<input> class: "allergies" id: "allergies" name: "allergies"
value: (if edit (allergies club c-name) "")))))))
(<div> class: "grid_6 column-body on-top"
(<div> class: "padding"
(<table> (<tr> (<td> class: "label" (<span> class: "label parent-name" "Parent Name 1"))
(<td> (<input> class: "jq_watermark parent-name validate[required,custom[onlyLetterSp],custom[ktr-name]]" id: "parent-name-1"
title: "First Last" name: "parent-name-1"
value: (if edit
(parent-name club (primary-parent club c-name))
""))))
(<tr> (<td> class: "label" (<span> class: "label parent-name" "Parent Name 2"))
(<td> (<input> class: "jq_watermark parent-name validate[custom[onlyLetterSp],custom[ktr-name]]" id: "parent-name-2"
title: "First Last" name: "parent-name-2"
value: (if edit
(parent-spouse club (primary-parent club c-name))
""))))
(<tr> (<td> class: "label" (<span> class: "label email" "Email"))
(<td> (<input> class: "jq_watermark email validate[required,custom[email]]" id: "email"
title: "address@mail.com" name: "email"
value: (if edit
(parent-email club (primary-parent club c-name))
""))))
(<tr> (<td> class: "label" (<span> class: "label phone" "Phone 1"))
(<td> (<input> class: "jq_watermark phone validate[required,custom[ktr-phone]]" id: "phone-1"
title: "123.456.7890" name: "phone-1"
value: (if edit
(parent-phone-1 club (primary-parent club c-name))
""))))
(<tr> (<td> class: "label" (<span> class: "label phone" "Phone 2"))
(<td> (<input> class: "phone jq_watermark validate[custom[ktr-phone]]" id: "phone-2"
title: "123.456.7890" name: "phone-2"
value: (if edit
(parent-phone-2 club (primary-parent club c-name))
""))))
(<tr> (<td> class: "label" (<span> class: "label address" "Address"))
(<td> (<input> class: "jq_watermark address validate[required]" id: "address"
title: "123 Food St Donut MI 49494" name: "address"
value: (if edit
(parent-address club (primary-parent club c-name))
""))))
(<tr> (<td> class: "label" (<span> class: "label release-to" "Release To"))
(<td> (<input> class: "release-to" id: "release-to" name: "release-to"
value: (if edit
(parent-release-to club
(primary-parent club c-name))
"")))))))
(<div> class: "clear")
(<div> class: "grid_12"
(<div> class: "create-clubber-container"
(<input> type: "submit" class: "create-clubber"
value: (if edit "Update" "Create")))))
(hidden-input 'parent-names (fold (lambda (e o) (++ o "|" (parent-name club e)))
"" (db:list "clubs" club "parents")))
(hidden-input 'parent-ids (fold (lambda (e o) (++ o "|" e))
"" (db:list "clubs" club "parents"))))))
css: '("/css/validation-engine.jquery.css" "/css/add-clubber.css" "/css/autocomplete.css" "/css/clubbers-index.css")
headers: (++ (include-javascript "/js/jquery.watermark.min.js")
(include-javascript "/js/jquery.validation-engine.js")
(include-javascript "/js/jquery.validation-engine-en.js")
(include-javascript "/js/autocomplete.js")
(include-javascript "/js/add-clubber.js"))
no-ajax: #f
tab: 'clubbers
title: "Add Clubber - Club Night - KtR")
(define (date->db date)
(date->string date "~D"))
(define (short-year? date-string)
(let ((s (string-split date-string "/")))
(if (> (length s) 2)
(if (> (string-length (third s)) 2)
#f
#t)
#f)))
(define (db->date db-date)
(handle-exceptions
exn
#f
(if (short-year? db-date)
(string->date db-date "~m/~d/~y")
(string->date db-date "~m/~d/~Y"))))
(define-awana-app-page (regexp "/[^/]*/clubbers/create")
(lambda (path)
;;; also add security within awana-app-page or something
(let ((club (get-club path))
(m-name ($ 'name))
(from ($ 'from))
(edit ($ 'edit)))
(name club m-name m-name)
(grade club m-name ($ 'grade))
(birthday club m-name ($ 'birthday))
(club-level club m-name ($ 'club-level))
(allergies club m-name ($ 'allergies))
(primary-parent club m-name ($ 'parent-name-1))
(and (not edit) (date-registered club m-name (date->db (current-date))))
(db:update-list (name->id m-name) "clubs" club "clubbers")
(let ((p-name ($ 'parent-name-1)))
(parent-name club p-name p-name)
(parent-spouse club p-name ($ 'parent-name-2))
(parent-email club p-name ($ 'email))
(parent-phone-1 club p-name ($ 'phone-1))
(parent-phone-2 club p-name ($ 'phone-2))
(parent-address club p-name ($ 'address))
(parent-release-to club p-name ($ 'release-to))
(parent-children club p-name (let ((children (parent-children club p-name)))
(if (eq? children 'not-found)
`(,($ 'name))
(cons ($ 'name) children))))
(db:update-list "name" "clubs" club "parents" p-name)
(db:update-list "spouse" "clubs" club "parents" p-name)
(db:update-list "email" "clubs" club "parents" p-name)
(db:update-list "phone-1" "clubs" club "parents" p-name)
(db:update-list "phone-2" "clubs" club "parents" p-name)
(db:update-list "address" "clubs" club "parents" p-name)
(db:update-list "release" "clubs" club "parents" p-name)
(db:update-list "children" "clubs" club "parents" p-name)
(db:update-list (name->id p-name) "clubs" club "parents"))
(cond (from (redirect-to from))
(($ 'edit) (redirect-to edit))
(#t (redirect-to (++ "/" club "/clubbers/add?success=true")))))))
(define (present-clubbers club date)
(filter (lambda (m-name)
(if (present club m-name date) #t #f)) (db:list "clubs" club "clubbers")))
(define (attendees-html club date)
(let ((present-clubbers (sort (present-clubbers club date) string<)))
(++ "In Attendance: "
(number->string (fold (lambda (m c) (+ c 1)) 0 present-clubbers))
(<br>) (<br>)
(fold (lambda (m-name o)
(++ o (<a> href: (++ "/" club "/clubbers/info/" m-name) (name club m-name)) (<br>)))
""
present-clubbers))))
(define (todays-mm) (date->string (current-date) "~m"))
(define (todays-dd) (date->string (current-date) "~d"))
(define (todays-yy) (date->string (current-date) "~y"))
(define (todays-yyyy) (date->string (current-date) "~Y"))
;;; attendance
(define-awana-app-page (regexp "/[^/]*/clubbers/attendance")
(lambda (path)
(let ((club (get-club path))
(date (++ (or ($ 'year) (todays-yyyy)) "/" (or ($ 'month) (todays-mm)) "/" (or ($ 'day) (todays-dd)))))
(ajax "clubber-attendance-info" 'clubbers '(change keypress)
(lambda ()
(let ((n ($ 'name)))
(if n
`((clubber-name . ,(name club n))
(present . ,(present club n date))
(bible . ,(bible club n date))
(handbook . ,(handbook club n date))
(uniform . ,(uniform club n date))
(friend . ,(friend club n date))
(extra . ,(extra club n date))
(sunday-school . ,(sunday-school club n date))
(dues . ,(dues club n date))
(on-time . ,(on-time club n date))
(points-total . ,(total-points club n))
(allergies . ,(allergies club n))
(club-level . ,(club-level club n))
(notes . ,(notes club n))
(attendees-html . ,(attendees-html club date)))
'())))
success: "loadClubberInfo(response);"
update-targets: #t
method: 'GET
arguments: '((name . "$('#clubbers').val()[0]")))
(ajax "save-present" 'present 'click
(lambda ()
(present club ($ 'name) date (if (string=? ($ 'present) "false") #f #t)))
method: 'PUT
arguments: '((name . "$('#clubbers').val()[0]") (present . "stringToBoolean($('#present').val())")))
(ajax "save-bible" 'bible 'click
(lambda ()
(bible club ($ 'name) date (if (string=? ($ 'bible) "false") #f #t)))
method: 'PUT
arguments: '((name . "$('#clubbers').val()[0]") (bible . "stringToBoolean($('#bible').val())")))
(ajax "save-handbook" 'handbook 'click
(lambda ()
(handbook club ($ 'name) date (if (string=? ($ 'handbook) "false") #f #t)))
method: 'PUT
arguments: '((name . "$('#clubbers').val()[0]") (handbook . "stringToBoolean($('#handbook').val())")))
(ajax "save-uniform" 'uniform 'click
(lambda ()
(uniform club ($ 'name) date (if (string=? ($ 'uniform) "false") #f #t)))
method: 'PUT
arguments: '((name . "$('#clubbers').val()[0]") (uniform . "stringToBoolean($('#uniform').val())")))
(ajax "save-friend" 'friend 'click
(lambda ()
(friend club ($ 'name) date (if (string=? ($ 'friend) "false") #f #t)))
method: 'PUT
arguments: '((name . "$('#clubbers').val()[0]") (friend . "stringToBoolean($('#friend').val())")))
(ajax "save-extra" 'extra 'click
(lambda ()
(extra club ($ 'name) date (if (string=? ($ 'extra) "false") #f #t)))
method: 'PUT
arguments: '((name . "$('#clubbers').val()[0]") (extra . "stringToBoolean($('#extra').val())")))
(ajax "save-sunday-school" 'sunday-school 'click
(lambda ()
(sunday-school club ($ 'name) date (if (string=? ($ 'sunday-school) "false") #f #t)))
method: 'PUT
arguments: '((name . "$('#clubbers').val()[0]") (sunday-school . "stringToBoolean($('#sunday-school').val())")))
(ajax "save-dues" 'dues 'click
(lambda ()
(dues club ($ 'name) date (if (string=? ($ 'dues) "false") #f #t)))
method: 'PUT
arguments: '((name . "$('#clubbers').val()[0]") (dues . "stringToBoolean($('#dues').val())")))
(ajax "on-time" 'on-time 'click
(lambda ()
(on-time club ($ 'name) date (if (string=? ($ 'on-time) "false") #f #t)))
method: 'PUT
arguments: '((name . "$('#clubbers').val()[0]") (on-time . "stringToBoolean($('#on-time').val())")))
(++ (<div> class: "grid_12 column-body"
(<div> class: "padding"
(<form> action: path method: "GET"
(<span> class: "date-label" "Date:")
(<input> class: "date-input" name: "month" id: "month"
value: (or ($ 'month) (todays-mm))) "/"
(<input> class: "date-input" name: "day" id: "day"
value: (or ($ 'day) (todays-dd))) "/"
(<input> class: "date-input" name: "year" id: "year"
value: (or ($ 'year) (todays-yyyy)))
(<a> href: (++ path "?month=" (todays-mm) "&day=" (todays-dd) "&year=" (todays-yyyy))
class: "preset-date" "Today")
;(<a> href: "#" class: "preset-date" "Last Club Meeting")
(<input> class: "change-date" type: "submit" value: "Update Date"))))
(<div> class: "clear")
(<div> class: "grid_3 column-header" (<div> class: "padding" "Find Clubbers"))
(<div> class: "grid_6 column-header" id: "clubber-name-container"
(<div> id: "clubber-name" class: "padding" "Mark Attendance"))
(<div> class: "grid_3 column-header" (<div> class: "padding" "View Attendees"))
(<div> class: "grid_3 column-body"
(<div> class: "padding"
(<input> type: "text" class: "filter" id: "filter")
(combo-box "clubbers"
(map (lambda (e)
`(,e . ,(name club e)))
(name-sort club (db:list "clubs" club "clubbers") "last"))
class: "clubbers" multiple: #t)))
(<div> class: "grid_6 column-body"
(<div> class: "padding"
(<div> class: "description-container" id: "description-container"
"To begin, click on a name to the left" (<br>) (<br>)
"<--" (<br>) (<br>)
"You can also filter (sort of like search) the names by typing into the box above the clubbers")
(<div> class: "clubber-data" id: "clubber-data"
(<div> class: "attendance-container"
(<div> class: "attendance-button" id: "present" "Present"
(<input> class: "present" type: "button" id: "present" value: ""))
(<div> class: "attendance-button" id: "bible" "Bible"
(<input> class: "bible" type: "button" id: "bible" value: ""))
(<div> class: "attendance-button" id: "handbook" "Handbook"
(<input> class: "handbook" type: "button" id: "handbook" value: ""))
(<div> class: "attendance-button" id: "uniform" "Uniform"
(<input> class: "uniform" type: "button" id: "uniform" value: ""))
(<div> class: "attendance-button" id: "friend" "Friend"
(<input> class: "friend" type: "button" id: "friend" value: ""))
(<div> class: "attendance-button" id: "extra" "Extra"
(<input> class: "extra" type: "button" id: "extra" value: ""))
(<br>)(<br>)(<br>)(<br>)(<br>)(<br>)(<br>)(<br>)(<br>)
(<div> class: "attendance-button" id: "sunday-school" "Sunday"
(<input> class: "sunday-school" type: "button" id: "sunday-school" value: ""))
(<div> class: "attendance-button" id: "dues" "Dues"
(<input> class: "dues" type: "button" id: "dues" value: ""))
(<div> class: "attendance-button" id: "on-time" "On Time"
(<input> class: "on-time" type: "button" id: "on-time" value: "")))
(<div> class: "points-container"
(<div> class: "points" id: "points-total")
(<div> class: "points points-label" " points"))
(<div> class: "allergy-info" id: "allergy-container"
(<div> class: "allergic-to info" "Allergic To:") (<br>)
(<div> class: "allergic-to-item" id: "allergies" ""))
(<div> class: "notes info" id: "notes" ""))))
(<div> class: "grid_3 column-body"
(<div> class: "tab-body padding"
(<div> class: "attendees" id: "attendees"
(attendees-html club date)))))))
headers: (include-javascript "/js/attendance.js?ver=2")
no-ajax: #f
css: '("/css/attendance.css?ver=4")
tab: 'clubbers
title: "Attendance - Club Night -KtR")
;;; clubbers
(define (search-filter club clubbers search)
(if search
(filter (lambda (e) (string-contains-ci (name club e) search)) clubbers)
clubbers))
(define (club-filter club clubbers c-level)
(filter (lambda (e) (if (string-ci=? (club-level club e) c-level) #t #f)) clubbers))
(define (name-sort club clubbers sort-value)
(sort clubbers (lambda (e1 e2)
(if (and sort-value (string=? sort-value "last"))
(let ((n1 (string-split (name club e1) " "))
(n2 (string-split (name club e2) " ")))
(string< (++ (second n1) " " (first n1))
(++ (second n2) " " (first n2))))
(string< e1 e2)))))
(define (clubbers->names club clubbers)
(map (lambda (clubber)
(name club clubber))
clubbers))
(define (clubbers->urls club clubbers first-name-first)
(fold (lambda (e o)
(++ o (<a> class: "clubber-url" href: (++ "/" club "/clubbers/info/" e)
(++ (if first-name-first
(name club e)
(++ (second (string-split (name club e) " ")) " "
(first (string-split (name club e) " "))))
(<br>)))))
""
clubbers))
(define-awana-app-page (regexp "/[^/]*/clubbers/find")
(lambda (path)
(let ((club (get-club path))
(search ($ 'search))
(sort-value ($ 'sort)))
(++ (<div> class: "clear")
(<div> class: "grid_12 column-body"
(<table>
(<tr>
class: "opts-row"
(<td> class: "opts padding"
(<form> action: path method: "GET"
"Search: "
(<input> type: "text" id: "search" name: "search" class: "search"
value: (if search search ""))))
(<td> class: "opts padding"
"Sort By"
(<a> href: (++ path "?sort=first" (if search (++ "&search=" search) ""))
class: (++ "sort-link"
(if (or (not sort-value) (and sort-value (string=? sort-value "first")))
" current-sort" "")) "First Name")
(<a> href: (++ path "?sort=last" (if search (++ "&search=" search) ""))
class: (++ "sort-link"
(if (and sort-value (string=? sort-value "last"))
" current-sort" "")) "Last Name"))
(<td> class: "opts padding"
(<span> class: "new-clubber-symbol" "+ ")
(<a> href: (++ "/" club "/clubbers/add") class: "new-clubber" "Add New Clubber")))))
(<div> class: "clear")
(let* ((clubbers (name-sort club (search-filter club (db:list "clubs" club "clubbers") ($ 'search)) sort-value))
(sort-by-first (if (and ($ 'sort) (string=? ($ 'sort) "last")) #f #t))
(puggles (club-filter club clubbers "puggles"))
(cubbies (club-filter club clubbers "cubbies"))
(sparks (club-filter club clubbers "sparks"))
(tnt (club-filter club clubbers "tnt"))
(trek (club-filter club clubbers "trek"))
(journey (club-filter club clubbers "journey")))
(++ (if (> (length puggles) 0) (<div> class: "grid_2 column-header" (<div> class: "padding" "Puggles")) "")
(if (> (length cubbies) 0) (<div> class: "grid_2 column-header" (<div> class: "padding" "Cubbies")) "")
(if (> (length sparks) 0) (<div> class: "grid_2 column-header" (<div> class: "padding" "Sparks")) "")
(if (> (length tnt) 0) (<div> class: "grid_2 column-header" (<div> class: "padding" "TnT")) "")
(if (> (length trek) 0) (<div> class: "grid_2 column-header" (<div> class: "padding" "Trek")) "")
(if (> (length journey) 0) (<div> class: "grid_2 column-header" (<div> class: "padding" "Journey")) "")
(<div> class: "clear clear-no-space")
(if (> (length puggles) 0) (<div> class: "grid_2 column-body"
(<div> class: "padding"
(clubbers->urls club puggles sort-by-first))) "")
(if (> (length cubbies) 0) (<div> class: "grid_2 column-body"
(<div> class: "padding"
(clubbers->urls club cubbies sort-by-first))) "")
(if (> (length sparks) 0) (<div> class: "grid_2 column-body"
(<div> class: "padding"
(clubbers->urls club sparks sort-by-first))) "")
(if (> (length tnt) 0) (<div> class: "grid_2 column-body"
(<div> class: "padding"
(clubbers->urls club tnt sort-by-first))) "")
(if (> (length trek) 0) (<div> class: "grid_2 column-body"
(<div> class: "padding"
(clubbers->urls club trek sort-by-first))) "")
(if (> (length journey) 0) (<div> class: "grid_2 column-body"
(<div> class: "padding"
(clubbers->urls club journey sort-by-first))) "")
(<div> class: "clear")
(if (> (length clubbers) 0) (<div> class: "grid_2 column-header" (<div> class: "padding" "All Clubs")) "")
(<div> class: "clear clear-no-space")
(if (> (length clubbers) 0) (<div> class: "grid_2 column-body"
(<div> class: "padding"
(clubbers->urls club clubbers sort-by-first))) ""))))))
css: '("/css/clubbers-index.css")
tab: 'clubbers
title: "Clubbers - Club Night - KtR")
(define (get-clubber path)
(fourth (string-split path "/")))
(define (list-years club clubber)
(db:list "clubs" club "clubbers" clubber "attendance"))
(define (list-months club clubber year)
(db:list "clubs" club "clubbers" clubber "attendance" year))
(define (list-days club clubber year month)
(db:list "clubs" club "clubbers" clubber "attendance" year month))
(define (attendance-dates club clubber)
(if (> (length (db:list "clubs" club "clubbers" clubber "attendance")) 0)
(concatenate (concatenate (map (lambda (year)
(map (lambda (month)
(map (lambda (day)
(list month day year))
(sort (list-days club clubber year month) string<)))
(sort (list-months club clubber year) string<)))
(sort (list-years club clubber) string<))))
'()))
(define (dates->filled-tds proc club clubber dates)
(fold (lambda (date-l o)
(++ o (<td> (<div> class:
(if (proc club clubber (++ (third date-l) "/" (first date-l) "/" (second date-l)))
"fill" "") "X"))))
""
dates))
(define-awana-app-page (regexp "/[^/]*/clubbers/info/[^/]*")
(lambda (path)
(let* ((clubber (get-clubber path))
(club (get-club path))
(p-parent (primary-parent club clubber))
(dates (attendance-dates club clubber)))
(++ (<div> class: "grid_12 column-body"
(<div> class: "padding"
(<a> href: (++ path "/edit") class: "edit" "Edit This Clubber")))
(<div> class: "clear")
(<div> class: "grid_12" (<div> class: "column-header padding" (name club clubber)))
(<div> class: "grid_12 column-body"
(<div> class: "grid_8 no-margins"
(<div> class: "grid_2 margins-right" (<div> class: "info-header padding" "General Info"))
(<div> class: "grid_2 margins-right" (<div> class: "info-header padding" "Allergies"))
(<div> class: "grid_2 no-margins" (<div> class: "info-header padding" "Release To"))
(<div> class: "clear clear-no-space")
(<div> class: "grid_2 margins-right"
(<div> class: "padding info-body"
(club-level club clubber) (<br>)
"Grade: " (id->name (grade club clubber)) (<br>)
(birthday club clubber) (<br>)
(total-points club clubber) " points" (<br>) (<br>)
"Registered: " (date-registered club clubber)))
(<div> class: "grid_2 margins-right info-body"
(<div> class: "padding"
(let ((a (allergies club clubber)))
(if (or (string=? a "") (string-ci=? a "none"))
""
a))))
(<div> class: "grid_2 no-margins info-body"
(<div> class: "padding"
(parent-release-to club p-parent))))
(<div> class: "grid_4 no-margins"
(<div> class: "grid_4 margins-left" (<div> class: "info-header padding" "Parents"))
(<div> class: "grid_4 margins-left"
(<div> class: "padding info-body parent-info"
(<a> class: "parent-name" href: (++ "/" club "/parents/" (name->id p-parent))
(parent-name club p-parent))
", "
(<a> class: "parent-name" href: (++ "/" club "/parents/" (name->id p-parent))
(parent-spouse club p-parent))
(<br>) (<br>)
(<span> class: "phone" (parent-phone-1 club p-parent)) " "
(<span> class: "phone" (parent-phone-2 club p-parent))
(<br>)
(<span> class: "email" (<a> href: (++ "mailto:" (parent-email club p-parent))
(parent-email club p-parent)))
(<br>)
(<span> class: "address" (parent-address club p-parent)))))
(<div> class: "grid_12 no-margins"
(<div> class: "grid_12 no-margins" (<div> class: "info-header padding" "Attendance"))
(<div> class: "grid_12 no-margins"
(<div> class: "padding info-body"
(<table> class: "attendance"
(++ (<tr> (<td> class: "label" "Date")
(fold (lambda (e o)
(++ o (<td> class: "label"
(++ (first e) "/" (second e)))))
""
dates))
(fold (lambda (e o)
(++ o (<tr> (<td> class: "label" (first e))
(dates->filled-tds (second e) club clubber dates))))
""
`(("Present" ,(lambda (c cl d) (present c cl d)))
("Bible" ,(lambda (c cl d) (bible c cl d)))
("Handbook" ,(lambda (c cl d) (handbook c cl d)))
("Uniform" ,(lambda (c cl d) (uniform c cl d)))
("Friend" ,(lambda (c cl d) (friend c cl d)))
("Extra" ,(lambda (c cl d) (extra c cl d)))
("Sunday School" ,(lambda (c cl d) (sunday-school c cl d)))
("Dues" ,(lambda (c cl d) (dues c cl d)))
("On Time" ,(lambda (c cl d) (on-time c cl d))))))))))))))
css: '("/css/clubbers.css?ver=1")
tab: 'clubbers
title: "Clubber Info - Club Night - KtR")
(define (false->date e) (if (not e) (make-date 0 0 0 0 9 9 1999) e))
(define (make-registration-sort club)
(lambda (c1 c2)
(date<? (false->date (db->date (date-registered club c2)))
(false->date (db->date (date-registered club c1))))))
(define-awana-app-page (regexp "/[^/]*/clubbers/new")
(lambda (path)
(let ((club (get-club path)))
(++ (<div> class: "grid_12 column-header"
(<div> class: "padding" "Clubbers By Registration Date"))
(<div> class: "grid_12 column-body"
(<div> class: "padding"
(<table>
(<tr> (<td> class: "col-head" "Clubber")
(<td> class: "col-head" "Registered")
(<td> class: "col-head" "Sent Thank You?")
(<td> class: "col-head" "Address"))
(fold (lambda (c o)
(ajax (++ "update-thank-you" c)
(string->symbol (++ "thank-you" c))
'click
(lambda ()
(thank-you club c (date->db (current-date)))
(date->db (current-date)))
target: (++ "thank-you" c)
method: 'PUT)
(++ o
(<tr> (<td> (<a> href: (++ "/" club "/clubbers/info/" c)
class: "clubber-name"
(name club c)))
(<td> (date-registered club c))
(<td> (let ((t (thank-you club c)))
(if t
(<div> class: "yes" t)
(<div> class: "no" id: (++ "thank-you" c) "No"))))
(<td> (parent-address club (primary-parent club c))))))
""
(sort (db:list "clubs" club "clubbers") (make-registration-sort club)))))))))
no-ajax: #f