Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
a0deac03
Commit
a0deac03
authored
Aug 06, 2013
by
Peter Fogg
Committed by
cahrens
Oct 07, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make all of section/subsection/unit draggable.
parent
fd2f720a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
11 deletions
+8
-11
cms/static/js/views/overview.js
+5
-5
cms/templates/overview.html
+2
-4
cms/templates/widgets/units.html
+1
-2
No files found.
cms/static/js/views/overview.js
View file @
a0deac03
...
...
@@ -3,23 +3,23 @@ $(document).ready(function() {
// Section
makeDraggable
(
'.courseware-section'
,
'
a
.section-drag-handle'
,
'.section-drag-handle'
,
'.courseware-overview'
,
'article.courseware-overview'
);
// Subsection
makeDraggable
(
'.id-holder'
,
'
a
.subsection-drag-handle'
,
'.subsection-drag-handle'
,
'.subsection-list > ol'
,
'.courseware-section'
);
// Unit
makeDraggable
(
'.unit'
,
'
a
.unit-drag-handle'
,
'.sortable-unit-list'
,
'li.branch'
'.unit-drag-handle'
,
'
ol
.sortable-unit-list'
,
'li.branch
, article.subsection-body
'
);
/*
...
...
cms/templates/overview.html
View file @
a0deac03
...
...
@@ -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()}"
>
% for section in sections:
<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>
<div
class=
"item-details"
data-id=
"${section.location}"
>
...
...
@@ -169,7 +169,6 @@ require(["domReady!", "jquery", "js/models/location", "js/models/section", "js/v
<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=
"${_('Drag to reorder')}"
class=
"drag-handle section-drag-handle"
></a>
</div>
</header>
<div
class=
"subsection-list"
>
...
...
@@ -181,7 +180,7 @@ require(["domReady!", "jquery", "js/models/location", "js/models/section", "js/v
<ol
data-id=
"${section.location.url()}"
>
% for subsection in section.get_children():
<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"
>
<a
href=
"#"
data-tooltip=
"${_('Expand/collapse this subsection')}"
class=
"expand-collapse-icon expand"
></a>
<a
href=
"${reverse('edit_subsection', args=[subsection.location])}"
>
...
...
@@ -195,7 +194,6 @@ require(["domReady!", "jquery", "js/models/location", "js/models/section", "js/v
<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=
"${_('Drag to reorder')}"
class=
"drag-handle subsection-drag-handle"
></a>
</div>
</div>
${units.enum_units(subsection)}
...
...
cms/templates/widgets/units.html
View file @
a0deac03
...
...
@@ -19,7 +19,7 @@ This def will enumerate through a passed in subsection and list all of the units
else:
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"
>
<span
class=
"${unit.scope_ids.block_type}-icon"
></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
% if 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=
"Drag to sort"
class=
"drag-handle unit-drag-handle"
></a>
</div>
% endif
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment