{STANDARD_START {"Team Sign Up}} {DEF allrequests {userinfo {'SU:name} {'Your name} {'} {'40} {'(e.g. Joe Foo)}} {userinfo {'SU:email} {'Your Email} {'\@ai.mit.edu} {'25} {'(include domain; e.g. foo\@ai.mit.edu)}} {userinfo {'SU:photourl} {'URL to a photo of yourself} {'http://www.ai.mit.edu/people/} {'40} {'(e.g. http://www.ai.mit.edu/people/foo/me.gif)}} } {SET SU:error FALSE} {WHEN {DEFINED submitted} {DEF userinfo {WHEN {AND {DEFINED submitted} {== @@0 @2}} {SET SU:error TRUE}} } {allrequests} {userinfo {'SU:comment} {'} {'} {'}{'}} } {IF {OR {NOT {DEFINED submitted}} @SU:error} {' {DEF userinfo {IF {AND {DEFINED submitted} {== @@0 @2}} {' @1 {SET SU:error TRUE}} {'@1} } @4 }
{allrequests}
{IF {AND {DEFINED submitted} {== @SU:comment {"}}} {' Give us a comment! {SET SU:error TRUE}} {'Leave a comment for your teammates} }
} {' {IF {FILE_READABLE {'{THIS_PATH}olympians/{@SU:email}}} {' {DEF TEAMMEMBER {@4}}

{@SU:name}, ({@SU:email})

you are already on the team:

{FILE_INCLUDE {'{THIS_PATH}olympians/{@SU:email}}}

} {' {SET TEAMNUM {INT {INLINE cat {THIS_PATH}olympians/... | head -{FILE_INCLUDE {'{THIS_PATH}register.txt}} | tail -1}}}

{@SU:name},

you are now on the team:

@{'TEAM{@TEAMNUM}}

{FILE_APPEND {'{THIS_PATH}olympians/{@SU:email}} \{TEAMMEMBER \{"{@SU:email}\} \{"{@SU:name}\} \{"{@SU:photourl}\} \{"{@SU:comment}\} \{"@{'TEAM{@TEAMNUM}}\} \{"{@TEAMNUM}\} \{"{FILE_INCLUDE {'{THIS_PATH}register.txt}}\} \} } {FILE_APPEND {'{THIS_PATH}teamlist} \{TEAMMEMBER \{"{@SU:email}\} \{"{@SU:name}\} \{"{@SU:photourl}\} \{"{@SU:comment}\} \{"@{'TEAM{@TEAMNUM}}\} \{"{@TEAMNUM}\} \{"{FILE_INCLUDE {'{THIS_PATH}register.txt}}\} \} } {FILE_APPEND {'{THIS_PATH}@{'TEAMFILE{@TEAMNUM}}} \{TEAMMEMBER \{"{@SU:email}\} \{"{@SU:name}\} \{"{@SU:photourl}\} \{"{@SU:comment}\} \{"@{'TEAM{@TEAMNUM}}\} \{"{@TEAMNUM}\} \{"{FILE_INCLUDE {'{THIS_PATH}register.txt}}\} \} } {FILE_INC {'{THIS_PATH}/register.txt}} } }}} {STANDARD_END}