Commits

Justin Venezuela committed 5bd7db4 Draft

Added tournament info. Added division/estimated skill field to signup form

  • Participants
  • Parent commits dcfa8f8

Comments (0)

Files changed (5)

File src/handlers.py

     email = ""
     character_name = ""
     character_code = ""
+    skill = ""
     if self.request.get('name'):
       name = self.request.get('name')
     if self.request.get('email'):
         error = "Not a valid character code"
         params = {"error" : error}
         return self.response.out.write(render_template('signup.html', params))
-
+    if self.request.get('skill'):
+      skill = self.request.get('skill')
 
     error = None
-    if not (name and email and character_name and character_code):
+    if not (name and email and character_name and character_code and skill):
       error = "Please fill in all fields."
       params = {"error" : error}
       return self.response.out.write(render_template('signup.html', params))
       player.email = email
       player.character_code = character_code
       player.character_name = character_name
+      player.skill = skill
       player.put()
       success = "You were successfully added to our tournament!"
       return self.response.out.write(render_template('home.html',

File src/model.py

+"""
+Database model for MIT Starleague tournament site.
+"""
+
+__author__ = 'Justin Venezuela (jven@mit.edu), Max Nelson (maxnelso@mit.edu)'
+
 from google.appengine.ext import db
 
-
 class Player(db.Model):
   """
   Models a Starcraft player with a name, email, character_name, and
   email = db.StringProperty()
   character_name = db.StringProperty()
   character_code = db.IntegerProperty()
-
+  skill = db.StringProperty()
 
 def player_key(name, email, character_name, character_code):
   """

File src/static/css/starleague.css

   background-image: url('retina_wood.png');
 }
 
+p {
+  margin: 5px 0;
+}
+
 .homepage {
   padding: 10px 0;
   height: 210px;
 }
 
 .signup {
-  margin: 50px auto;
+  margin: 20px auto;
   width: 265px;
   font-family: 'Strait', sans-serif;
   font-size: 1.2em;
 }
 
 .tourney-name {
-  margin: 0 0 40px 0;
+  margin: 20px 0;
   font-family: 'Iceberg', cursive;
   font-size: 3.5em;
   font-weight: bold;

File src/templates/home.html

 <div class="homepage">
 <p>MIT Starleague presents</p>
 <p class="tourney-name">Wintercraft 2012</p>
+<p>When: Sat. December 1 - Sun. December 2</p>
+<p>Where: ???</p>
+<p>All skill levels welcome!</p>
 <a class="register" href="signup">I want to play!</a>
 <hr/>
 <p>Sponsored by:</p>

File src/templates/signup.html

 <div class="signup">
 Please fill in the following form:
 <form class="register-form" name="input" action="signup" method="post">
-    <input class="field" type="text" name="name" placeholder="Name">
-    <input class="field" type="text" name="email" placeholder="Email">
-    <input class="field" type="text" name="character_name" placeholder="Battle.net name">
-    <input class="field" type="text" name="character_code" placeholder="Battle.net character code">
+    <input class="field" type="text" name="name" placeholder="Name"/>
+    <input class="field" type="text" name="email" placeholder="Email"/>
+    <input class="field" type="text" name="character_name" placeholder="Battle.net name"/>
+    <input class="field" type="text" name="character_code" placeholder="Battle.net character code"/>
+    <input class="field" type="text" name="skill" placeholder="Division/estimated skill"/>
     <input class="register" type="submit" value="Sign Up!">
 </form>
 <a class="cancel" href="/">Cancel</a>