Commit 9b8ff773 by Toby Lawrence

Merge pull request #11824 from edx/release

Merge release back to master.
parents 7ead068a 3d95bd54
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'))
......
......@@ -159,6 +159,7 @@ class @Problem
@setupInputTypes()
@bind()
@queueing()
@renderProgressState()
@el.attr('aria-busy', 'false')
else
$.postWithPrefix "#{@url}/problem_get", (response) =>
......
......@@ -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 <a href="test_url">Section 1</a>'
)
@patch.dict("django.conf.settings.FEATURES", {"ENABLE_EDXNOTES": False})
def test_edxnotes_view_is_disabled(self):
"""
......
......@@ -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()
......
/**
* 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");
});
});
......@@ -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:
<div class="placeholder-cta student-notes-cta">
<p class="placeholder-cta-copy">${_('Get started by making a note in something you just read, like {section_link}.').format(
section_link='<a href="{url}">{section_name}</a>'.format(
<p class="placeholder-cta-copy">${Text(_('Get started by making a note in something you just read, like {section_link}.')).format(
section_link=HTML('<a href="{url}">{section_name}</a>').format(
url=position['url'],
section_name=position['display_name'],
)
......
......@@ -10,6 +10,8 @@
{% stylesheet 'style-vendor' %}
{% stylesheet 'style-main' %}
{% stylesheet 'style-course-vendor' %}
{% stylesheet 'style-course' %}
{% block main_vendor_js %}
{% javascript 'main_vendor' %}
......
......@@ -6,30 +6,49 @@
{% endblock %}
{% block bodyextra %}
<script type="text/javascript">
$(function() {
'use strict';
// adding js class for styling with accessibility in mind
$('body').addClass('js');
});
</script>
<script type="text/javascript">
$(function() {
// adding js class for styling with accessibility in mind
$('body').addClass('js');
// new window/tab opening
$('a[rel="external"], a[class="new-vp"]')
.click( function() {
window.open( $(this).attr('href') );
return false;
});
// 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");
});
});
</script>
{% endblock %}
{% block bodyclass %}view-passwordreset{% endblock %}
{% block body %}
<div id="password-reset-complete-container" class="login-register">
<section id="password-reset-complete-anchor" class="form-type">
<div id="password-reset-complete" class="form-wrapper" aria-hidden="true">
<div class="status submission-success" aria-live="polite">
<h4 class="message-title">{% trans "Password Reset Complete" %}</h4>
<ul class="message-copy">
{% blocktrans with link_start='<a href="/login">' link_end='</a>' %}
Your password has been reset. {{ link_start }}Sign in to your account.{{ link_end }}
{% endblocktrans %}
</ul>
</div>
</div>
<section class="introduction">
<header>
<h1 class="title">
<span class="title-super">
{% trans "Your Password Reset is Complete" %}
</span>
</h1>
</header>
</section>
<section class="passwordreset container">
{% block content %}
<section role="main" class="content">
{% blocktrans with link_start='<a href="/login">' link_end='</a>' %}
Your password has been set. You may go ahead and {{ link_start }}log in{{ link_end }} now.
{% endblocktrans %}
</section>
</div>
{% endblock %}
</section>
{% endblock %}
......@@ -3,70 +3,148 @@
{% block title %}
<title>
{% blocktrans with platform_name=platform_name %}
Reset Your {{ platform_name }} Password
{% endblocktrans %}
{% blocktrans with platform_name=platform_name %}
Reset Your {{ platform_name }} Password
{% endblocktrans %}
</title>
{% endblock %}
{% block bodyextra %}
<script type="text/javascript" src="{{STATIC_URL}}js/student_account/password_reset.js"></script>
<script type="text/javascript">
$(function() {
// adding js class for styling with accessibility in mind
$('body').addClass('js');
// new window/tab opening
$('a[rel="external"], a[class="new-vp"]')
.click( function() {
window.open( $(this).attr('href') );
return false;
});
// 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");
});
});
</script>
{% endblock %}
{% block bodyclass %}view-passwordreset{% endblock %}
{% block body %}
<div id="password-reset-confirm-container" class="login-register">
<section id="password-reset-confirm-anchor" class="form-type">
<div id="password-reset-confirm-form" class="form-wrapper" aria-hidden="true">
<div class="status submission-error {% if not err_msg %} hidden {% endif %}" aria-live="polite">
<h4 class="message-title">{% trans "Error Resetting Password" %}</h4>
<ul class="message-copy">
{% if err_msg %}
<li>{{err_msg}}</li>
{% else %}
<li>{% trans "You must enter and confirm your new password." %}</li>
<li>{% trans "The text in both password fields must match." %}</li>
{% endif %}
</ul>
</div>
{% if validlink %}
<form role="form" id="passwordreset-form" method="post" action="">{% csrf_token %}
<div class="section-title lines">
<h2>
<span class="text">
{% trans "Reset Your Password" %}
</span>
</h2>
</div>
<p class="action-label">
{% trans "Enter and confirm your new password." %}
</p>
<div class="form-field new_password1-new_password1">
<label for="new_password1">{% trans "New Password" %}</label>
<input id="new_password1" type="password" name="new_password1" placeholder="*****" />
</div>
<div class="form-field new_password2-new_password2">
<label for="new_password2">{% trans "Confirm Password" %}</label>
<input id="new_password2" type="password" name="new_password2" placeholder="*****" />
</div>
<button type="submit" class="action action-primary action-update js-reset">{% trans "Reset My Password" %}</button>
</form>
<section class="introduction">
<header>
<h1 class="title">
<span class="title-super">
{% blocktrans with platform_name=platform_name %}
Reset Your {{ platform_name }} Password
{% endblocktrans %}
</span>
</h1>
</header>
</section>
<section class="passwordreset container">
<section role="main" class="content">
{% if validlink %}
<header>
<h2 class="sr">{% trans "Password Reset Form" %}</h2>
</header>
<form role="form" id="passwordreset-form" method="post" action="">{% csrf_token %}
<!-- status messages -->
<div role="alert" class="status message">
<h3 class="message-title">
{% blocktrans %}
We're sorry, but this version of your browser is not supported. Try again using a different browser or a newer version of your browser.
{% endblocktrans %}
</h3>
</div>
{% if err_msg %}
<div role="alert" class="status message submission-error" style="display: block;">
{% else %}
<div role="alert" class="status message submission-error" style="display: none;">
{% endif %}
<h3 class="message-title">{% trans "The following errors occurred while processing your registration: " %}</h3>
<ul class="message-copy">
{% if err_msg %}
<li>{{err_msg}}</li>
{% else %}
<div class="status submission-error" aria-live="polite">
<h4 class="message-title">{% trans "Invalid Password Reset Link" %}</h4>
<ul class="message-copy">
{% blocktrans with start_link='<a href="/login">' end_link='</a>' %}
This password reset link is invalid. It may have been used already. To reset your password, go to the {{ start_link }}sign-in{{ end_link }} page and select <strong>Forgot password</strong>.
{% endblocktrans %}
</ul>
</div>
<li>{% trans "You must complete all fields." %}</li>
<li>{% trans "The two password fields didn't match." %}</li>
{% endif %}
</ul>
</div>
<div role="alert" class="status message system-error">
<h3 class="message-title">{% trans "We're sorry, our systems seem to be having trouble processing your password reset" %}</h3>
<p class="message-copy">
{% blocktrans with start_link='<a href="{{MKTG_URL_CONTACT}}">' end_link='</a>' %}
Someone has been made aware of this issue. Please try again shortly. Please {{ start_link }}contact us{{ end_link }} about any concerns you have.
{% endblocktrans %}
</p>
</div>
<p class="instructions">
{% trans 'Please enter your new password twice so we can verify you typed it in correctly.' %}
<br />
{% blocktrans with bold_start='<strong class="indicator">' bold_end='</strong>' %}
Required fields are noted by {{bold_start}}bold text and an asterisk (*){{bold_end}}.
{% endblocktrans %}
</p>
<fieldset class="group group-form group-form-requiredinformation">
<legend class="sr">{% trans "Required Information" %}</legend>
<ol class="list-input">
<li class="field required password" id="field-new_password1">
<label for="new_password1">{% trans "Your New Password" %}</label>
<input id="new_password1" type="password" name="new_password1" placeholder="*****" />
</li>
<li class="field required password" id="field-new_password2">
<label for="new_password2">{% trans "Your New Password Again" %}</label>
<input id="new_password2" type="password" name="new_password2" placeholder="*****" />
</li>
</ol>
</fieldset>
<div class="form-actions">
<button name="submit" type="submit" id="submit" class="action action-primary action-update">{% trans "Change My Password" %}</button>
</div>
</form>
{% else %}
<header>
<h2 class="sr">{% trans "Your Password Reset Was Unsuccessful" %}</h2>
</header>
<p>
{% blocktrans with start_link='<a href="/login">' end_link='</a>' %}
The password reset link was invalid, possibly because the link has already been used. Please return to the {{ start_link }}login page{{ end_link }} and start the password reset process again.
{% endblocktrans %}
</p>
{% endif %}
</section>
</div>
<aside role="complementary">
<header>
<h3 class="sr">{% trans "Password Reset Help" %}</h3>
</header>
<div class="cta cta-help">
<h3>{% trans "Need Help?" %}</h3>
<p>
{% blocktrans with start_link='<a href="{{MKTG_URL_FAQ}}">' end_link='</a>' %}
View our {{ start_link }}help section for contact information and answers to commonly asked questions{{ end_link }}
{% endblocktrans %}
</p>
</div>
</aside>
</section>
{% endblock %}
......@@ -85,7 +85,6 @@ pysrt==0.4.7
PyYAML==3.10
requests==2.7.0
requests-oauthlib==0.4.1
rfc6266==0.0.4
scipy==0.14.0
Shapely==1.2.16
singledispatch==3.4.0.2
......
......@@ -65,6 +65,9 @@ git+https://github.com/hmarr/django-debug-toolbar-mongo.git@b0686a76f1ce3532088c
# custom opaque-key implementations for CCX
git+https://github.com/edx/ccx-keys.git@0.1.1#egg=ccx-keys==0.1.1
# NOTE (CCB): This must remain. There is one commit on the upstream repo that has not been released to PyPI.
git+https://github.com/edx/rfc6266.git@v0.0.5-edx#egg=rfc6266==0.0.5-edx
# Used for testing
git+https://github.com/edx/lettuce.git@0.2.20.002#egg=lettuce==0.2.20.002
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment