Commit 1dad2fd3 by David Ormsbee

Fix up the signup modal for registration for the new fields.

parent 0f8fc4d7
...@@ -8,11 +8,12 @@ file and check it in at the same time as your model changes. To do that, ...@@ -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 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/ 3. Add the migration file created in mitx/common/djangoapps/student/migrations/
""" """
from datetime import datetime
import json
import uuid import uuid
from django.db import models from django.db import models
from django.contrib.auth.models import User from django.contrib.auth.models import User
import json
from django_countries import CountryField from django_countries import CountryField
#from cache_toolbox import cache_model, cache_relation #from cache_toolbox import cache_model, cache_relation
...@@ -36,6 +37,8 @@ class UserProfile(models.Model): ...@@ -36,6 +37,8 @@ class UserProfile(models.Model):
location = models.CharField(blank=True, max_length=255, db_index=True) location = models.CharField(blank=True, max_length=255, db_index=True)
# Optional demographic data we started capturing from Fall 2012 # 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) year_of_birth = models.IntegerField(blank=True, null=True, db_index=True)
GENDER_CHOICES = (('m', 'Male'), ('f', 'Female'), ('o', 'Other')) GENDER_CHOICES = (('m', 'Male'), ('f', 'Female'), ('o', 'Other'))
gender = models.CharField(blank=True, null=True, max_length=6, db_index=True, gender = models.CharField(blank=True, null=True, max_length=6, db_index=True,
...@@ -43,7 +46,7 @@ class UserProfile(models.Model): ...@@ -43,7 +46,7 @@ class UserProfile(models.Model):
LEVEL_OF_EDUCATION_CHOICES = (('p_se', 'Doctorate in science or engineering'), LEVEL_OF_EDUCATION_CHOICES = (('p_se', 'Doctorate in science or engineering'),
('p_oth', 'Doctorate in another field'), ('p_oth', 'Doctorate in another field'),
('m', "Master's or professional degree"), ('m', "Master's or professional degree"),
('b', "Master's or professional degree"), ('b', "Bachelor's degree"),
('hs', "Secondary/high school"), ('hs', "Secondary/high school"),
('jhs', "Junior secondary/junior high/middle school"), ('jhs', "Junior secondary/junior high/middle school"),
('el', "Elementary/primary school"), ('el', "Elementary/primary school"),
......
...@@ -210,7 +210,7 @@ ...@@ -210,7 +210,7 @@
.citizenship, .gender { .citizenship, .gender {
float: left; float: left;
width: flex-grid(6); width: flex-grid(4);
} }
.citizenship { .citizenship {
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<div class="input-group"> <div class="input-group">
<section class="citizenship"> <section class="citizenship">
<label>Level of Education</label> <label>Ed. completed</label>
<div class="input-wrapper"> <div class="input-wrapper">
<select name="level_of_education"> <select name="level_of_education">
<option value="">--</option> <option value="">--</option>
...@@ -57,7 +57,13 @@ ...@@ -57,7 +57,13 @@
<section class="gender"> <section class="gender">
<label>Year of birth</label> <label>Year of birth</label>
<div class="input-wrapper"> <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> </div>
</section> </section>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment