more fields
This commit is contained in:
parent
fa55e10e5b
commit
36bb39a8a0
4 changed files with 29 additions and 6 deletions
|
@ -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!
|
||||
|
|
|
@ -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,""
|
||||
|
|
|
|
@ -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):
|
||||
|
|
|
@ -60,18 +60,36 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="form-floating mb-3 required">
|
||||
{{ form.phone_number(class="form-control") }}
|
||||
{{ form.phone_number.label() }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-floating mb-3 required">
|
||||
{{ form.age(class="form-control") }}
|
||||
{{ form.age.label() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-floating mb-3 required">
|
||||
{{ form.gender(class="form-control") }}
|
||||
{{ form.gender.label() }}
|
||||
</div>
|
||||
<div class="form-floating mb-3">
|
||||
{{ form.dietary_restrictions(class="form-control") }}
|
||||
{{ form.dietary_restrictions.label() }}
|
||||
</div>
|
||||
<div class="form-check mb-3 required">
|
||||
{{ form.agree_coc }}
|
||||
I confirm that I have read and agree to the <a href="https://static.mlh.io/docs/mlh-code-of-conduct.pdf" target="_blank">MLH Code of Conduct</a>
|
||||
</div>
|
||||
<div class="form-check mb-3">
|
||||
{{ form.newsletter }}
|
||||
Subscribe to the MLH newsletter?
|
||||
</div>
|
||||
{{ render_field(form.submit) }}
|
||||
</form>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue