From 20d72ea7033386a59a72fc904ceb6b2272a31a7e Mon Sep 17 00:00:00 2001 From: Diana Huang Date: Thu, 5 Sep 2013 15:19:15 -0400 Subject: [PATCH] Clean up views and start work on edit name modal. --- lms/djangoapps/verify_student/urls.py | 18 -------------- lms/djangoapps/verify_student/views.py | 13 +--------- lms/static/js/verify_student/photocapture.js | 24 +++++++++++++++++++ .../emails/order_confirmation_email.txt | 2 +- .../verify_student/_modal_editname.html | 7 +++--- .../verify_student/photo_verification.html | 4 ++-- 6 files changed, 31 insertions(+), 37 deletions(-) diff --git a/lms/djangoapps/verify_student/urls.py b/lms/djangoapps/verify_student/urls.py index 606d96a785..a4af53ba63 100644 --- a/lms/djangoapps/verify_student/urls.py +++ b/lms/djangoapps/verify_student/urls.py @@ -5,24 +5,6 @@ from verify_student import views urlpatterns = patterns( '', - url( - r'^face_upload', - views.face_upload, - name="verify_student/face_upload" - ), - url( - r'^photo_id_upload', - views.photo_id_upload, - name="verify_student/photo_id_upload" - ), - url( - r'^final_verification', - views.final_verification, - name="verify_student/final_verification" - ), - - # The above are what we did for the design mockups, but what we're really - # looking at now is: url( r'^show_requirements/(?P[^/]+/[^/]+/[^/]+)$', views.show_requirements, diff --git a/lms/djangoapps/verify_student/views.py b/lms/djangoapps/verify_student/views.py index 1c66aa2bed..dbccb4927f 100644 --- a/lms/djangoapps/verify_student/views.py +++ b/lms/djangoapps/verify_student/views.py @@ -142,20 +142,9 @@ def show_requirements(request, course_id): """ Show the requirements necessary for """ - context = { "course_id": course_id, "is_not_active": not request.user.is_active} + context = {"course_id": course_id, "is_not_active": not request.user.is_active} return render_to_response("verify_student/show_requirements.html", context) -def face_upload(request): - context = { "course_id": "edX/Certs101/2013_Test" } - return render_to_response("verify_student/face_upload.html", context) - -def photo_id_upload(request): - context = { "course_id": "edX/Certs101/2013_Test" } - return render_to_response("verify_student/photo_id_upload.html", context) - -def final_verification(request): - context = { "course_id": "edX/Certs101/2013_Test" } - return render_to_response("verify_student/final_verification.html", context) def show_verification_page(request): pass diff --git a/lms/static/js/verify_student/photocapture.js b/lms/static/js/verify_student/photocapture.js index 0566d97880..a214cf06c3 100644 --- a/lms/static/js/verify_student/photocapture.js +++ b/lms/static/js/verify_student/photocapture.js @@ -67,6 +67,26 @@ function doSnapshotButton(captureButton, resetButton, approveButton) { approveButton.show(); } + +function submitNameChange(event) { + event.preventDefault(); + var full_name = $('input[name="name"]').val(); + var xhr = $.post( + "/change_name", + { + "new_name" : full_name, + "rationale": "Want to match ID for ID Verified Certificates." + }, + function(data) { + $('#full-name').html(full_name); + } + ) + .fail(function(jqXhr,text_status, error_thrown) { + $('.message-copy').html(jqXhr.responseText); + }); + +} + function initSnapshotHandler(names, hasHtml5CameraSupport) { var name = names.pop(); if (name == undefined) { @@ -187,6 +207,10 @@ $(document).ready(function() { $('body').addClass('step-review').removeClass('step-photos-id') }) + // set up edit information dialog + $('#edit-name div[role="alert"]').hide(); + $('#edit-name .action-save').click(submitNameChange); + var hasHtml5CameraSupport = initVideoCapture(); // If HTML5 WebRTC capture is not supported, we initialize jpegcam diff --git a/lms/templates/emails/order_confirmation_email.txt b/lms/templates/emails/order_confirmation_email.txt index 43d03ce667..7615fd3498 100644 --- a/lms/templates/emails/order_confirmation_email.txt +++ b/lms/templates/emails/order_confirmation_email.txt @@ -1,5 +1,5 @@ <%! from django.utils.translation import ugettext as _ %> -${_("Hi {name}").format(name=order.user.first_name)} +${_("Hi {name}").format(name=order.user.profile.name)} ${_("Your payment was successful. You will see the charge below on your next credit or debit card statement. The charge will show up on your statement under the company name {platform_name}. If you have billing questions, please read the FAQ or contact {billing_email}. We hope you enjoy your order.").format(platform_name=settings.PLATFORM_NAME,billing_email=settings.PAYMENT_SUPPORT_EMAIL)} diff --git a/lms/templates/verify_student/_modal_editname.html b/lms/templates/verify_student/_modal_editname.html index 4d19580f54..dbe8551854 100644 --- a/lms/templates/verify_student/_modal_editname.html +++ b/lms/templates/verify_student/_modal_editname.html @@ -12,15 +12,14 @@

- +

- - +
- + ${_("close")} diff --git a/lms/templates/verify_student/photo_verification.html b/lms/templates/verify_student/photo_verification.html index 7ef3b350a5..90f238a6e1 100644 --- a/lms/templates/verify_student/photo_verification.html +++ b/lms/templates/verify_student/photo_verification.html @@ -251,12 +251,12 @@

${_("Check Your Name")}

-

${_("Make sure your full name on your edX account ({}) matches your ID. We will also use this as the name on your certificate.").format(user_full_name)}

+

${_("Make sure your full name on your edX account ({full_name}) matches your ID. We will also use this as the name on your certificate.").format(full_name="" + user_full_name + "")}