Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
1dad2fd3
Commit
1dad2fd3
authored
Jul 22, 2012
by
David Ormsbee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix up the signup modal for registration for the new fields.
parent
0f8fc4d7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
5 deletions
+14
-5
common/djangoapps/student/models.py
+5
-2
lms/static/sass/shared/_modal.scss
+1
-1
lms/templates/signup_modal.html
+8
-2
No files found.
common/djangoapps/student/models.py
View file @
1dad2fd3
...
...
@@ -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"
),
...
...
lms/static/sass/shared/_modal.scss
View file @
1dad2fd3
...
...
@@ -210,7 +210,7 @@
.citizenship
,
.gender
{
float
:
left
;
width
:
flex-grid
(
6
);
width
:
flex-grid
(
4
);
}
.citizenship
{
...
...
lms/templates/signup_modal.html
View file @
1dad2fd3
...
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment