diff --git a/common/test/acceptance/tests/lms/test_learner_profile.py b/common/test/acceptance/tests/lms/test_learner_profile.py index 226ddfe87c..73ae7e3f42 100644 --- a/common/test/acceptance/tests/lms/test_learner_profile.py +++ b/common/test/acceptance/tests/lms/test_learner_profile.py @@ -387,8 +387,8 @@ class OwnLearnerProfilePageTest(LearnerProfileTestMixin, WebAppTest): Then `about me` field mode should be `edit` """ placeholder_value = ( - "Tell other edX learners a little about yourself: where you live, what your interests are, " - "why you're taking courses on edX, or what you hope to learn." + "Tell other learners a little about yourself: where you live, what your interests are, " + "why you're taking courses, or what you hope to learn." ) username, user_id = self.log_in_as_unique_user() diff --git a/lms/djangoapps/student_profile/views.py b/lms/djangoapps/student_profile/views.py index 7ac0b09491..1a38b06d25 100644 --- a/lms/djangoapps/student_profile/views.py +++ b/lms/djangoapps/student_profile/views.py @@ -12,6 +12,8 @@ from django.views.decorators.http import require_http_methods from edxmako.shortcuts import render_to_response from student.models import User +from microsite_configuration import microsite + from django.utils.translation import ugettext as _ @@ -81,6 +83,7 @@ def learner_profile_context(logged_in_username, profile_username, user_is_staff) 'own_profile': (logged_in_username == profile_username), 'country_options': country_options, 'language_options': settings.ALL_LANGUAGES, + 'platform_name': microsite.get_value('platform_name', settings.PLATFORM_NAME), } } diff --git a/lms/envs/aws.py b/lms/envs/aws.py index 9d21ce3760..7ec48ef4f0 100644 --- a/lms/envs/aws.py +++ b/lms/envs/aws.py @@ -601,9 +601,10 @@ if FEATURES.get('INDIVIDUAL_DUE_DATES'): # PROFILE IMAGE CONFIG PROFILE_IMAGE_BACKEND = ENV_TOKENS.get('PROFILE_IMAGE_BACKEND', PROFILE_IMAGE_BACKEND) -PROFILE_IMAGE_DEFAULT_FILENAME = ENV_TOKENS.get('PROFILE_IMAGE_DEFAULT_FILENAME', PROFILE_IMAGE_DEFAULT_FILENAME) PROFILE_IMAGE_SECRET_KEY = AUTH_TOKENS.get('PROFILE_IMAGE_SECRET_KEY', PROFILE_IMAGE_SECRET_KEY) PROFILE_IMAGE_MAX_BYTES = ENV_TOKENS.get('PROFILE_IMAGE_MAX_BYTES', PROFILE_IMAGE_MAX_BYTES) PROFILE_IMAGE_MIN_BYTES = ENV_TOKENS.get('PROFILE_IMAGE_MIN_BYTES', PROFILE_IMAGE_MIN_BYTES) if FEATURES['IS_EDX_DOMAIN']: PROFILE_IMAGE_DEFAULT_FILENAME = 'images/edx-theme/default-profile' +else: + PROFILE_IMAGE_DEFAULT_FILENAME = ENV_TOKENS.get('PROFILE_IMAGE_DEFAULT_FILENAME', PROFILE_IMAGE_DEFAULT_FILENAME) 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 index 7685e8bed9..becad825f8 100644 --- a/lms/static/js/spec/student_account/account_settings_factory_spec.js +++ b/lms/static/js/spec/student_account/account_settings_factory_spec.js @@ -46,6 +46,13 @@ define(['backbone', 'jquery', 'underscore', 'js/common_helpers/ajax_helpers', 'j ] }; + var createAccountSettingsPage = function() { + var context = AccountSettingsPage( + FIELDS_DATA, AUTH_DATA, Helpers.USER_ACCOUNTS_API_URL, Helpers.USER_PREFERENCES_API_URL, 'edX' + ); + return context.accountSettingsView; + }; + var requests; beforeEach(function () { @@ -61,10 +68,7 @@ define(['backbone', 'jquery', 'underscore', 'js/common_helpers/ajax_helpers', 'j requests = AjaxHelpers.requests(this); - var context = AccountSettingsPage( - FIELDS_DATA, AUTH_DATA, Helpers.USER_ACCOUNTS_API_URL, Helpers.USER_PREFERENCES_API_URL - ); - var accountSettingsView = context.accountSettingsView; + var accountSettingsView = createAccountSettingsPage(); Helpers.expectLoadingIndicatorIsVisible(accountSettingsView, true); Helpers.expectLoadingErrorIsVisible(accountSettingsView, false); @@ -85,10 +89,7 @@ define(['backbone', 'jquery', 'underscore', 'js/common_helpers/ajax_helpers', 'j requests = AjaxHelpers.requests(this); - var context = AccountSettingsPage( - FIELDS_DATA, AUTH_DATA, Helpers.USER_ACCOUNTS_API_URL, Helpers.USER_PREFERENCES_API_URL - ); - var accountSettingsView = context.accountSettingsView; + var accountSettingsView = createAccountSettingsPage(); Helpers.expectLoadingIndicatorIsVisible(accountSettingsView, true); Helpers.expectLoadingErrorIsVisible(accountSettingsView, false); @@ -117,10 +118,7 @@ define(['backbone', 'jquery', 'underscore', 'js/common_helpers/ajax_helpers', 'j requests = AjaxHelpers.requests(this); - var context = AccountSettingsPage( - FIELDS_DATA, AUTH_DATA, Helpers.USER_ACCOUNTS_API_URL, Helpers.USER_PREFERENCES_API_URL - ); - var accountSettingsView = context.accountSettingsView; + var accountSettingsView = createAccountSettingsPage(); Helpers.expectLoadingIndicatorIsVisible(accountSettingsView, true); Helpers.expectLoadingErrorIsVisible(accountSettingsView, false); @@ -138,10 +136,7 @@ define(['backbone', 'jquery', 'underscore', 'js/common_helpers/ajax_helpers', 'j requests = AjaxHelpers.requests(this); - var context = AccountSettingsPage( - FIELDS_DATA, AUTH_DATA, Helpers.USER_ACCOUNTS_API_URL, Helpers.USER_PREFERENCES_API_URL - ); - var accountSettingsView = context.accountSettingsView; + var accountSettingsView = createAccountSettingsPage(); AjaxHelpers.respondWithJson(requests, Helpers.createAccountSettingsData()); AjaxHelpers.respondWithJson(requests, Helpers.createUserPreferencesData()); diff --git a/lms/static/js/spec/student_account/account_settings_fields_spec.js b/lms/static/js/spec/student_account/account_settings_fields_spec.js index 1970e9ebcd..8ce84c6ae1 100644 --- a/lms/static/js/spec/student_account/account_settings_fields_spec.js +++ b/lms/static/js/spec/student_account/account_settings_fields_spec.js @@ -82,7 +82,7 @@ define(['backbone', 'jquery', 'underscore', 'js/common_helpers/ajax_helpers', 'j AjaxHelpers.respondWithError(requests, 500); FieldViewsSpecHelpers.expectMessageContains( view, - "You must sign out of edX and sign back in before your language changes take effect." + "You must sign out and sign back in before your language changes take effect." ); }); diff --git a/lms/static/js/spec/student_profile/learner_profile_factory_spec.js b/lms/static/js/spec/student_profile/learner_profile_factory_spec.js index 7d3bd8e1bc..3aa2cc2458 100644 --- a/lms/static/js/spec/student_profile/learner_profile_factory_spec.js +++ b/lms/static/js/spec/student_profile/learner_profile_factory_spec.js @@ -40,7 +40,8 @@ define(['backbone', 'jquery', 'underscore', 'js/common_helpers/ajax_helpers', 'j 'profile_image_min_bytes': Helpers.IMAGE_MIN_BYTES, 'profile_image_upload_url': Helpers.IMAGE_UPLOAD_API_URL, 'profile_image_remove_url': Helpers.IMAGE_REMOVE_API_URL, - 'default_visibility': 'all_users' + 'default_visibility': 'all_users', + 'platform_name': 'edX' }); }; diff --git a/lms/static/js/student_account/views/account_settings_factory.js b/lms/static/js/student_account/views/account_settings_factory.js index af46599688..07daa25174 100644 --- a/lms/static/js/student_account/views/account_settings_factory.js +++ b/lms/static/js/student_account/views/account_settings_factory.js @@ -10,7 +10,7 @@ ], function (gettext, $, _, Backbone, Logger, FieldViews, UserAccountModel, UserPreferencesModel, AccountSettingsFieldViews, AccountSettingsView) { - return function (fieldsData, authData, userAccountsApiUrl, userPreferencesApiUrl, accountUserId) { + return function (fieldsData, authData, userAccountsApiUrl, userPreferencesApiUrl, accountUserId, platformName) { var accountSettingsElement = $('.wrapper-account-settings'); @@ -29,7 +29,9 @@ model: userAccountModel, title: gettext('Username'), valueAttribute: 'username', - helpMessage: gettext('The name that identifies you on the edX site. You cannot change your username.') + helpMessage: interpolate_text( + gettext('The name that identifies you throughout {platform_name}. You cannot change your username.'), {platform_name: platformName} + ) }) }, { @@ -37,7 +39,7 @@ model: userAccountModel, title: gettext('Full Name'), valueAttribute: 'name', - helpMessage: gettext('The name that appears on your edX certificates. Other learners never see your full name.') + helpMessage: gettext('The name that appears on your certificates. Other learners never see your full name.') }) }, { @@ -45,7 +47,9 @@ model: userAccountModel, title: gettext('Email Address'), valueAttribute: 'email', - helpMessage: gettext('The email address you use to sign in to edX. Communications from edX and your courses are sent to this address.') + helpMessage: interpolate_text( + gettext('The email address you use to sign in. Communications from {platform_name} and your courses are sent to this address.'), {platform_name: platformName} + ) }) }, { @@ -67,8 +71,9 @@ valueAttribute: 'pref-lang', required: true, refreshPageOnSave: true, - helpMessage: - gettext('The language used for the edX site. The site is currently available in a limited number of languages.'), + helpMessage: interpolate_text( + gettext('The language used throughout this site. This site is currently available in a limited number of languages.'), {platform_name: platformName} + ), options: fieldsData.language.options }) }, diff --git a/lms/static/js/student_account/views/account_settings_fields.js b/lms/static/js/student_account/views/account_settings_fields.js index ca3fe3f492..45bea90f8d 100644 --- a/lms/static/js/student_account/views/account_settings_fields.js +++ b/lms/static/js/student_account/views/account_settings_fields.js @@ -38,10 +38,7 @@ error: function () { view.showNotificationMessage( view.indicators.error + - gettext( - 'You must sign out of edX and sign back in before your language ' + - 'changes take effect.' - ) + gettext('You must sign out and sign back in before your language changes take effect.') ); } }); diff --git a/lms/static/js/student_profile/views/learner_profile_factory.js b/lms/static/js/student_profile/views/learner_profile_factory.js index dfe65a1dd7..a66dc3f45e 100644 --- a/lms/static/js/student_profile/views/learner_profile_factory.js +++ b/lms/static/js/student_profile/views/learner_profile_factory.js @@ -40,7 +40,9 @@ required: true, editable: 'always', showMessages: false, - title: gettext('edX learners can see my:'), + title: interpolate_text( + gettext('{platform_name} learners can see my:'), {platform_name: options.platform_name} + ), valueAttribute: "account_privacy", options: [ ['private', gettext('Limited Profile')], @@ -101,7 +103,7 @@ editable: editable, showMessages: false, title: gettext('About me'), - placeholderValue: gettext("Tell other edX learners a little about yourself: where you live, what your interests are, why you're taking courses on edX, or what you hope to learn."), + placeholderValue: gettext("Tell other learners a little about yourself: where you live, what your interests are, why you're taking courses, or what you hope to learn."), valueAttribute: "bio", helpMessage: '' }) diff --git a/lms/templates/student_account/account_settings.html b/lms/templates/student_account/account_settings.html index d05a55ca69..7b3fed68bb 100644 --- a/lms/templates/student_account/account_settings.html +++ b/lms/templates/student_account/account_settings.html @@ -1,6 +1,8 @@ <%! import json %> <%! from django.core.urlresolvers import reverse %> +<%! from django.conf import settings %> <%! from django.utils.translation import ugettext as _ %> +<%! from microsite_configuration import microsite %> @@ -40,9 +42,11 @@ var fieldsData = ${ json.dumps(fields) }; var authData = ${ json.dumps(auth) }; + var platformName = ${ json.dumps(microsite.get_value('platform_name', settings.PLATFORM_NAME))}; setupAccountSettingsSection( - fieldsData, authData, '${user_accounts_api_url}', '${user_preferences_api_url}', ${user.id} + fieldsData, authData, '${user_accounts_api_url}', '${user_preferences_api_url}', ${user.id}, + platformName ); }); }).call(this, require || RequireJS.require); diff --git a/openedx/core/djangoapps/user_api/accounts/image_helpers.py b/openedx/core/djangoapps/user_api/accounts/image_helpers.py index 8c38dd4f3f..48dde39941 100644 --- a/openedx/core/djangoapps/user_api/accounts/image_helpers.py +++ b/openedx/core/djangoapps/user_api/accounts/image_helpers.py @@ -8,6 +8,8 @@ from django.core.exceptions import ObjectDoesNotExist from django.core.files.storage import get_storage_class from staticfiles.storage import staticfiles_storage +from microsite_configuration import microsite + from student.models import UserProfile from ..errors import UserNotFound @@ -108,7 +110,7 @@ def _get_default_profile_image_urls(): TODO The result of this function should be memoized, but not in tests. """ return _get_profile_image_urls( - settings.PROFILE_IMAGE_DEFAULT_FILENAME, + microsite.get_value('PROFILE_IMAGE_DEFAULT_FILENAME', settings.PROFILE_IMAGE_DEFAULT_FILENAME), staticfiles_storage, file_extension=settings.PROFILE_IMAGE_DEFAULT_FILE_EXTENSION, )