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
73df3141
Commit
73df3141
authored
Jul 18, 2012
by
Matthew Mongeau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
2f96527f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
33 deletions
+2
-33
common/djangoapps/student/views.py
+2
-7
lms/templates/dashboard.html
+0
-3
lms/templates/profile.html
+0
-23
No files found.
common/djangoapps/student/views.py
View file @
73df3141
...
@@ -150,17 +150,14 @@ def logout_user(request):
...
@@ -150,17 +150,14 @@ def logout_user(request):
@login_required
@login_required
@ensure_csrf_cookie
@ensure_csrf_cookie
def
change_setting
(
request
):
def
change_setting
(
request
):
''' JSON call to change a profile setting: Right now, location
and language
''' JSON call to change a profile setting: Right now, location
'''
'''
up
=
UserProfile
.
objects
.
get
(
user
=
request
.
user
)
#request.user.profile_cache
up
=
UserProfile
.
objects
.
get
(
user
=
request
.
user
)
#request.user.profile_cache
if
'location'
in
request
.
POST
:
if
'location'
in
request
.
POST
:
up
.
location
=
request
.
POST
[
'location'
]
up
.
location
=
request
.
POST
[
'location'
]
if
'language'
in
request
.
POST
:
up
.
language
=
request
.
POST
[
'language'
]
up
.
save
()
up
.
save
()
return
HttpResponse
(
json
.
dumps
({
'success'
:
True
,
return
HttpResponse
(
json
.
dumps
({
'success'
:
True
,
'language'
:
up
.
language
,
'location'
:
up
.
location
,}))
'location'
:
up
.
location
,}))
@ensure_csrf_cookie
@ensure_csrf_cookie
...
@@ -171,7 +168,7 @@ def create_account(request, post_override=None):
...
@@ -171,7 +168,7 @@ def create_account(request, post_override=None):
post_vars
=
post_override
if
post_override
else
request
.
POST
post_vars
=
post_override
if
post_override
else
request
.
POST
# Confirm we have a properly formed request
# Confirm we have a properly formed request
for
a
in
[
'username'
,
'email'
,
'password'
,
'
language'
,
'
name'
]:
for
a
in
[
'username'
,
'email'
,
'password'
,
'name'
]:
if
a
not
in
post_vars
:
if
a
not
in
post_vars
:
js
[
'value'
]
=
"Error (401 {field}). E-mail us."
.
format
(
field
=
a
)
js
[
'value'
]
=
"Error (401 {field}). E-mail us."
.
format
(
field
=
a
)
return
HttpResponse
(
json
.
dumps
(
js
))
return
HttpResponse
(
json
.
dumps
(
js
))
...
@@ -238,7 +235,6 @@ def create_account(request, post_override=None):
...
@@ -238,7 +235,6 @@ def create_account(request, post_override=None):
up
=
UserProfile
(
user
=
u
)
up
=
UserProfile
(
user
=
u
)
up
.
name
=
post_vars
[
'name'
]
up
.
name
=
post_vars
[
'name'
]
up
.
language
=
post_vars
[
'language'
]
up
.
country
=
post_vars
[
'country'
]
up
.
country
=
post_vars
[
'country'
]
up
.
gender
=
post_vars
[
'gender'
]
up
.
gender
=
post_vars
[
'gender'
]
up
.
mailing_address
=
post_vars
[
'mailing_address'
]
up
.
mailing_address
=
post_vars
[
'mailing_address'
]
...
@@ -288,7 +284,6 @@ def create_random_account(create_account_function):
...
@@ -288,7 +284,6 @@ def create_random_account(create_account_function):
'email'
:
id_generator
(
size
=
10
,
chars
=
string
.
ascii_lowercase
)
+
"_dummy_test@mitx.mit.edu"
,
'email'
:
id_generator
(
size
=
10
,
chars
=
string
.
ascii_lowercase
)
+
"_dummy_test@mitx.mit.edu"
,
'password'
:
id_generator
(),
'password'
:
id_generator
(),
'location'
:
id_generator
(
size
=
5
,
chars
=
string
.
ascii_uppercase
),
'location'
:
id_generator
(
size
=
5
,
chars
=
string
.
ascii_uppercase
),
'language'
:
id_generator
(
size
=
5
,
chars
=
string
.
ascii_uppercase
)
+
"ish"
,
'name'
:
id_generator
(
size
=
5
,
chars
=
string
.
ascii_lowercase
)
+
" "
+
id_generator
(
size
=
7
,
chars
=
string
.
ascii_lowercase
),
'name'
:
id_generator
(
size
=
5
,
chars
=
string
.
ascii_lowercase
)
+
" "
+
id_generator
(
size
=
7
,
chars
=
string
.
ascii_lowercase
),
'honor_code'
:
u'true'
,
'honor_code'
:
u'true'
,
'terms_of_service'
:
u'true'
,}
'terms_of_service'
:
u'true'
,}
...
...
lms/templates/dashboard.html
View file @
73df3141
...
@@ -16,9 +16,6 @@
...
@@ -16,9 +16,6 @@
<li>
<li>
<span
class=
"title"
><div
class=
"icon location-icon"
></div>
Location
</span><span
class=
"data"
>
${ user.profile.location }
</span>
<span
class=
"title"
><div
class=
"icon location-icon"
></div>
Location
</span><span
class=
"data"
>
${ user.profile.location }
</span>
</li>
</li>
<li>
<span
class=
"title"
><div
class=
"icon language-icon"
></div>
Language
</span><span
class=
"data"
>
${ user.profile.language }
</span>
</li>
</ul>
</ul>
</section>
</section>
</header>
</header>
...
...
lms/templates/profile.html
View file @
73df3141
...
@@ -49,26 +49,6 @@ $(function() {
...
@@ -49,26 +49,6 @@ $(function() {
}
}
});
});
$
(
"#change_language"
).
click
(
function
()
{
$
(
this
).
hide
();
log_event
(
"profile"
,
{
"type"
:
"language_show"
,
"old"
:
$
(
"#language_sub"
).
text
()});
if
(
lang
)
{
lang
=
false
;
$
(
"#language_sub"
).
html
(
'<form>'
+
'<input id="id_lang_text" type="text" name="lang_text" />'
+
'<input type="submit" id="change_lang_button" value="Save" />'
+
'</form>'
);
$
(
"#change_lang_button"
).
click
(
function
()
{
$
(
"#change_language"
).
show
();
postJSON
(
'/change_setting'
,
{
'language'
:
$
(
"#id_lang_text"
).
attr
(
"value"
)},
function
(
json
)
{
$
(
"#language_sub"
).
text
(
json
.
language
);
lang
=
true
;
$
(
"#description"
).
html
(
""
);
log_event
(
"profile"
,
{
"type"
:
"language_change"
,
"new"
:
json
.
language
});
});
});
}
});
$
(
'#change_password'
).
click
(
function
(){
$
(
'#change_password'
).
click
(
function
(){
$
(
'.modal'
).
trigger
(
'click'
);
$
(
'.modal'
).
trigger
(
'click'
);
log_event
(
"profile"
,
{
"type"
:
"password_show"
});
log_event
(
"profile"
,
{
"type"
:
"password_show"
});
...
@@ -207,9 +187,6 @@ $(function() {
...
@@ -207,9 +187,6 @@ $(function() {
Location:
<div
id=
"location_sub"
>
${location}
</div><div
id=
"description"
></div>
<a
href=
"#"
id=
"change_location"
aria-label=
"Edit Location"
>
Edit
</a>
Location:
<div
id=
"location_sub"
>
${location}
</div><div
id=
"description"
></div>
<a
href=
"#"
id=
"change_location"
aria-label=
"Edit Location"
>
Edit
</a>
</li>
</li>
<li>
<li>
Language:
<div
id=
"language_sub"
>
${language}
</div>
<a
href=
"#"
id=
"change_language"
aria-label=
"Edit Language"
>
Edit
</a>
</li>
<li>
Password reset
Password reset
<input
id=
"id_email"
type=
"hidden"
name=
"email"
maxlength=
"75"
value=
"${email}"
/>
<input
id=
"id_email"
type=
"hidden"
name=
"email"
maxlength=
"75"
value=
"${email}"
/>
<input
type=
"submit"
id=
"pwd_reset_button"
value=
"Reset"
aria-label=
"Reset Password"
/>
<input
type=
"submit"
id=
"pwd_reset_button"
value=
"Reset"
aria-label=
"Reset Password"
/>
...
...
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