From 73df314159c8952c4e982c6daecba005da4d3429 Mon Sep 17 00:00:00 2001 From: Matthew Mongeau Date: Wed, 18 Jul 2012 11:12:56 -0400 Subject: [PATCH] wip --- common/djangoapps/student/views.py | 9 ++------- lms/templates/dashboard.html | 3 --- lms/templates/profile.html | 23 ----------------------- 3 files changed, 2 insertions(+), 33 deletions(-) diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index 6aeebfe2e6..7a88f45622 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -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',} diff --git a/lms/templates/dashboard.html b/lms/templates/dashboard.html index 48579d7117..62f02f783b 100644 --- a/lms/templates/dashboard.html +++ b/lms/templates/dashboard.html @@ -16,9 +16,6 @@
  • Location
    ${ user.profile.location }
  • -
  • -
    Language
    ${ user.profile.language } -
  • diff --git a/lms/templates/profile.html b/lms/templates/profile.html index 6caaea7b5b..d355ffd07e 100644 --- a/lms/templates/profile.html +++ b/lms/templates/profile.html @@ -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('
    '+''+ - ''+'
    '); - $("#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() {
  • Location:
    ${location}
    Edit
  • -
  • - Language:
    ${language}
    Edit -
  • Password reset