-
+

You haven't added any content to this course yet. diff --git a/cms/templates/js/publish-xblock.underscore b/cms/templates/js/publish-xblock.underscore index f9b30bcb38c1..18842491d7e2 100644 --- a/cms/templates/js/publish-xblock.underscore +++ b/cms/templates/js/publish-xblock.underscore @@ -2,17 +2,20 @@ var publishClasses = ""; var title = gettext("Draft (Never published)"); if (published) { - if (published && hasChanges) { - publishClasses = publishClasses + " is-draft"; + publishClasses = publishClasses + " is-published"; + if (hasChanges) { + publishClasses = publishClasses + " has-changes"; title = gettext("Draft (Unpublished changes)"); } else { - publishClasses = publishClasses + " is-published"; title = gettext("Published"); } } if (releaseDate) { publishClasses = publishClasses + " is-scheduled"; } +if (releasedToStudents) { + publishClasses = publishClasses + " is-released"; +} if (visibleToStaffOnly) { publishClasses = publishClasses + " is-staff-only"; title = gettext("Unpublished (Staff only)"); diff --git a/cms/templates/js/unit-outline.underscore b/cms/templates/js/unit-outline.underscore index 70d3cf4123f7..27fe5a01604e 100644 --- a/cms/templates/js/unit-outline.underscore +++ b/cms/templates/js/unit-outline.underscore @@ -1,3 +1,32 @@ +<% +var publishClasses = ""; +var title = gettext("Draft (Never published)"); +var published = xblockInfo.get('published'); +var hasChanges = xblockInfo.get('has_changes'); +var visibleToStaffOnly = false; +if (xblockInfo.get('published_on')) { + if (xblockInfo.get('has_changes')) { + publishClasses = publishClasses + " has-changes"; + } + publishClasses = publishClasses + " is-published"; +} +if (xblockInfo.get('released_to_students')) { + publishClasses = publishClasses + " is-released"; +} +if (visibleToStaffOnly) { + publishClasses = publishClasses + " is-staff-only"; +} + + +var listType = 'list-for-' + xblockType; +if (xblockType === 'course') { + listType = 'list-subsections'; +} else if (xblockType === 'section') { + listType = 'list-subsections'; +} else if (xblockType === 'subsection') { + listType = 'list-units'; +} +%> <% if (parentInfo) { %>

  • @@ -10,8 +39,10 @@
  • <% } %> -
      -
    +
    +
      +
    +
    <% if (childType) { %>
    From 773f926c6eba9b746686af4e8cd3d3c2e4cda864 Mon Sep 17 00:00:00 2001 From: Andy Armstrong Date: Wed, 23 Jul 2014 10:42:24 -0400 Subject: [PATCH 3/5] More unit test fixes --- .../spec/views/pages/course_outline_spec.js | 96 ++++++++++--------- cms/static/js/views/xblock_outline.js | 17 +++- cms/templates/js/course-outline.underscore | 2 +- cms/templates/js/xblock-outline.underscore | 2 +- 4 files changed, 67 insertions(+), 50 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 b1add9ce5e18..fcb5997ab1d6 100644 --- a/cms/static/js/spec/views/pages/course_outline_spec.js +++ b/cms/static/js/spec/views/pages/course_outline_spec.js @@ -4,7 +4,7 @@ define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers" describe("CourseOutlinePage", function() { var createCourseOutlinePage, displayNameInput, model, outlinePage, requests, - getHeaderElement, expandAndVerifyState, collapseAndVerifyState, + getItemsOfType, getItemHeaders, verifyItemsExpanded, expandItemsAndVerifyState, collapseItemsAndVerifyState, createMockCourseJSON, createMockSectionJSON, createMockSubsectionJSON, mockCourseJSON, mockEmptyCourseJSON, mockSingleSectionCourseJSON, mockOutlinePage = readFixtures('mock/mock-course-outline-page.underscore'); @@ -64,21 +64,28 @@ define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers" }; }; - getHeaderElement = function(selector) { - var element = outlinePage.$(selector); - return element.find('> .wrapper-xblock-header'); + getItemsOfType = function(type) { + return outlinePage.$('.outline-' + type); }; - expandAndVerifyState = function(selector) { - var element = outlinePage.$(selector); - getHeaderElement(selector).find('.ui-toggle-expansion').click(); - expect(element).not.toHaveClass('collapsed'); + getItemHeaders = function(type) { + return getItemsOfType(type).find('> .' + type + '-header'); }; - collapseAndVerifyState = function(selector) { - var element = outlinePage.$(selector); - getHeaderElement(selector).find('.ui-toggle-expansion').click(); - expect(element).toHaveClass('collapsed'); + verifyItemsExpanded = function(type, isExpanded) { + var element = getItemsOfType(type); + expect(element).toHaveClass(isExpanded ? 'is-expanded' : 'is-collapsed'); + expect(element).not.toHaveClass(isExpanded ? 'is-collapsed' : 'is-expanded'); + }; + + expandItemsAndVerifyState = function(type) { + getItemHeaders(type).find('.ui-toggle-expansion').click(); + verifyItemsExpanded(type, true); + }; + + collapseItemsAndVerifyState = function(type) { + getItemHeaders(type).find('.ui-toggle-expansion').click(); + verifyItemsExpanded(type, false); }; createCourseOutlinePage = function(test, courseJSON, createOnly) { @@ -142,11 +149,9 @@ define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers" }); it('shows subsections initially collapsed', function() { - var subsectionElement; createCourseOutlinePage(this, mockCourseJSON); - subsectionElement = outlinePage.$('.outline-subsection'); - expect(subsectionElement).toHaveClass('collapsed'); - expect(outlinePage.$('.outline-unit')).not.toExist(); + verifyItemsExpanded('subsection', false); + expect(getItemsOfType('unit')).not.toExist(); }); }); @@ -186,7 +191,7 @@ define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers" create_sinon.expectJsonRequest(requests, 'GET', '/xblock/outline/mock-section-2'); create_sinon.respondWithJson(requests, createMockSectionJSON('mock-section-2', 'Mock Section 2', [])); - sectionElements = outlinePage.$('.list-sections .outline-section'); + sectionElements = getItemsOfType('section'); expect(sectionElements.length).toBe(2); expect($(sectionElements[0]).data('locator')).toEqual('mock-section'); expect($(sectionElements[1]).data('locator')).toEqual('mock-section-2'); @@ -194,10 +199,11 @@ define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers" it('can expand and collapse all sections', function() { createCourseOutlinePage(this, mockCourseJSON, false); - outlinePage.$('.nav-actions .toggle-button-expand-collapse').click(); - expect(outlinePage.$('.outline-section')).toHaveClass('collapsed'); - outlinePage.$('.nav-actions .toggle-button-expand-collapse').click(); - expect(outlinePage.$('.outline-section')).not.toHaveClass('collapsed'); + verifyItemsExpanded('section', true); + outlinePage.$('.nav-actions .button-toggle-expand-collapse .collapse-all').click(); + verifyItemsExpanded('section', false); + outlinePage.$('.nav-actions .button-toggle-expand-collapse .expand-all').click(); + verifyItemsExpanded('section', true); }); }); @@ -247,7 +253,7 @@ define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers" var getDisplayNameWrapper; getDisplayNameWrapper = function() { - return getHeaderElement('.outline-section').find('.wrapper-xblock-field').first(); + return getItemHeaders('section').find('.wrapper-xblock-field'); }; it('can be deleted', function() { @@ -256,7 +262,7 @@ define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers" createMockSectionJSON('mock-section', 'Mock Section', []), createMockSectionJSON('mock-section-2', 'Mock Section 2', []) ])); - outlinePage.$('.outline-section .delete-button').first().click(); + getItemHeaders('section').find('.delete-button').click(); view_helpers.confirmPrompt(promptSpy); requestCount = requests.length; create_sinon.expectJsonRequest(requests, 'DELETE', '/xblock/mock-section'); @@ -269,7 +275,7 @@ define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers" it('can be deleted if it is the only section', function() { var promptSpy = view_helpers.createPromptSpy(); createCourseOutlinePage(this, mockSingleSectionCourseJSON); - outlinePage.$('.outline-section .delete-button').click(); + getItemHeaders('section').find('.delete-button').click(); view_helpers.confirmPrompt(promptSpy); create_sinon.expectJsonRequest(requests, 'DELETE', '/xblock/mock-section'); create_sinon.respondWithJson(requests, {}); @@ -283,7 +289,7 @@ define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers" var promptSpy = view_helpers.createPromptSpy(), requestCount; createCourseOutlinePage(this, mockSingleSectionCourseJSON); - outlinePage.$('.outline-section .delete-button').click(); + getItemHeaders('section').find('.delete-button').click(); view_helpers.confirmPrompt(promptSpy); create_sinon.expectJsonRequest(requests, 'DELETE', '/xblock/mock-section'); requestCount = requests.length; @@ -294,7 +300,7 @@ define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers" it('can add a subsection', function() { createCourseOutlinePage(this, mockCourseJSON); - outlinePage.$('.outline-section > .add-xblock-component .button-new').click(); + getItemsOfType('section').find('> .outline-content > .add-subsection .button-new').click(); create_sinon.expectJsonRequest(requests, 'POST', '/xblock/', { 'category': 'sequential', 'display_name': 'Subsection', @@ -329,9 +335,9 @@ define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers" it('can be expanded and collapsed', function() { createCourseOutlinePage(this, mockCourseJSON); - collapseAndVerifyState('.outline-section'); - expandAndVerifyState('.outline-section'); - collapseAndVerifyState('.outline-section'); + collapseItemsAndVerifyState('section'); + expandItemsAndVerifyState('section'); + collapseItemsAndVerifyState('section'); }); }); @@ -339,13 +345,13 @@ define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers" var getDisplayNameWrapper; getDisplayNameWrapper = function() { - return getHeaderElement('.outline-subsection').find('.wrapper-xblock-field').first(); + return getItemHeaders('subsection').find('.wrapper-xblock-field'); }; it('can be deleted', function() { var promptSpy = view_helpers.createPromptSpy(); createCourseOutlinePage(this, mockCourseJSON); - getHeaderElement('.outline-subsection').find('.delete-button').click(); + getItemHeaders('subsection').find('.delete-button').click(); view_helpers.confirmPrompt(promptSpy); create_sinon.expectJsonRequest(requests, 'DELETE', '/xblock/mock-subsection'); create_sinon.respondWithJson(requests, {}); @@ -358,7 +364,7 @@ define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers" var redirectSpy; createCourseOutlinePage(this, mockCourseJSON); redirectSpy = spyOn(ViewUtils, 'redirect'); - outlinePage.$('.outline-subsection > .add-xblock-component .button-new').click(); + getItemsOfType('subsection').find('> .outline-content > .add-subsection .button-new').click(); create_sinon.expectJsonRequest(requests, 'POST', '/xblock/', { 'category': 'vertical', 'display_name': 'Unit', @@ -387,20 +393,18 @@ define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers" createMockSubsectionJSON('mock-subsection', updatedDisplayName, []) ])); // Find the display name again in the refreshed DOM and verify it - displayNameWrapper = getHeaderElement('.outline-subsection').find('.wrapper-xblock-field').first(); + displayNameWrapper = getItemHeaders('subsection').find('.wrapper-xblock-field'); view_helpers.verifyInlineEditChange(displayNameWrapper, updatedDisplayName); subsectionModel = outlinePage.model.get('child_info').children[0].get('child_info').children[0]; expect(subsectionModel.get('display_name')).toBe(updatedDisplayName); }); it('can be expanded and collapsed', function() { - var subsectionElement; createCourseOutlinePage(this, mockCourseJSON); - subsectionElement = outlinePage.$('.outline-subsection'); - expect(subsectionElement).toHaveClass('collapsed'); - expandAndVerifyState('.outline-subsection'); - collapseAndVerifyState('.outline-subsection'); - expandAndVerifyState('.outline-subsection'); + verifyItemsExpanded('subsection', false); + expandItemsAndVerifyState('subsection'); + collapseItemsAndVerifyState('subsection'); + expandItemsAndVerifyState('subsection'); }); }); @@ -409,8 +413,8 @@ define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers" it('can be deleted', function() { var promptSpy = view_helpers.createPromptSpy(); createCourseOutlinePage(this, mockCourseJSON); - expandAndVerifyState('.outline-subsection'); - getHeaderElement('.outline-unit').find('.delete-button').click(); + expandItemsAndVerifyState('subsection'); + getItemHeaders('unit').find('.delete-button').click(); view_helpers.confirmPrompt(promptSpy); create_sinon.expectJsonRequest(requests, 'DELETE', '/xblock/mock-unit'); create_sinon.respondWithJson(requests, {}); @@ -420,16 +424,16 @@ define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers" }); it('has a link to the unit page', function() { - var anchor; + var unitAnchor; createCourseOutlinePage(this, mockCourseJSON); - expandAndVerifyState('.outline-subsection'); - anchor = outlinePage.$('.outline-unit .xblock-title a'); - expect(anchor.attr('href')).toBe('/container/mock-unit'); + expandItemsAndVerifyState('subsection'); + unitAnchor = getItemsOfType('unit').find('.xblock-title a'); + expect(unitAnchor.attr('href')).toBe('/container/mock-unit'); }); }); describe("Publishing State", function() { - + // TODO: implement this!!!! }); }); }); diff --git a/cms/static/js/views/xblock_outline.js b/cms/static/js/views/xblock_outline.js index 6eee7f36c156..2b9218b60573 100644 --- a/cms/static/js/views/xblock_outline.js +++ b/cms/static/js/views/xblock_outline.js @@ -22,7 +22,7 @@ define(["jquery", "underscore", "gettext", "js/views/baseview", "js/views/utils/ // takes XBlockInfo as a model options: { - collapsedClass: 'is-collapsed' + collapsedClass: 'is-collapsed is-expanded' }, templateName: 'xblock-outline', @@ -252,7 +252,20 @@ define(["jquery", "underscore", "gettext", "js/views/baseview", "js/views/utils/ XBlockViewUtils.addXBlock(target).done(function(locator) { self.onChildAdded(locator, category, event); }); - } + }, + + /** + * Override the default implementation to use the new is-collapsed/is-expanded classes. + * @param event + */ + toggleExpandCollapse: function(event) { + var target = $(event.target); + // Don't propagate the event as it is possible that two views will both contain + // this element, e.g. clicking on the element of a child view container in a parent. + event.stopPropagation(); + event.preventDefault(); + ViewUtils.toggleExpandCollapse(target, this.options.collapsedClass); + }, }); return XBlockOutlineView; diff --git a/cms/templates/js/course-outline.underscore b/cms/templates/js/course-outline.underscore index 7b17144472d9..ee7717366b5c 100644 --- a/cms/templates/js/course-outline.underscore +++ b/cms/templates/js/course-outline.underscore @@ -59,7 +59,7 @@ if (statusType === 'warning') { } %> <% if (parentInfo) { %> -
  • diff --git a/cms/templates/js/xblock-outline.underscore b/cms/templates/js/xblock-outline.underscore index 2dec21afd66b..6772f3cf32f1 100644 --- a/cms/templates/js/xblock-outline.underscore +++ b/cms/templates/js/xblock-outline.underscore @@ -1,5 +1,5 @@ <% if (parentInfo) { %> -
  • From 81ef8f497b91e2f77777c484c123f98f87b261f7 Mon Sep 17 00:00:00 2001 From: cahrens Date: Tue, 22 Jul 2014 14:16:45 -0400 Subject: [PATCH 4/5] Drag and drop support on the course outline page. --- .../contentstore/features/course-outline.py | 11 ----- cms/static/js/utils/drag_and_drop.js | 45 ++++++++++++------- cms/static/js/views/course_outline.js | 41 ++++++++++++++++- cms/static/js/views/overview.js | 25 +---------- cms/templates/js/course-outline.underscore | 5 +++ cms/templates/js/xblock-outline.underscore | 5 --- 6 files changed, 74 insertions(+), 58 deletions(-) diff --git a/cms/djangoapps/contentstore/features/course-outline.py b/cms/djangoapps/contentstore/features/course-outline.py index f3203880aacb..37bf8eb16e1e 100644 --- a/cms/djangoapps/contentstore/features/course-outline.py +++ b/cms/djangoapps/contentstore/features/course-outline.py @@ -131,14 +131,3 @@ def all_sections_are_collapsed_or_expanded(step, text): def change_grading_status(step): world.css_find('a.menu-toggle').click() world.css_find('.menu li').first.click() - - -@step(u'I reorder subsections') -def reorder_subsections(_step): - draggable_css = '.subsection-drag-handle' - ele = world.css_find(draggable_css).first - ele.action_chains.drag_and_drop_by_offset( - ele._element, - 0, - 25 - ).perform() diff --git a/cms/static/js/utils/drag_and_drop.js b/cms/static/js/utils/drag_and_drop.js index 2479ec47ba7a..3d9282ccb764 100644 --- a/cms/static/js/utils/drag_and_drop.js +++ b/cms/static/js/utils/drag_and_drop.js @@ -6,6 +6,8 @@ define(["jquery", "jquery.ui", "underscore", "gettext", "js/views/feedback_notif droppableClasses: 'drop-target drop-target-prepend drop-target-before drop-target-after', validDropClass: "valid-drop", expandOnDropClass: "expand-on-drop", + collapsedClass: "is-collapsed", + expandedClass: "is-expanded", /* * Determine information about where to drop the currently dragged @@ -28,7 +30,7 @@ define(["jquery", "jquery.ui", "underscore", "gettext", "js/views/feedback_notif // element is on top of its parent list -- don't check the // position of the container var parentList = container.parents(ele.data('parent-location-selector')).first(); - if (parentList.hasClass('collapsed')) { + if (parentList.hasClass(this.collapsedClass)) { var parentListTop = parentList.offset().top; // To make it easier to drop subsections into collapsed sections (which have // a lot of visual padding around them), allow a fudge factor around the @@ -158,8 +160,9 @@ define(["jquery", "jquery.ui", "underscore", "gettext", "js/views/feedback_notif // The direction the drag is moving in (negative means up, positive down). dragDirection: 0 }; - if (!ele.hasClass('collapsed')) { - ele.addClass('collapsed'); + if (ele.hasClass(this.expandedClass)) { + ele.removeClass(this.expandedClass); + ele.addClass(this.collapsedClass); ele.find('.expand-collapse').first().addClass('expand').removeClass('collapse'); // onDragStart gets called again after the collapse, so we can't just store a variable in the dragState. ele.addClass(this.expandOnDropClass); @@ -251,11 +254,15 @@ define(["jquery", "jquery.ui", "underscore", "gettext", "js/views/feedback_notif }, pointerInBounds: function (pointer, ele) { - return pointer.clientX >= ele.offset().left && pointer.clientX < ele.offset().left + ele.width(); +// console.log("pointer.clientX " + pointer.clientX); +// console.log("ele.offset().left " + ele.offset().left); +// console.log("ele.outerWidth() " + ele.outerWidth()); + return pointer.clientX >= ele.offset().left && pointer.clientX < ele.offset().left + ele.outerWidth(); }, expandElement: function (ele) { - ele.removeClass('collapsed'); + ele.removeClass(this.collapsedClass); + ele.addClass(this.expandedClass); ele.find('.expand-collapse').first().removeClass('expand').addClass('collapse'); }, @@ -322,21 +329,25 @@ define(["jquery", "jquery.ui", "underscore", "gettext", "js/views/feedback_notif * into `droppableClass`, and with parent type * `parentLocationSelector`. */ - makeDraggable: function (type, handleClass, droppableClass, parentLocationSelector) { + makeDraggable: function (type, handleClass, droppableClass, parentLocationSelector, el) { + console.log("makeDraggable on " + type); _.each( - $(type), + el ? el : $(type), function (ele) { // Remember data necessary to reconstruct the parent-child relationships - $(ele).data('droppable-class', droppableClass); - $(ele).data('parent-location-selector', parentLocationSelector); - $(ele).data('child-selector', type); - var draggable = new Draggabilly(ele, { - handle: handleClass, - containment: '.wrapper-dnd' - }); - draggable.on('dragStart', _.bind(contentDragger.onDragStart, contentDragger)); - draggable.on('dragMove', _.bind(contentDragger.onDragMove, contentDragger)); - draggable.on('dragEnd', _.bind(contentDragger.onDragEnd, contentDragger)); + if ($(ele).data('droppable-class') !== droppableClass) { + console.log('populating dragable info for type ' + type); + $(ele).data('droppable-class', droppableClass); + $(ele).data('parent-location-selector', parentLocationSelector); + $(ele).data('child-selector', type); + var draggable = new Draggabilly(ele, { + handle: handleClass, + containment: '.wrapper-dnd' + }); + draggable.on('dragStart', _.bind(contentDragger.onDragStart, contentDragger)); + draggable.on('dragMove', _.bind(contentDragger.onDragMove, contentDragger)); + draggable.on('dragEnd', _.bind(contentDragger.onDragEnd, contentDragger)); + } } ); } diff --git a/cms/static/js/views/course_outline.js b/cms/static/js/views/course_outline.js index caa0d845bc1b..59a4fc319adf 100644 --- a/cms/static/js/views/course_outline.js +++ b/cms/static/js/views/course_outline.js @@ -9,14 +9,20 @@ * - adding units will automatically redirect to the unit page rather than showing them inline */ define(["jquery", "underscore", "js/views/xblock_outline", "js/views/utils/view_utils", - "js/models/xblock_outline_info"], - function($, _, XBlockOutlineView, ViewUtils, XBlockOutlineInfo) { + "js/models/xblock_outline_info", "js/utils/drag_and_drop" ], + function($, _, XBlockOutlineView, ViewUtils, XBlockOutlineInfo, ContentDragger) { var CourseOutlineView = XBlockOutlineView.extend({ // takes XBlockOutlineInfo as a model templateName: 'course-outline', + render: function() { + var renderResult = XBlockOutlineView.prototype.render.call(this); + this.makeContentDraggable(this.$el); + return renderResult; + }, + shouldExpandChildren: function() { // Expand the children if this xblock's locator is in the initially expanded state if (this.initialState && _.contains(this.initialState.expanded_locators, this.model.id)) { @@ -75,6 +81,7 @@ define(["jquery", "underscore", "js/views/xblock_outline", "js/views/utils/view_ viewState = viewState || {}; viewState.expanded_locators = expandedLocators.concat(viewState.expanded_locators || []); view.initialState = viewState; + this.makeContentDraggable(view.$el); return view.model.fetch({}); }, @@ -137,6 +144,36 @@ define(["jquery", "underscore", "js/views/xblock_outline", "js/views/utils/view_ expanded_locators: [ locator ], scroll_offset: scrollOffset || 0 }; + }, + + makeContentDraggable: function(el) { + if (el.hasClass("outline-section")) { + ContentDragger.makeDraggable( + '.outline-section', + '.section-drag-handle', + 'ol.list-sections', + 'article.outline', + el + ); + } + else if (el.hasClass("outline-subsection")) { + ContentDragger.makeDraggable( + '.outline-subsection', + '.subsection-drag-handle', + 'ol.list-subsections', + 'li.outline-section', + el + ); + } + else if (el.hasClass("outline-unit")) { + ContentDragger.makeDraggable( + '.outline-unit', + '.unit-drag-handle', + 'ol.list-units', + 'li.outline-subsection', + el + ); + } } }); diff --git a/cms/static/js/views/overview.js b/cms/static/js/views/overview.js index 115445b420d4..b94cf2286738 100644 --- a/cms/static/js/views/overview.js +++ b/cms/static/js/views/overview.js @@ -1,6 +1,6 @@ -define(["domReady", "jquery", "jquery.ui", "underscore", "gettext", "js/views/feedback_notification", "js/utils/drag_and_drop", +define(["domReady", "jquery", "jquery.ui", "underscore", "gettext", "js/views/feedback_notification", "js/utils/cancel_on_escape", "js/utils/get_date", "js/utils/module"], - function (domReady, $, ui, _, gettext, NotificationView, ContentDragger, CancelOnEscape, + function (domReady, $, ui, _, gettext, NotificationView, CancelOnEscape, DateUtils, ModuleUtils) { var modalSelector = '.edit-section-publish-settings'; @@ -230,27 +230,6 @@ define(["domReady", "jquery", "jquery.ui", "underscore", "gettext", "js/views/fe $('.new-courseware-section-button').bind('click', addNewSection); $('.new-subsection-item').bind('click', addNewSubsection); - // Section - ContentDragger.makeDraggable( - '.courseware-section', - '.section-drag-handle', - '.courseware-overview', - 'article.courseware-overview' - ); - // Subsection - ContentDragger.makeDraggable( - '.id-holder', - '.subsection-drag-handle', - '.subsection-list > ol', - '.courseware-section' - ); - // Unit - ContentDragger.makeDraggable( - '.unit', - '.unit-drag-handle', - 'ol.sortable-unit-list', - 'li.courseware-subsection, article.subsection-body' - ); }); return { diff --git a/cms/templates/js/course-outline.underscore b/cms/templates/js/course-outline.underscore index ee7717366b5c..be16266e0c02 100644 --- a/cms/templates/js/course-outline.underscore +++ b/cms/templates/js/course-outline.underscore @@ -89,6 +89,11 @@ if (statusType === 'warning') { <%= gettext('Delete') %>
  • +
  • + + <%= gettext('Drag to reorder') %> + +