${display_name}
@@ -229,7 +229,7 @@ require(["domReady!", "jquery", "jquery.form", "js/index"], function(doc, $) {
%for course, url, lms_link, rerun_link, org, num, run in sorted(courses, key=lambda s: s[0].lower() if s[0] is not None else ''):
-
+
${course}
From 0088978281fc1f29400bd166388782f8b2e9d097 Mon Sep 17 00:00:00 2001
From: Mat Peterson
Date: Thu, 14 Aug 2014 14:47:52 +0000
Subject: [PATCH 08/42] Set GlobalStaff permissions on reruns
---
cms/djangoapps/contentstore/views/course.py | 5 ++-
cms/envs/devstack.py | 4 +++
cms/static/js/index.js | 38 ++++++++++-----------
cms/templates/course-create-rerun.html | 2 +-
cms/templates/index.html | 8 ++---
5 files changed, 32 insertions(+), 25 deletions(-)
diff --git a/cms/djangoapps/contentstore/views/course.py b/cms/djangoapps/contentstore/views/course.py
index 2bf9efa36a..0443f92827 100644
--- a/cms/djangoapps/contentstore/views/course.py
+++ b/cms/djangoapps/contentstore/views/course.py
@@ -240,6 +240,8 @@ def course_rerun_handler(request, course_key_string):
GET
html: return html page with form to rerun a course for the given course id
"""
+ if not GlobalStaff().has_user(request.user):
+ raise PermissionDenied()
course_key = CourseKey.from_string(course_key_string)
course_module = _get_course_module(course_key, request.user, depth=3)
if request.method == 'GET':
@@ -395,8 +397,9 @@ def course_listing(request):
'user': request.user,
'request_course_creator_url': reverse('contentstore.views.request_course_creator'),
'course_creator_status': _get_course_creator_status(request.user),
+ 'rerun_creator_status': GlobalStaff().has_user(request.user),
'allow_unicode_course_id': settings.FEATURES.get('ALLOW_UNICODE_COURSE_ID', False),
- 'allow_course_reruns': settings.FEATURES.get('ALLOW_COURSE_RERUNS', True)
+ 'allow_course_reruns': settings.FEATURES.get('ALLOW_COURSE_RERUNS', False)
})
diff --git a/cms/envs/devstack.py b/cms/envs/devstack.py
index cc41414c72..67bf940d40 100644
--- a/cms/envs/devstack.py
+++ b/cms/envs/devstack.py
@@ -47,6 +47,10 @@ CELERY_ALWAYS_EAGER = True
# CELERY_ALWAYS_EAGER = False
# BROKER_URL = 'redis://'
+################################ COURSE RERUNS ################################
+
+FEATURES['ALLOW_COURSE_RERUNS'] = True
+
################################ DEBUG TOOLBAR ################################
INSTALLED_APPS += ('debug_toolbar', 'debug_toolbar_mongo')
MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',)
diff --git a/cms/static/js/index.js b/cms/static/js/index.js
index 51fe74ab60..bf7feb89b3 100644
--- a/cms/static/js/index.js
+++ b/cms/static/js/index.js
@@ -77,6 +77,25 @@ require(["domReady", "jquery", "underscore", "js/utils/cancel_on_escape"],
$('.new-course-save').off('click');
};
+ // Check that a course (org, number, run) doesn't use any special characters
+ var validateCourseItemEncoding = function (item) {
+ var required = validateRequiredField(item);
+ if (required) {
+ return required;
+ }
+ if ($('.allow-unicode-course-id').val() === 'True'){
+ if (/\s/g.test(item)) {
+ return gettext('Please do not use any spaces in this field.');
+ }
+ }
+ else{
+ if (item !== encodeURIComponent(item)) {
+ return gettext('Please do not use any spaces or special characters in this field.');
+ }
+ }
+ return '';
+ };
+
var addNewCourse = function (e) {
e.preventDefault();
$('.new-course-button').addClass('is-disabled');
@@ -89,25 +108,6 @@ require(["domReady", "jquery", "underscore", "js/utils/cancel_on_escape"],
$cancelButton.bind('click', cancelNewCourse);
CancelOnEscape($cancelButton);
- // Check that a course (org, number, run) doesn't use any special characters
- var validateCourseItemEncoding = function (item) {
- var required = validateRequiredField(item);
- if (required) {
- return required;
- }
- if ($('.allow-unicode-course-id').val() === 'True'){
- if (/\s/g.test(item)) {
- return gettext('Please do not use any spaces in this field.');
- }
- }
- else{
- if (item !== encodeURIComponent(item)) {
- return gettext('Please do not use any spaces or special characters in this field.');
- }
- }
- return '';
- };
-
// Ensure that org/course_num/run < 65 chars.
var validateTotalCourseItemsLength = function () {
var totalLength = _.reduce(
diff --git a/cms/templates/course-create-rerun.html b/cms/templates/course-create-rerun.html
index 87f18d3431..2994fcf4e9 100644
--- a/cms/templates/course-create-rerun.html
+++ b/cms/templates/course-create-rerun.html
@@ -129,7 +129,7 @@ require(["domReady!", "jquery", "jquery.form", "js/views/course_rerun"], functio
-
+
diff --git a/cms/templates/index.html b/cms/templates/index.html
index bda00eb77e..b89d8c75fe 100644
--- a/cms/templates/index.html
+++ b/cms/templates/index.html
@@ -123,7 +123,7 @@ require(["domReady!", "jquery", "jquery.form", "js/index"], function(doc, $) {
-
+
@@ -132,7 +132,7 @@ require(["domReady!", "jquery", "jquery.form", "js/index"], function(doc, $) {
% endif
- %if allow_course_reruns and len(unsucceeded_course_actions) > 0:
+ %if allow_course_reruns and rerun_creator_status and len(unsucceeded_course_actions) > 0:
Courses Being Processed
@@ -248,7 +248,7 @@ require(["domReady!", "jquery", "jquery.form", "js/index"], function(doc, $) {
- % if allow_course_reruns and course_creator_status=='granted':
+ % if allow_course_reruns and rerun_creator_status and course_creator_status=='granted':
${_("Re-run Course")}
@@ -259,7 +259,7 @@ require(["domReady!", "jquery", "jquery.form", "js/index"], function(doc, $) {
%endfor
- % if course_creator_status=='granted':
+ % if allow_course_reruns and rerun_creator_status and course_creator_status=='granted':
From 6096bae755ddf37b9e0b2656c188ac415c0d8f36 Mon Sep 17 00:00:00 2001
From: Mat Peterson
Date: Thu, 14 Aug 2014 15:32:56 +0000
Subject: [PATCH 09/42] Skipping rerun test on feature flag conditional
---
cms/djangoapps/contentstore/tests/test_contentstore.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/cms/djangoapps/contentstore/tests/test_contentstore.py b/cms/djangoapps/contentstore/tests/test_contentstore.py
index caf605fda3..c5b72868ea 100644
--- a/cms/djangoapps/contentstore/tests/test_contentstore.py
+++ b/cms/djangoapps/contentstore/tests/test_contentstore.py
@@ -47,6 +47,9 @@ from student.roles import CourseCreatorRole, CourseInstructorRole
from opaque_keys import InvalidKeyError
from contentstore.tests.utils import get_url
from course_action_state.models import CourseRerunState, CourseRerunUIStateManager
+
+from unittest import skipIf
+
from course_action_state.managers import CourseActionStateItemNotFoundError
@@ -1632,6 +1635,7 @@ class RerunCourseTest(ContentStoreTestCase):
self.assertInCourseListing(source_course.id)
self.assertInCourseListing(destination_course_key)
+ @skipIf(not settings.FEATURES.get('ALLOW_COURSE_RERUNS', False), "ALLOW_COURSE_RERUNS are not enabled")
def test_rerun_course_fail_no_source_course(self):
existent_course_key = CourseFactory.create().id
non_existent_course_key = CourseLocator("org", "non_existent_course", "non_existent_run")
From 4fcb6c925ab26feddd22604e7284afae39cc60e0 Mon Sep 17 00:00:00 2001
From: Ben McMorran
Date: Thu, 14 Aug 2014 16:15:48 -0400
Subject: [PATCH 10/42] Add jasmine tests for course_rerun.js
---
cms/static/coffee/spec/main.coffee | 1 +
.../js/spec/views/pages/course_rerun_spec.js | 133 ++++++++++++++++++
cms/static/js/views/course_rerun.js | 17 ++-
.../mock/mock-create-course-rerun.underscore | 116 +++++++++++++++
4 files changed, 264 insertions(+), 3 deletions(-)
create mode 100644 cms/static/js/spec/views/pages/course_rerun_spec.js
create mode 100644 cms/templates/js/mock/mock-create-course-rerun.underscore
diff --git a/cms/static/coffee/spec/main.coffee b/cms/static/coffee/spec/main.coffee
index 2854eabe34..d80ab05764 100644
--- a/cms/static/coffee/spec/main.coffee
+++ b/cms/static/coffee/spec/main.coffee
@@ -233,6 +233,7 @@ define([
"js/spec/views/pages/container_subviews_spec",
"js/spec/views/pages/group_configurations_spec",
"js/spec/views/pages/course_outline_spec",
+ "js/spec/views/pages/course_rerun_spec",
"js/spec/views/modals/base_modal_spec",
"js/spec/views/modals/edit_xblock_spec",
diff --git a/cms/static/js/spec/views/pages/course_rerun_spec.js b/cms/static/js/spec/views/pages/course_rerun_spec.js
new file mode 100644
index 0000000000..077c395313
--- /dev/null
+++ b/cms/static/js/spec/views/pages/course_rerun_spec.js
@@ -0,0 +1,133 @@
+define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers", "js/views/course_rerun"],
+ function ($, create_sinon, view_helpers, CourseRerunPage) {
+ describe("Create course rerun page", function () {
+ var selectors = {
+ courseOrg: '.rerun-course-org',
+ courseNumber: '.rerun-course-number',
+ courseRun: '.rerun-course-run',
+ courseName: '.rerun-course-name',
+ errorField: '.tip-error',
+ saveButton: '.rerun-course-save',
+ cancelButton: '.rerun-course-cancel',
+ errorMessage: '.wrapper-error'
+ },
+ classes = {
+ hidden: 'is-hidden',
+ error: 'error',
+ disabled: 'is-disabled',
+ processing: 'is-processing'
+ },
+ mockCreateCourseRerunHTML = readFixtures('mock/mock-create-course-rerun.underscore');
+
+ var fillInFields = function (org, number, run, name) {
+ $(selectors.courseOrg).val(org);
+ $(selectors.courseNumber).val(number);
+ $(selectors.courseRun).val(run);
+ $(selectors.courseName).val(name);
+ };
+
+ beforeEach(function () {
+ view_helpers.installMockAnalytics();
+ window.source_course_key = 'test_course_key';
+ appendSetFixtures(mockCreateCourseRerunHTML);
+ CourseRerunPage.onReady();
+ });
+
+ afterEach(function () {
+ view_helpers.removeMockAnalytics();
+ delete window.source_course_key;
+ });
+
+ describe("validateRequiredField", function () {
+ it("has a message for an empty string", function () {
+ var message = CourseRerunPage.validateRequiredField('');
+ expect(message).not.toBe('');
+ });
+
+ it("does not have a message for a non empty string", function () {
+ var message = CourseRerunPage.validateRequiredField('edX');
+ expect(message).toBe('');
+ });
+ });
+
+ describe("setNewCourseFieldInErr", function () {
+ var setErrorMessage = function(selector, message) {
+ var element = $(selector).parent();
+ CourseRerunPage.setNewCourseFieldInErr(element, message);
+ return element;
+ };
+
+ it("can show an error message", function () {
+ var element = setErrorMessage(selectors.courseOrg, 'error message');
+ expect(element).toHaveClass(classes.error);
+ expect(element.children(selectors.errorField)).not.toHaveClass(classes.hidden);
+ expect(element.children(selectors.errorField)).toContainText('error message');
+ });
+
+ it("can hide an error message", function () {
+ var element = setErrorMessage(selectors.courseOrg, '');
+ expect(element).not.toHaveClass(classes.error);
+ expect(element.children(selectors.errorField)).toHaveClass(classes.hidden);
+ });
+
+ it("disables the save button", function () {
+ setErrorMessage(selectors.courseOrg, 'error message');
+ expect($(selectors.saveButton)).toHaveClass(classes.disabled);
+ });
+
+ it("enables the save button when all errors are removed", function () {
+ setErrorMessage(selectors.courseOrg, 'error message 1');
+ setErrorMessage(selectors.courseNumber, 'error message 2');
+ expect($(selectors.saveButton)).toHaveClass(classes.disabled);
+ setErrorMessage(selectors.courseOrg, '');
+ setErrorMessage(selectors.courseNumber, '');
+ expect($(selectors.saveButton)).not.toHaveClass(classes.disabled);
+ });
+
+ it("does not enable the save button when errors remain", function () {
+ setErrorMessage(selectors.courseOrg, 'error message 1');
+ setErrorMessage(selectors.courseNumber, 'error message 2');
+ expect($(selectors.saveButton)).toHaveClass(classes.disabled);
+ setErrorMessage(selectors.courseOrg, '');
+ expect($(selectors.saveButton)).toHaveClass(classes.disabled);
+ });
+ });
+
+ it("can save course reruns", function () {
+ var requests = create_sinon.requests(this);
+ window.source_course_key = 'test_course_key';
+ fillInFields('DemoX', 'DM101', '2014', 'Demo course');
+ $(selectors.saveButton).click();
+ create_sinon.expectJsonRequest(requests, 'POST', '/course/', {
+ source_course_key: 'test_course_key',
+ org: 'DemoX',
+ number: 'DM101',
+ run: '2014',
+ display_name: 'Demo course'
+ });
+ expect($(selectors.saveButton)).toHaveClass(classes.disabled);
+ expect($(selectors.saveButton)).toHaveClass(classes.processing);
+ expect($(selectors.cancelButton)).toHaveClass(classes.hidden);
+ });
+
+ it("displays an error when saving fails", function () {
+ var requests = create_sinon.requests(this);
+ fillInFields('DemoX', 'DM101', '2014', 'Demo course');
+ $(selectors.saveButton).click();
+ create_sinon.respondWithJson(requests, {
+ ErrMsg: 'error message'
+ });
+ expect($(selectors.errorMessage)).not.toHaveClass(classes.hidden);
+ expect($(selectors.errorMessage)).toContainText('error message');
+ expect($(selectors.saveButton)).not.toHaveClass(classes.processing);
+ expect($(selectors.cancelButton)).not.toHaveClass(classes.hidden);
+ });
+
+ it("does not save if there are validation errors", function () {
+ var requests = create_sinon.requests(this);
+ fillInFields('DemoX', 'DM101', '', 'Demo course');
+ $(selectors.saveButton).click();
+ expect(requests.length).toBe(0);
+ });
+ });
+ });
diff --git a/cms/static/js/views/course_rerun.js b/cms/static/js/views/course_rerun.js
index 7361a8303a..57bba6351c 100644
--- a/cms/static/js/views/course_rerun.js
+++ b/cms/static/js/views/course_rerun.js
@@ -1,4 +1,4 @@
-require(["domReady", "jquery", "underscore", "js/utils/cancel_on_escape"],
+define(["domReady", "jquery", "underscore", "js/utils/cancel_on_escape"],
function (domReady, $, _, CancelOnEscape) {
var saveRerunCourse = function (e) {
@@ -87,7 +87,7 @@ require(["domReady", "jquery", "underscore", "js/utils/cancel_on_escape"],
}
};
- domReady(function () {
+ var onReady = function () {
var $cancelButton = $('.rerun-course-cancel');
var $courseRun = $('.rerun-course-run');
$courseRun.focus().select();
@@ -175,5 +175,16 @@ require(["domReady", "jquery", "underscore", "js/utils/cancel_on_escape"],
$('.rerun-course-save').addClass('is-disabled');
}
});
- });
+ };
+
+ domReady(onReady);
+
+ // Return these functions so that they can be tested
+ return {
+ saveRerunCourse: saveRerunCourse,
+ cancelRerunCourse: cancelRerunCourse,
+ validateRequiredField: validateRequiredField,
+ setNewCourseFieldInErr: setNewCourseFieldInErr,
+ onReady: onReady
+ };
});
diff --git a/cms/templates/js/mock/mock-create-course-rerun.underscore b/cms/templates/js/mock/mock-create-course-rerun.underscore
new file mode 100644
index 0000000000..43b9ff0b26
--- /dev/null
+++ b/cms/templates/js/mock/mock-create-course-rerun.underscore
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+ Page Actions
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Provide identifying information for this re-run of the course. The original course is not affected in any way by a re-run.
+ Note: Together, the organization, course number, and course run must uniquely identify this new course instance.
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From 319b53bb3c2bb597fb4f94964e5b76615dfda874 Mon Sep 17 00:00:00 2001
From: Ben McMorran
Date: Thu, 14 Aug 2014 17:15:27 -0400
Subject: [PATCH 11/42] Add jasmine test for notification dismissal on course
outline
---
.../spec/views/pages/course_outline_spec.js | 15 +++++++-
cms/static/js/views/pages/course_outline.js | 34 +++++++++----------
2 files changed, 31 insertions(+), 18 deletions(-)
diff --git a/cms/static/js/spec/views/pages/course_outline_spec.js b/cms/static/js/spec/views/pages/course_outline_spec.js
index 352c201d9a..a13537051d 100644
--- a/cms/static/js/spec/views/pages/course_outline_spec.js
+++ b/cms/static/js/spec/views/pages/course_outline_spec.js
@@ -7,7 +7,8 @@ define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers"
getItemsOfType, getItemHeaders, verifyItemsExpanded, expandItemsAndVerifyState, collapseItemsAndVerifyState,
createMockCourseJSON, createMockSectionJSON, createMockSubsectionJSON, verifyTypePublishable,
mockCourseJSON, mockEmptyCourseJSON, mockSingleSectionCourseJSON, createMockVerticalJSON,
- mockOutlinePage = readFixtures('mock/mock-course-outline-page.underscore');
+ mockOutlinePage = readFixtures('mock/mock-course-outline-page.underscore'),
+ mockRerunNotification = readFixtures('mock/mock-course-rerun-notification.underscore');
createMockCourseJSON = function(options, children) {
return $.extend(true, {}, {
@@ -243,6 +244,18 @@ define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers"
});
});
+ describe("Rerun notification", function () {
+ it("can be dismissed", function () {
+ appendSetFixtures(mockRerunNotification);
+ createCourseOutlinePage(this, mockEmptyCourseJSON);
+ expect($('.wrapper-alert-announcement')).not.toHaveClass('is-hidden');
+ $('.dismiss-button').click();
+ create_sinon.expectJsonRequest(requests, 'DELETE', 'dummy_dismiss_url');
+ create_sinon.respondToDelete(requests);
+ expect($('.wrapper-alert-announcement')).toHaveClass('is-hidden');
+ });
+ });
+
describe("Button bar", function() {
it('can add a section', function() {
createCourseOutlinePage(this, mockEmptyCourseJSON);
diff --git a/cms/static/js/views/pages/course_outline.js b/cms/static/js/views/pages/course_outline.js
index 62510a6c43..464c9d5516 100644
--- a/cms/static/js/views/pages/course_outline.js
+++ b/cms/static/js/views/pages/course_outline.js
@@ -1,9 +1,9 @@
/**
* This page is used to show the user an outline of the course.
*/
-define(["domReady", "jquery", "underscore", "gettext", "js/views/pages/base_page", "js/views/utils/xblock_utils",
+define(["jquery", "underscore", "gettext", "js/views/pages/base_page", "js/views/utils/xblock_utils",
"js/views/course_outline"],
- function (domReady, $, _, gettext, BasePage, XBlockViewUtils, CourseOutlineView) {
+ function ($, _, gettext, BasePage, XBlockViewUtils, CourseOutlineView) {
var expandedLocators, CourseOutlinePage;
CourseOutlinePage = BasePage.extend({
@@ -25,6 +25,7 @@ define(["domReady", "jquery", "underscore", "gettext", "js/views/pages/base_page
self.outlineView.handleAddEvent(event);
});
this.model.on('change', this.setCollapseExpandVisibility, this);
+ $('.dismiss-button').bind('click', this.dismissNotification)
},
setCollapseExpandVisibility: function() {
@@ -97,6 +98,20 @@ define(["domReady", "jquery", "underscore", "gettext", "js/views/pages/base_page
}
}, this);
}
+ },
+
+ /**
+ * Dismiss the course rerun notification.
+ */
+ dismissNotification: function (e) {
+ e.preventDefault();
+ $.ajax({
+ url: $('.dismiss-button').data('dismiss-link'),
+ type: 'DELETE',
+ success: function(result) {
+ $('.wrapper-alert-announcement').removeClass('is-shown').addClass('is-hidden')
+ }
+ });
}
});
@@ -149,20 +164,5 @@ define(["domReady", "jquery", "underscore", "gettext", "js/views/pages/base_page
}
};
- var dismissNotification = function (e) {
- e.preventDefault();
- $.ajax({
- url: $('.dismiss-button').data('dismiss-link'),
- type: 'DELETE',
- success: function(result) {
- $('.wrapper-alert-announcement').removeClass('is-shown').addClass('is-hidden')
- }
- });
- };
-
- domReady(function () {
- $('.dismiss-button').bind('click', dismissNotification);
- });
-
return CourseOutlinePage;
}); // end define();
From 6c8b418331a85febc77c33846254056e03fbbf7c Mon Sep 17 00:00:00 2001
From: Ben McMorran
Date: Fri, 15 Aug 2014 11:15:09 -0400
Subject: [PATCH 12/42] Test notification dismissal on course listing page
---
cms/static/coffee/spec/main.coffee | 1 +
cms/static/js/index.js | 14 +-
cms/static/js/spec/views/pages/index_spec.js | 24 +++
cms/static/js/views/course_rerun.js | 5 +-
.../mock-course-rerun-notification.underscore | 24 +++
.../js/mock/mock-index-page.underscore | 168 ++++++++++++++++++
6 files changed, 229 insertions(+), 7 deletions(-)
create mode 100644 cms/static/js/spec/views/pages/index_spec.js
create mode 100644 cms/templates/js/mock/mock-course-rerun-notification.underscore
create mode 100644 cms/templates/js/mock/mock-index-page.underscore
diff --git a/cms/static/coffee/spec/main.coffee b/cms/static/coffee/spec/main.coffee
index d80ab05764..9bd64c5a2a 100644
--- a/cms/static/coffee/spec/main.coffee
+++ b/cms/static/coffee/spec/main.coffee
@@ -234,6 +234,7 @@ define([
"js/spec/views/pages/group_configurations_spec",
"js/spec/views/pages/course_outline_spec",
"js/spec/views/pages/course_rerun_spec",
+ "js/spec/views/pages/index_spec",
"js/spec/views/modals/base_modal_spec",
"js/spec/views/modals/edit_xblock_spec",
diff --git a/cms/static/js/index.js b/cms/static/js/index.js
index bf7feb89b3..de124f224b 100644
--- a/cms/static/js/index.js
+++ b/cms/static/js/index.js
@@ -1,4 +1,4 @@
-require(["domReady", "jquery", "underscore", "js/utils/cancel_on_escape"],
+define(["domReady", "jquery", "underscore", "js/utils/cancel_on_escape"],
function (domReady, $, _, CancelOnEscape) {
var dismissNotification = function (e) {
@@ -172,9 +172,15 @@ require(["domReady", "jquery", "underscore", "js/utils/cancel_on_escape"],
}
};
-
- domReady(function () {
+ var onReady = function () {
$('.new-course-button').bind('click', addNewCourse);
$('.dismiss-button').bind('click', dismissNotification);
- });
+ };
+
+ domReady(onReady);
+
+ return {
+ dismissNotification: dismissNotification,
+ onReady: onReady
+ };
});
diff --git a/cms/static/js/spec/views/pages/index_spec.js b/cms/static/js/spec/views/pages/index_spec.js
new file mode 100644
index 0000000000..bffe8b5e3b
--- /dev/null
+++ b/cms/static/js/spec/views/pages/index_spec.js
@@ -0,0 +1,24 @@
+define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers", "js/index"],
+ function ($, create_sinon, view_helpers, IndexPage) {
+ describe("Course listing page", function () {
+ var mockIndexPageHTML = readFixtures('mock/mock-index-page.underscore');
+
+ beforeEach(function () {
+ view_helpers.installMockAnalytics();
+ appendSetFixtures(mockIndexPageHTML);
+ IndexPage.onReady();
+ });
+
+ afterEach(function () {
+ view_helpers.removeMockAnalytics();
+ delete window.source_course_key;
+ });
+
+
+ it("can dismiss notifications", function () {
+ var requests = create_sinon.requests(this);
+ $('.dismiss-button').click();
+ create_sinon.expectJsonRequest(requests, 'DELETE', 'dummy_dismiss_url');
+ });
+ });
+ });
\ No newline at end of file
diff --git a/cms/static/js/views/course_rerun.js b/cms/static/js/views/course_rerun.js
index 57bba6351c..529e9029a9 100644
--- a/cms/static/js/views/course_rerun.js
+++ b/cms/static/js/views/course_rerun.js
@@ -1,5 +1,5 @@
-define(["domReady", "jquery", "underscore", "js/utils/cancel_on_escape"],
- function (domReady, $, _, CancelOnEscape) {
+define(["domReady", "jquery", "underscore"],
+ function (domReady, $, _) {
var saveRerunCourse = function (e) {
e.preventDefault();
@@ -93,7 +93,6 @@ define(["domReady", "jquery", "underscore", "js/utils/cancel_on_escape"],
$courseRun.focus().select();
$('.rerun-course-save').on('click', saveRerunCourse);
$cancelButton.bind('click', cancelRerunCourse);
- CancelOnEscape($cancelButton);
$('.cancel-button').bind('click', cancelRerunCourse);
// Check that a course (org, number, run) doesn't use any special characters
diff --git a/cms/templates/js/mock/mock-course-rerun-notification.underscore b/cms/templates/js/mock/mock-course-rerun-notification.underscore
new file mode 100644
index 0000000000..68a0ddea8b
--- /dev/null
+++ b/cms/templates/js/mock/mock-course-rerun-notification.underscore
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
This course was created as a re-run. Some manual configuration is needed.
+
+
Be sure to review and reset all dates (the Course Start Date was set to January 1, 2030); set up the
+ course team; review course updates and other assets for dated material; and seed the discussions and
+ wiki.
+
+
+
+
+
+
\ No newline at end of file
diff --git a/cms/templates/js/mock/mock-index-page.underscore b/cms/templates/js/mock/mock-index-page.underscore
new file mode 100644
index 0000000000..f63f12e571
--- /dev/null
+++ b/cms/templates/js/mock/mock-index-page.underscore
@@ -0,0 +1,168 @@
+
+
+
+
+
+
+
+
Welcome, user!
+
+
Here are all of the courses you currently have access to in Studio:
+
+
+
+
+
+
+
+
Courses Being Processed
+
+
+
+
+
+
+
Demo Course
+
+
+
+ Organization: edX
+
+
+ Course Number:
+ DM101
+
+
+ Course Run: 2014
+
+
+
+
+
+ This re-run processing status:
+
+
+ Configuring as re-run
+
+
+
+
+
+
The new course will be added to your course list in 5-10 minutes. Return to this page or refresh it to update the course list. The new course will need some manual configuration.
+
+
+
+
+
+
+
+
+
+
Demo Course 2
+
+
+
+ Organization: edX
+
+
+ Course Number:
+ DM102
+
+
+ Course Run: 2014
+
+
+
+
+
+ This re-run processing status:
+
+
+ Configuration Error
+
+
+
+
+
+
A system error occurred while your course was being processed. Please go to the original course to try the re-run again, or contact your PM for assistance.
+
+
+
+
+
+
+
+
+
From e3fa5f08799a99ec308eb790c759cadc78334fb7 Mon Sep 17 00:00:00 2001
From: Brian Talbot
Date: Fri, 15 Aug 2014 10:23:14 -0400
Subject: [PATCH 13/42] Studio: removing static rendering notes/comments from
course rerun template
---
cms/templates/course-create-rerun.html | 31 +++++---------------------
1 file changed, 6 insertions(+), 25 deletions(-)
diff --git a/cms/templates/course-create-rerun.html b/cms/templates/course-create-rerun.html
index 2994fcf4e9..fabb36d251 100644
--- a/cms/templates/course-create-rerun.html
+++ b/cms/templates/course-create-rerun.html
@@ -1,20 +1,3 @@
-
-
<%inherit file="base.html" />
<%! from django.utils.translation import ugettext as _ %>
@@ -58,7 +41,7 @@ require(["domReady!", "jquery", "jquery.form", "js/views/course_rerun"], functio
${display_name}
-
+
@@ -71,9 +54,7 @@ require(["domReady!", "jquery", "jquery.form", "js/views/course_rerun"], functio
${_("Note: Together, the organization, course number, and course run must uniquely identify this new course instance.")}
-
-
-
+