diff --git a/common/lib/xmodule/xmodule/js/spec/capa/display_spec.coffee b/common/lib/xmodule/xmodule/js/spec/capa/display_spec.coffee index bc23566d18..2edb056bd9 100644 --- a/common/lib/xmodule/xmodule/js/spec/capa/display_spec.coffee +++ b/common/lib/xmodule/xmodule/js/spec/capa/display_spec.coffee @@ -1,4 +1,6 @@ describe 'Problem', -> + problem_content_default = readFixtures('problem_content.html') + beforeEach -> # Stub MathJax window.MathJax = @@ -20,7 +22,7 @@ describe 'Problem', -> spyOn Logger, 'log' spyOn($.fn, 'load').andCallFake (url, callback) -> - $(@).html readFixtures('problem_content.html') + $(@).html problem_content_default callback() describe 'constructor', -> @@ -96,6 +98,13 @@ describe 'Problem', -> @problem.renderProgressState() expect(@problem.$('.problem-progress').html()).toEqual "(1 point possible)" + it 'displays the number of points possible when rendering happens with the content', -> + @problem.el.data('progress_status', 'none') + @problem.el.data('progress_detail', '0/2') + expect(@problem.$('.problem-progress').html()).toEqual "" + @problem.render(problem_content_default) + expect(@problem.$('.problem-progress').html()).toEqual "(2 points possible)" + describe 'with any other valid status', -> it 'reports the current score', -> @problem.el.data('progress_status', 'foo') @@ -103,6 +112,13 @@ describe 'Problem', -> @problem.renderProgressState() expect(@problem.$('.problem-progress').html()).toEqual "(1/1 point)" + it 'shows current score when rendering happens with the content', -> + @problem.el.data('progress_status', 'test status') + @problem.el.data('progress_detail', '2/2') + expect(@problem.$('.problem-progress').html()).toEqual "" + @problem.render(problem_content_default) + expect(@problem.$('.problem-progress').html()).toEqual "(2/2 points)" + describe 'render', -> beforeEach -> @problem = new Problem($('.xblock-student_view')) diff --git a/common/lib/xmodule/xmodule/js/src/capa/display.coffee b/common/lib/xmodule/xmodule/js/src/capa/display.coffee index 524b33778e..a057a9dfd8 100644 --- a/common/lib/xmodule/xmodule/js/src/capa/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/capa/display.coffee @@ -159,6 +159,7 @@ class @Problem @setupInputTypes() @bind() @queueing() + @renderProgressState() @el.attr('aria-busy', 'false') else $.postWithPrefix "#{@url}/problem_get", (response) => diff --git a/lms/djangoapps/edxnotes/tests.py b/lms/djangoapps/edxnotes/tests.py index 76010b4e2d..cef50f5b1b 100644 --- a/lms/djangoapps/edxnotes/tests.py +++ b/lms/djangoapps/edxnotes/tests.py @@ -998,6 +998,21 @@ class EdxNotesViewsTest(ModuleStoreTestCase): response = self.client.get(self.notes_page_url) self.assertContains(response, 'Highlights and notes you've made in course content') + # pylint: disable=unused-argument + @patch.dict("django.conf.settings.FEATURES", {"ENABLE_EDXNOTES": True}) + @patch("edxnotes.views.get_notes", return_value={'results': []}) + @patch("edxnotes.views.get_course_position", return_value={'display_name': 'Section 1', 'url': 'test_url'}) + def test_edxnotes_html_tags_should_not_be_escaped(self, mock_get_notes, mock_position): + """ + Tests that explicit html tags rendered correctly. + """ + enable_edxnotes_for_the_course(self.course, self.user.id) + response = self.client.get(self.notes_page_url) + self.assertContains( + response, + 'Get started by making a note in something you just read, like Section 1' + ) + @patch.dict("django.conf.settings.FEATURES", {"ENABLE_EDXNOTES": False}) def test_edxnotes_view_is_disabled(self): """ diff --git a/lms/djangoapps/student_account/test/test_views.py b/lms/djangoapps/student_account/test/test_views.py index 585233cb93..43229700d6 100644 --- a/lms/djangoapps/student_account/test/test_views.py +++ b/lms/djangoapps/student_account/test/test_views.py @@ -100,7 +100,7 @@ class StudentAccountUpdateTest(UrlResetMixin, TestCase): follow=True ) self.assertEqual(response.status_code, 200) - self.assertContains(response, "Your password has been reset.") + self.assertContains(response, "Your password has been set.") # Log the user out to clear session data self.client.logout() @@ -116,7 +116,7 @@ class StudentAccountUpdateTest(UrlResetMixin, TestCase): follow=True ) self.assertEqual(response.status_code, 200) - self.assertContains(response, "This password reset link is invalid. It may have been used already.") + self.assertContains(response, "The password reset link was invalid, possibly because the link has already been used.") self.client.logout() diff --git a/lms/static/js/student_account/password_reset.js b/lms/static/js/student_account/password_reset.js deleted file mode 100644 index 9733909315..0000000000 --- a/lms/static/js/student_account/password_reset.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Password reset template JS. - */ -$(function() { - 'use strict'; - // adding js class for styling with accessibility in mind - $("body").addClass("js"); - - // form field label styling on focus - $("form :input").focus(function() { - $("label[for='" + this.id + "']").parent().addClass("is-focused"); - }).blur(function() { - $("label").parent().removeClass("is-focused"); - }); -}); diff --git a/lms/templates/edxnotes/edxnotes.html b/lms/templates/edxnotes/edxnotes.html index 533646c5cd..04a08dacbe 100644 --- a/lms/templates/edxnotes/edxnotes.html +++ b/lms/templates/edxnotes/edxnotes.html @@ -5,6 +5,7 @@ <%! from django.utils.translation import ugettext as _ from edxnotes.helpers import NoteJSONEncoder +from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_string %> @@ -78,8 +79,8 @@ from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_str % if position is not None:
${_('Get started by making a note in something you just read, like {section_link}.').format( - section_link='{section_name}'.format( +
${Text(_('Get started by making a note in something you just read, like {section_link}.')).format( + section_link=HTML('{section_name}').format( url=position['url'], section_name=position['display_name'], ) diff --git a/lms/templates/main_django.html b/lms/templates/main_django.html index 59c5e22078..89eb7f80c0 100644 --- a/lms/templates/main_django.html +++ b/lms/templates/main_django.html @@ -10,6 +10,8 @@ {% stylesheet 'style-vendor' %} {% stylesheet 'style-main' %} + {% stylesheet 'style-course-vendor' %} + {% stylesheet 'style-course' %} {% block main_vendor_js %} {% javascript 'main_vendor' %} diff --git a/lms/templates/registration/password_reset_complete.html b/lms/templates/registration/password_reset_complete.html index a5172e364c..908f2d610f 100644 --- a/lms/templates/registration/password_reset_complete.html +++ b/lms/templates/registration/password_reset_complete.html @@ -6,30 +6,49 @@ {% endblock %} {% block bodyextra %} - + {% endblock %} {% block bodyclass %}view-passwordreset{% endblock %} {% block body %} -