diff --git a/lms/djangoapps/ccx/tests/test_views.py b/lms/djangoapps/ccx/tests/test_views.py index 44b9bc64e2..358f1d1a32 100644 --- a/lms/djangoapps/ccx/tests/test_views.py +++ b/lms/djangoapps/ccx/tests/test_views.py @@ -738,10 +738,7 @@ class TestCoachDashboard(CcxTestCase, LoginEnrollmentTestCase): # some error messages are returned for one of the views only if view_name == 'ccx_manage_student' and not is_email(identifier): - error_message = 'Could not find a user with name or email "{identifier}" '.format( - identifier=identifier - ) - self.assertContains(response, error_message, status_code=200) + self.assertContains(response, 'Could not find a user with name or email ', status_code=200) if is_email(identifier): if send_email: diff --git a/lms/templates/ccx/coach_dashboard.html b/lms/templates/ccx/coach_dashboard.html index 67307b4a1f..b94ca71a35 100644 --- a/lms/templates/ccx/coach_dashboard.html +++ b/lms/templates/ccx/coach_dashboard.html @@ -1,8 +1,12 @@ +<%page expression_filter="h"/> <%inherit file="/main.html" /> <%namespace name='static' file='/static_content.html'/> <%! from django.utils.translation import ugettext as _ from django.core.urlresolvers import reverse +from openedx.core.djangolib.js_utils import ( + dump_js_escaped_json, js_escaped_string +) %> <%block name="pagetitle">${_("CCX Coach Dashboard")} @@ -163,14 +167,14 @@ from django.core.urlresolvers import reverse function validateForm(form) { var newCCXName = $(form).find('#ccx_name').val(); var $errorMessage = $('#ccx-create-message'); - var hasCcxConnector = ${has_ccx_connector}; + var hasCcxConnector = ${has_ccx_connector | n, dump_js_escaped_json}; if (!newCCXName && !hasCcxConnector) { - $errorMessage.text("${_('Please enter a valid CCX name.')}"); + $errorMessage.text("${_('Please enter a valid CCX name.') | n, js_escaped_string}"); $errorMessage.show(); return false; } else if (hasCcxConnector) { - $errorMessage.html('${use_ccx_con_error_message}'); + $errorMessage.html('${use_ccx_con_error_message | n, js_escaped_string}'); $errorMessage.show(); return false; } diff --git a/lms/templates/ccx/enrollment.html b/lms/templates/ccx/enrollment.html index a6c64c4130..8d0ba6a994 100644 --- a/lms/templates/ccx/enrollment.html +++ b/lms/templates/ccx/enrollment.html @@ -1,4 +1,8 @@ -<%! from django.utils.translation import ugettext as _ %> +<%page expression_filter="h"/> +<%! +from django.utils.translation import ugettext as _ +from openedx.core.djangolib.markup import Text, HTML +%>
@@ -18,8 +22,16 @@

- ${_("If this option is checked, users who have not yet registered for {platform_name} will be automatically enrolled.").format(platform_name=settings.PLATFORM_NAME)} - ${_("If this option is left unchecked, users who have not yet registered for {platform_name} will not be enrolled, but will be allowed to enroll once they make an account.").format(platform_name=settings.PLATFORM_NAME)} + ${Text(_("If this option is {em_start}checked{em_end}, users who have not yet registered for {platform_name} will be automatically enrolled.")).format( + em_start=HTML(''), + em_end=HTML(''), + platform_name=settings.PLATFORM_NAME, + )} + ${Text(_("If this option is left {em_start}unchecked{em_end}, users who have not yet registered for {platform_name} will not be enrolled, but will be allowed to enroll once they make an account.")).format( + em_start=HTML(''), + em_end=HTML(''), + platform_name=settings.PLATFORM_NAME, + )}

${_("Checking this box has no effect if 'Unenroll' is selected.")}

@@ -32,7 +44,10 @@
@@ -90,8 +105,16 @@

- ${_("If this option is checked, users who have not yet registered for {platform_name} will be automatically enrolled.").format(platform_name=settings.PLATFORM_NAME)} - ${_("If this option is left unchecked, users who have not yet registered for {platform_name} will not be enrolled, but will be allowed to enroll once they make an account.").format(platform_name=settings.PLATFORM_NAME)} + ${Text(_("If this option is {em_start}checked{em_end}, users who have not yet registered for {platform_name} will be automatically enrolled.")).format( + em_start=HTML(''), + em_end=HTML(''), + platform_name=settings.PLATFORM_NAME, + )} + ${Text(_("If this option is left {em_start}unchecked{em_end}, users who have not yet registered for {platform_name} will not be enrolled, but will be allowed to enroll once they make an account.")).format( + em_start=HTML(''), + em_end=HTML(''), + platform_name=settings.PLATFORM_NAME, + )}

${_("Checking this box has no effect if 'Revoke' is clicked.")}

@@ -103,7 +126,10 @@
diff --git a/lms/templates/ccx/grading_policy.html b/lms/templates/ccx/grading_policy.html index 98e1085491..f643140ace 100644 --- a/lms/templates/ccx/grading_policy.html +++ b/lms/templates/ccx/grading_policy.html @@ -1,3 +1,4 @@ +<%page expression_filter="h"/> <%! from django.utils.translation import ugettext as _ %>
diff --git a/lms/templates/ccx/schedule.html b/lms/templates/ccx/schedule.html index 6950950c9d..01a1d2b83b 100644 --- a/lms/templates/ccx/schedule.html +++ b/lms/templates/ccx/schedule.html @@ -1,13 +1,19 @@ -<%! from django.utils.translation import ugettext as _ %> +<%page expression_filter="h"/> +<%! +from django.utils.translation import ugettext as _ +from openedx.core.djangolib.js_utils import ( + dump_js_escaped_json, js_escaped_string +) +%> <%namespace name='static' file='/static_content.html'/> <%block name="jsextra"> - - +