diff --git a/goathacks/registration/__init__.py b/goathacks/registration/__init__.py index 957138f..46370eb 100644 --- a/goathacks/registration/__init__.py +++ b/goathacks/registration/__init__.py @@ -31,8 +31,9 @@ def register(): phone = request.form.get('phone_number') gender = request.form.get('gender') country = request.form.get('country') - print(school) - + age = request.form.get('age') + dietary_restrictions = request.form.get('dietary_restrictions') + newsletter = request.form.get('newsletter') # if password == password_c: # # Passwords match! diff --git a/goathacks/registration/countries.csv b/goathacks/registration/countries.csv index 7601a15..54c73e3 100644 --- a/goathacks/registration/countries.csv +++ b/goathacks/registration/countries.csv @@ -1,3 +1,4 @@ +United States of America,US,USA,840,ISO 3166-2:US,Americas,Northern America,"",019,021,"" Afghanistan,AF,AFG,004,ISO 3166-2:AF,Asia,Southern Asia,"",142,034,"" Ă…land Islands,AX,ALA,248,ISO 3166-2:AX,Europe,Northern Europe,"",150,154,"" Albania,AL,ALB,008,ISO 3166-2:AL,Europe,Southern Europe,"",150,039,"" @@ -233,7 +234,6 @@ Uganda,UG,UGA,800,ISO 3166-2:UG,Africa,Sub-Saharan Africa,Eastern Africa,002,202 Ukraine,UA,UKR,804,ISO 3166-2:UA,Europe,Eastern Europe,"",150,151,"" United Arab Emirates,AE,ARE,784,ISO 3166-2:AE,Asia,Western Asia,"",142,145,"" United Kingdom of Great Britain and Northern Ireland,GB,GBR,826,ISO 3166-2:GB,Europe,Northern Europe,"",150,154,"" -United States of America,US,USA,840,ISO 3166-2:US,Americas,Northern America,"",019,021,"" United States Minor Outlying Islands,UM,UMI,581,ISO 3166-2:UM,Oceania,Micronesia,"",009,057,"" Uruguay,UY,URY,858,ISO 3166-2:UY,Americas,Latin America and the Caribbean,South America,019,419,005 Uzbekistan,UZ,UZB,860,ISO 3166-2:UZ,Asia,Central Asia,"",142,143,"" diff --git a/goathacks/registration/forms.py b/goathacks/registration/forms.py index 38f4e23..6abb65e 100644 --- a/goathacks/registration/forms.py +++ b/goathacks/registration/forms.py @@ -1,5 +1,5 @@ from flask_wtf import FlaskForm -from wtforms import BooleanField, PasswordField, SelectField, StringField, SubmitField, widgets +from wtforms import BooleanField, IntegerField, PasswordField, SelectField, StringField, SubmitField, widgets from wtforms.validators import DataRequired import os @@ -17,11 +17,15 @@ class RegisterForm(FlaskForm): validators=[DataRequired()]) school = SelectField("School", choices=[(school, school) for school in schools_list], widget=widgets.Select()) phone_number = StringField("Phone number", validators=[DataRequired()]) + age = IntegerField("Age", validators=[DataRequired()]) + dietary_restrictions = StringField("Dietary Restrictions (Optional)") gender = SelectField("Gender", choices=[("F", "Female"), ("M", "Male"), ("NB", "Non-binary/Other")], widget=widgets.Select()) country = SelectField("Country", choices=[(country.split(",")[0], country.split(",")[0]) for country in countries_list], widget=widgets.Select()) + newsletter = BooleanField("Subscribe to the MLH newsletter?") agree_coc = BooleanField("I confirm that I have read and agree to the Code of Conduct", validators=[DataRequired()]) + submit = SubmitField("Register") class LoginForm(FlaskForm): diff --git a/goathacks/templates/register.html b/goathacks/templates/register.html index abe6164..7331eb7 100644 --- a/goathacks/templates/register.html +++ b/goathacks/templates/register.html @@ -60,18 +60,36 @@ -
+
+
+
{{ form.phone_number(class="form-control") }} - {{ form.phone_number.label() }} + {{ form.phone_number.label() }} +
+
+
+
+ {{ form.age(class="form-control") }} + {{ form.age.label() }} +
+
{{ form.gender(class="form-control") }} {{ form.gender.label() }}
+
+ {{ form.dietary_restrictions(class="form-control") }} + {{ form.dietary_restrictions.label() }} +
{{ form.agree_coc }} I confirm that I have read and agree to the MLH Code of Conduct
+
+ {{ form.newsletter }} + Subscribe to the MLH newsletter? +
{{ render_field(form.submit) }}