Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
73df3141
Commit
73df3141
authored
12 years ago
by
Matthew Mongeau
Browse files
Options
Downloads
Patches
Plain Diff
wip
parent
2f96527f
Loading
Loading
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
common/djangoapps/student/views.py
+2
-7
2 additions, 7 deletions
common/djangoapps/student/views.py
lms/templates/dashboard.html
+0
-3
0 additions, 3 deletions
lms/templates/dashboard.html
lms/templates/profile.html
+0
-23
0 additions, 23 deletions
lms/templates/profile.html
with
2 additions
and
33 deletions
common/djangoapps/student/views.py
+
2
−
7
View file @
73df3141
...
...
@@ -150,17 +150,14 @@ def logout_user(request):
@login_required
@ensure_csrf_cookie
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
if
'
location
'
in
request
.
POST
:
up
.
location
=
request
.
POST
[
'
location
'
]
if
'
language
'
in
request
.
POST
:
up
.
language
=
request
.
POST
[
'
language
'
]
up
.
save
()
return
HttpResponse
(
json
.
dumps
({
'
success
'
:
True
,
'
language
'
:
up
.
language
,
'
location
'
:
up
.
location
,}))
@ensure_csrf_cookie
...
...
@@ -171,7 +168,7 @@ def create_account(request, post_override=None):
post_vars
=
post_override
if
post_override
else
request
.
POST
# 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
:
js
[
'
value
'
]
=
"
Error (401 {field}). E-mail us.
"
.
format
(
field
=
a
)
return
HttpResponse
(
json
.
dumps
(
js
))
...
...
@@ -238,7 +235,6 @@ def create_account(request, post_override=None):
up
=
UserProfile
(
user
=
u
)
up
.
name
=
post_vars
[
'
name
'
]
up
.
language
=
post_vars
[
'
language
'
]
up
.
country
=
post_vars
[
'
country
'
]
up
.
gender
=
post_vars
[
'
gender
'
]
up
.
mailing_address
=
post_vars
[
'
mailing_address
'
]
...
...
@@ -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
"
,
'
password
'
:
id_generator
(),
'
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
),
'
honor_code
'
:
u
'
true
'
,
'
terms_of_service
'
:
u
'
true
'
,}
...
...
This diff is collapsed.
Click to expand it.
lms/templates/dashboard.html
+
0
−
3
View file @
73df3141
...
...
@@ -16,9 +16,6 @@
<li>
<span
class=
"title"
><div
class=
"icon location-icon"
></div>
Location
</span><span
class=
"data"
>
${ user.profile.location }
</span>
</li>
<li>
<span
class=
"title"
><div
class=
"icon language-icon"
></div>
Language
</span><span
class=
"data"
>
${ user.profile.language }
</span>
</li>
</ul>
</section>
</header>
...
...
This diff is collapsed.
Click to expand it.
lms/templates/profile.html
+
0
−
23
View file @
73df3141
...
...
@@ -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
(){
$
(
'
.modal
'
).
trigger
(
'
click
'
);
log_event
(
"
profile
"
,
{
"
type
"
:
"
password_show
"
});
...
...
@@ -206,9 +186,6 @@ $(function() {
<li>
Location:
<div
id=
"location_sub"
>
${location}
</div><div
id=
"description"
></div>
<a
href=
"#"
id=
"change_location"
aria-label=
"Edit Location"
>
Edit
</a>
</li>
<li>
Language:
<div
id=
"language_sub"
>
${language}
</div>
<a
href=
"#"
id=
"change_language"
aria-label=
"Edit Language"
>
Edit
</a>
</li>
<li>
Password reset
<input
id=
"id_email"
type=
"hidden"
name=
"email"
maxlength=
"75"
value=
"${email}"
/>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment