" +
- gettext("You'll receive a confirmation in your inbox. Please follow the link in the email to confirm your email address change.") +
- "
"
- );
- } else {
- $("#change_email_error").html(data.error).stop().css("display", "block");
- }
- }
- );
- return false;
- });
-
- $("#change_name_form").submit(function(){
- var new_name = $('#new_name_field').val();
- var rationale = $('#name_rationale_field').val();
-
- $.post(
- urls.changeName,
- {"new_name":new_name, "rationale":rationale},
- function(data) {
- if(data.success) {
- location.reload();
- } else {
- $("#change_name_error").html(data.error).stop().css("display", "block");
- }
- }
- );
- return false;
- });
-
$("#email_settings_form").submit(function(){
$.ajax({
type: "POST",
@@ -240,24 +176,6 @@
return false;
});
- accessibleModal(
- ".edit-name",
- "#apply_name_change .close-modal",
- "#apply_name_change",
- "#dashboard-main"
- );
- accessibleModal(
- ".edit-email",
- "#change_email .close-modal",
- "#change_email",
- "#dashboard-main"
- );
- accessibleModal(
- "#pwd_reset_button",
- "#password_reset_complete .close-modal",
- "#password_reset_complete",
- "#dashboard-main"
- );
$(".action-email-settings").each(function(index){
$(this).attr("id", "email-settings-" + index);
diff --git a/lms/static/js/fixtures/student_profile/student_profile.html b/lms/static/js/fixtures/student_profile/student_profile.html
new file mode 100644
index 0000000000..40ae15e5ba
--- /dev/null
+++ b/lms/static/js/fixtures/student_profile/student_profile.html
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+ Loading
+
+
+
+
+
+
+ An error occurred. Please reload the page.
+
+
+
diff --git a/lms/static/js/spec/main.js b/lms/static/js/spec/main.js
index d3932fc64b..05b9357134 100644
--- a/lms/static/js/spec/main.js
+++ b/lms/static/js/spec/main.js
@@ -30,6 +30,7 @@
'backbone': 'xmodule_js/common_static/js/vendor/backbone-min',
'backbone.associations': 'xmodule_js/common_static/js/vendor/backbone-associations-min',
'backbone.paginator': 'xmodule_js/common_static/js/vendor/backbone.paginator.min',
+ "backbone-super": "js/vendor/backbone-super",
'tinymce': 'xmodule_js/common_static/js/vendor/tinymce/js/tinymce/tinymce.full.min',
'jquery.tinymce': 'xmodule_js/common_static/js/vendor/tinymce/js/tinymce/jquery.tinymce',
'xmodule': 'xmodule_js/src/xmodule',
@@ -58,6 +59,7 @@
// Manually specify LMS files that are not converted to RequireJS
'history': 'js/vendor/history',
+ 'js/mustache': 'js/mustache',
'js/verify_student/photocapture': 'js/verify_student/photocapture',
'js/staff_debug_actions': 'js/staff_debug_actions',
'js/vendor/jquery.qubit': 'js/vendor/jquery.qubit',
@@ -88,6 +90,9 @@
'js/student_account/views/RegisterView': 'js/student_account/views/RegisterView',
'js/student_account/views/AccessView': 'js/student_account/views/AccessView',
'js/student_profile/profile': 'js/student_profile/profile',
+ 'js/student_profile/views/learner_profile_fields': 'js/student_profile/views/learner_profile_fields',
+ 'js/student_profile/views/learner_profile_factory': 'js/student_profile/views/learner_profile_factory',
+ 'js/student_profile/views/learner_profile_view': 'js/student_profile/views/learner_profile_view',
// edxnotes
'annotator_1.2.9': 'xmodule_js/common_static/js/vendor/edxnotes/annotator-full.min'
@@ -197,6 +202,9 @@
deps: ['backbone'],
exports: 'Backbone.Paginator'
},
+ "backbone-super": {
+ deps: ["backbone"],
+ },
'youtube': {
exports: 'YT'
},
@@ -583,7 +591,14 @@
'lms/include/js/spec/student_account/enrollment_spec.js',
'lms/include/js/spec/student_account/emailoptin_spec.js',
'lms/include/js/spec/student_account/shoppingcart_spec.js',
+ 'lms/include/js/spec/student_account/account_settings_factory_spec.js',
+ 'lms/include/js/spec/student_account/account_settings_fields_spec.js',
+ 'lms/include/js/spec/student_account/account_settings_view_spec.js',
'lms/include/js/spec/student_profile/profile_spec.js',
+ 'lms/include/js/spec/views/fields_spec.js',
+ 'lms/include/js/spec/student_profile/learner_profile_factory_spec.js',
+ 'lms/include/js/spec/student_profile/learner_profile_view_spec.js',
+ 'lms/include/js/spec/student_profile/learner_profile_fields_spec.js',
'lms/include/js/spec/verify_student/pay_and_verify_view_spec.js',
'lms/include/js/spec/verify_student/webcam_photo_view_spec.js',
'lms/include/js/spec/verify_student/image_input_spec.js',
diff --git a/lms/static/js/spec/student_account/account_settings_factory_spec.js b/lms/static/js/spec/student_account/account_settings_factory_spec.js
new file mode 100644
index 0000000000..6442e400f6
--- /dev/null
+++ b/lms/static/js/spec/student_account/account_settings_factory_spec.js
@@ -0,0 +1,196 @@
+define(['backbone', 'jquery', 'underscore', 'js/common_helpers/ajax_helpers', 'js/common_helpers/template_helpers',
+ 'js/spec/views/fields_helpers',
+ 'js/spec/student_account/helpers',
+ 'js/spec/student_account/account_settings_fields_helpers',
+ 'js/student_account/views/account_settings_factory',
+ 'js/student_account/views/account_settings_view'
+ ],
+ function (Backbone, $, _, AjaxHelpers, TemplateHelpers, FieldViewsSpecHelpers, Helpers,
+ AccountSettingsFieldViewSpecHelpers, AccountSettingsPage) {
+ 'use strict';
+
+ describe("edx.user.AccountSettingsFactory", function () {
+
+ var FIELDS_DATA = {
+ 'country': {
+ 'options': Helpers.FIELD_OPTIONS
+ }, 'gender': {
+ 'options': Helpers.FIELD_OPTIONS
+ }, 'language': {
+ 'options': Helpers.FIELD_OPTIONS
+ }, 'level_of_education': {
+ 'options': Helpers.FIELD_OPTIONS
+ }, 'password': {
+ 'url': '/password_reset'
+ }, 'year_of_birth': {
+ 'options': Helpers.FIELD_OPTIONS
+ }, 'preferred_language': {
+ 'options': Helpers.FIELD_OPTIONS
+ }
+ };
+
+ var AUTH_DATA = {
+ 'providers': [
+ {
+ 'name': "Network1",
+ 'connected': true,
+ 'connect_url': 'yetanother1.com/auth/connect',
+ 'disconnect_url': 'yetanother1.com/auth/disconnect'
+ },
+ {
+ 'name': "Network2",
+ 'connected': true,
+ 'connect_url': 'yetanother2.com/auth/connect',
+ 'disconnect_url': 'yetanother2.com/auth/disconnect'
+ }
+ ]
+ };
+
+ var requests;
+
+ beforeEach(function () {
+ setFixtures('