Fix up the signup modal for registration for the new fields.
This commit is contained in:
@@ -8,11 +8,12 @@ file and check it in at the same time as your model changes. To do that,
|
||||
2. django-admin.py schemamigration student --auto --settings=lms.envs.dev --pythonpath=. description_of_your_change
|
||||
3. Add the migration file created in mitx/common/djangoapps/student/migrations/
|
||||
"""
|
||||
from datetime import datetime
|
||||
import json
|
||||
import uuid
|
||||
|
||||
from django.db import models
|
||||
from django.contrib.auth.models import User
|
||||
import json
|
||||
from django_countries import CountryField
|
||||
|
||||
#from cache_toolbox import cache_model, cache_relation
|
||||
@@ -36,6 +37,8 @@ class UserProfile(models.Model):
|
||||
location = models.CharField(blank=True, max_length=255, db_index=True)
|
||||
|
||||
# Optional demographic data we started capturing from Fall 2012
|
||||
this_year = datetime.now().year
|
||||
VALID_YEARS = range(this_year, this_year - 120, -1)
|
||||
year_of_birth = models.IntegerField(blank=True, null=True, db_index=True)
|
||||
GENDER_CHOICES = (('m', 'Male'), ('f', 'Female'), ('o', 'Other'))
|
||||
gender = models.CharField(blank=True, null=True, max_length=6, db_index=True,
|
||||
@@ -43,7 +46,7 @@ class UserProfile(models.Model):
|
||||
LEVEL_OF_EDUCATION_CHOICES = (('p_se', 'Doctorate in science or engineering'),
|
||||
('p_oth', 'Doctorate in another field'),
|
||||
('m', "Master's or professional degree"),
|
||||
('b', "Master's or professional degree"),
|
||||
('b', "Bachelor's degree"),
|
||||
('hs', "Secondary/high school"),
|
||||
('jhs', "Junior secondary/junior high/middle school"),
|
||||
('el', "Elementary/primary school"),
|
||||
|
||||
@@ -210,7 +210,7 @@
|
||||
|
||||
.citizenship, .gender {
|
||||
float: left;
|
||||
width: flex-grid(6);
|
||||
width: flex-grid(4);
|
||||
}
|
||||
|
||||
.citizenship {
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
<div class="input-group">
|
||||
<section class="citizenship">
|
||||
<label>Level of Education</label>
|
||||
<label>Ed. completed</label>
|
||||
<div class="input-wrapper">
|
||||
<select name="level_of_education">
|
||||
<option value="">--</option>
|
||||
@@ -57,7 +57,13 @@
|
||||
<section class="gender">
|
||||
<label>Year of birth</label>
|
||||
<div class="input-wrapper">
|
||||
<input name="year_of_birth" type="text" placeholder="Year of birth">
|
||||
<select name="year_of_birth">
|
||||
<option value="">--</option>
|
||||
%for year in UserProfile.VALID_YEARS:
|
||||
<option value="${year}">${year}</option>
|
||||
%endfor
|
||||
</select>
|
||||
##<input name="year_of_birth" type="text" placeholder="Year of birth">
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user