Commit a0deac03 by Peter Fogg Committed by cahrens

Make all of section/subsection/unit draggable.

parent fd2f720a
...@@ -3,23 +3,23 @@ $(document).ready(function() { ...@@ -3,23 +3,23 @@ $(document).ready(function() {
// Section // Section
makeDraggable( makeDraggable(
'.courseware-section', '.courseware-section',
'a.section-drag-handle', '.section-drag-handle',
'.courseware-overview', '.courseware-overview',
'article.courseware-overview' 'article.courseware-overview'
); );
// Subsection // Subsection
makeDraggable( makeDraggable(
'.id-holder', '.id-holder',
'a.subsection-drag-handle', '.subsection-drag-handle',
'.subsection-list > ol', '.subsection-list > ol',
'.courseware-section' '.courseware-section'
); );
// Unit // Unit
makeDraggable( makeDraggable(
'.unit', '.unit',
'a.unit-drag-handle', '.unit-drag-handle',
'.sortable-unit-list', 'ol.sortable-unit-list',
'li.branch' 'li.branch, article.subsection-body'
); );
/* /*
......
...@@ -141,7 +141,7 @@ require(["domReady!", "jquery", "js/models/location", "js/models/section", "js/v ...@@ -141,7 +141,7 @@ require(["domReady!", "jquery", "js/models/location", "js/models/section", "js/v
<article class="courseware-overview" data-id="${context_course.location.url()}"> <article class="courseware-overview" data-id="${context_course.location.url()}">
% for section in sections: % for section in sections:
<section class="courseware-section branch" data-id="${section.location}" data-parent-id="${context_course.location.url()}"> <section class="courseware-section branch" data-id="${section.location}" data-parent-id="${context_course.location.url()}">
<header> <header class="section-drag-handle">
<a href="#" data-tooltip="${_('Expand/collapse this section')}" class="expand-collapse-icon collapse"></a> <a href="#" data-tooltip="${_('Expand/collapse this section')}" class="expand-collapse-icon collapse"></a>
<div class="item-details" data-id="${section.location}"> <div class="item-details" data-id="${section.location}">
...@@ -169,7 +169,6 @@ require(["domReady!", "jquery", "js/models/location", "js/models/section", "js/v ...@@ -169,7 +169,6 @@ require(["domReady!", "jquery", "js/models/location", "js/models/section", "js/v
<div class="item-actions"> <div class="item-actions">
<a href="#" data-tooltip="${_('Delete this section')}" class="delete-button delete-section-button"><span class="delete-icon"></span></a> <a href="#" data-tooltip="${_('Delete this section')}" class="delete-button delete-section-button"><span class="delete-icon"></span></a>
<a href="#" data-tooltip="${_('Drag to reorder')}" class="drag-handle section-drag-handle"></a>
</div> </div>
</header> </header>
<div class="subsection-list"> <div class="subsection-list">
...@@ -181,7 +180,7 @@ require(["domReady!", "jquery", "js/models/location", "js/models/section", "js/v ...@@ -181,7 +180,7 @@ require(["domReady!", "jquery", "js/models/location", "js/models/section", "js/v
<ol data-id="${section.location.url()}"> <ol data-id="${section.location.url()}">
% for subsection in section.get_children(): % for subsection in section.get_children():
<li class="branch collapsed id-holder draggable" data-id="${subsection.location}" data-parent-id="${section.location.url()}"> <li class="branch collapsed id-holder draggable" data-id="${subsection.location}" data-parent-id="${section.location.url()}">
<div class="section-item"> <div class="section-item subsection-drag-handle">
<div class="details"> <div class="details">
<a href="#" data-tooltip="${_('Expand/collapse this subsection')}" class="expand-collapse-icon expand"></a> <a href="#" data-tooltip="${_('Expand/collapse this subsection')}" class="expand-collapse-icon expand"></a>
<a href="${reverse('edit_subsection', args=[subsection.location])}"> <a href="${reverse('edit_subsection', args=[subsection.location])}">
...@@ -195,7 +194,6 @@ require(["domReady!", "jquery", "js/models/location", "js/models/section", "js/v ...@@ -195,7 +194,6 @@ require(["domReady!", "jquery", "js/models/location", "js/models/section", "js/v
<div class="item-actions"> <div class="item-actions">
<a href="#" data-tooltip="${_('Delete this subsection')}" class="delete-button delete-subsection-button"><span class="delete-icon"></span></a> <a href="#" data-tooltip="${_('Delete this subsection')}" class="delete-button delete-subsection-button"><span class="delete-icon"></span></a>
<a href="#" data-tooltip="${_('Drag to reorder')}" class="drag-handle subsection-drag-handle"></a>
</div> </div>
</div> </div>
${units.enum_units(subsection)} ${units.enum_units(subsection)}
......
...@@ -19,7 +19,7 @@ This def will enumerate through a passed in subsection and list all of the units ...@@ -19,7 +19,7 @@ This def will enumerate through a passed in subsection and list all of the units
else: else:
selected_class = '' selected_class = ''
%> %>
<div class="section-item ${selected_class}"> <div class="section-item unit-drag-handle ${selected_class}">
<a href="${reverse('edit_unit', args=[unit.location])}" class="${unit_state}-item"> <a href="${reverse('edit_unit', args=[unit.location])}" class="${unit_state}-item">
<span class="${unit.scope_ids.block_type}-icon"></span> <span class="${unit.scope_ids.block_type}-icon"></span>
<span class="unit-name">${unit.display_name_with_default}</span> <span class="unit-name">${unit.display_name_with_default}</span>
...@@ -27,7 +27,6 @@ This def will enumerate through a passed in subsection and list all of the units ...@@ -27,7 +27,6 @@ This def will enumerate through a passed in subsection and list all of the units
% if actions: % if actions:
<div class="item-actions"> <div class="item-actions">
<a href="#" data-tooltip="Delete this unit" class="delete-button" data-id="${unit.location}"><span class="delete-icon"></span></a> <a href="#" data-tooltip="Delete this unit" class="delete-button" data-id="${unit.location}"><span class="delete-icon"></span></a>
<a href="#" data-tooltip="Drag to sort" class="drag-handle unit-drag-handle"></a>
</div> </div>
% endif % endif
</div> </div>
......
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