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
5fc5587f
Commit
5fc5587f
authored
Oct 09, 2013
by
Christina Roberts
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1266 from edx/talbs/studio-dnd
Studio: Drag and Drop Container
parents
4879b06c
bbe906f7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
81 deletions
+86
-81
cms/static/js/views/overview.js
+1
-1
cms/templates/edit_subsection.html
+5
-3
cms/templates/overview.html
+80
-77
No files found.
cms/static/js/views/overview.js
View file @
5fc5587f
...
...
@@ -284,7 +284,7 @@ define(["domReady", "jquery", "jquery.ui", "gettext", "js/views/feedback_notific
$
(
ele
).
data
(
'child-selector'
,
type
);
var
draggable
=
new
Draggabilly
(
ele
,
{
handle
:
handleClass
,
axis
:
'y
'
containment
:
'.wrapper-dnd
'
});
draggable
.
on
(
'dragStart'
,
_
.
bind
(
overviewDragger
.
onDragStart
,
overviewDragger
));
draggable
.
on
(
'dragMove'
,
_
.
bind
(
overviewDragger
.
onDragMove
,
overviewDragger
));
...
...
cms/templates/edit_subsection.html
View file @
5fc5587f
...
...
@@ -21,9 +21,11 @@
<label>
${_("Display Name:")}
</label>
<input
type=
"text"
value=
"${subsection.display_name_with_default | h}"
class=
"subsection-display-name-input"
data-metadata-name=
"display_name"
/>
</div>
<div
class=
"sortable-unit-list"
>
<label>
${_("Units:")}
</label>
${units.enum_units(subsection, subsection_units=subsection_units)}
<div
class=
"wrapper-dnd"
>
<div
class=
"sortable-unit-list"
>
<label>
${_("Units:")}
</label>
${units.enum_units(subsection, subsection_units=subsection_units)}
</div>
</div>
</article>
</div>
...
...
cms/templates/overview.html
View file @
5fc5587f
...
...
@@ -138,87 +138,90 @@ require(["domReady!", "jquery", "js/models/location", "js/models/section", "js/v
<div
class=
"main-wrapper"
>
<div
class=
"inner-wrapper"
>
<article
class=
"courseware-overview"
data-id=
"${context_course.location.url()}"
>
% for section in sections:
<section
class=
"courseware-section branch is-draggable"
data-id=
"${section.location}"
data-parent-id=
"${context_course.location.url()}"
>
<
%
include
file=
"widgets/_ui-dnd-indicator-before.html"
/>
<header>
<a
href=
"#"
data-tooltip=
"${_('Expand/collapse this section')}"
class=
"expand-collapse-icon collapse"
></a>
<div
class=
"item-details"
data-id=
"${section.location}"
>
<h3
class=
"section-name"
data-name=
"${section.display_name_with_default | h}"
></h3>
<div
class=
"section-published-date"
>
<
%
if
section
.
start
is
not
None:
start_date_str =
section.start.strftime('%m/%d/%Y')
start_time_str =
section.start.strftime('%H:%M')
else:
start_date_str =
''
start_time_str =
''
%
>
%if section.start is None:
<span
class=
"published-status"
>
${_("This section has not been released.")}
</span>
<a
href=
"#"
class=
"schedule-button"
data-date=
""
data-time=
""
data-id=
"${section.location}"
>
${_("Schedule")}
</a>
%else:
<span
class=
"published-status"
><strong>
${_("Will Release:")}
</strong>
${date_utils.get_default_time_display(section.start)}
</span>
<a
href=
"#"
class=
"edit-button"
data-date=
"${start_date_str}"
data-time=
"${start_time_str}"
data-id=
"${section.location}"
>
${_("Edit")}
</a>
%endif
</div>
</div>
<div
class=
"item-actions"
>
<a
href=
"#"
data-tooltip=
"${_('Delete this section')}"
class=
"delete-button delete-section-button"
><span
class=
"delete-icon"
></span></a>
<span
data-tooltip=
"${_('Drag to reorder')}"
class=
"drag-handle section-drag-handle"
></span>
</div>
</header>
<div
class=
"subsection-list"
>
<div
class=
"list-header"
>
<a
href=
"#"
class=
"new-subsection-item"
data-category=
"${new_subsection_category}"
>
<span
class=
"new-folder-icon"
></span>
${_("New Subsection")}
</a>
</div>
<ol
class=
"sortable-subsection-list"
data-id=
"${section.location.url()}"
>
% for subsection in section.get_children():
<li
class=
"courseware-subsection branch collapsed id-holder is-draggable"
data-id=
"${subsection.location}"
data-parent-id=
"${section.location.url()}"
>
<
%
include
file=
"widgets/_ui-dnd-indicator-before.html"
/>
<div
class=
"section-item"
>
<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])}"
>
<span
class=
"folder-icon"
></span>
<span
class=
"subsection-name"
><span
class=
"subsection-name-value"
>
${subsection.display_name_with_default}
</span></span>
</a>
</div>
<div
class=
"wrapper-dnd"
>
<article
class=
"courseware-overview"
data-id=
"${context_course.location.url()}"
>
% for section in sections:
<section
class=
"courseware-section branch is-draggable"
data-id=
"${section.location}"
data-parent-id=
"${context_course.location.url()}"
>
<
%
include
file=
"widgets/_ui-dnd-indicator-before.html"
/>
<header>
<a
href=
"#"
data-tooltip=
"${_('Expand/collapse this section')}"
class=
"expand-collapse-icon collapse"
></a>
<div
class=
"item-details"
data-id=
"${section.location}"
>
<h3
class=
"section-name"
data-name=
"${section.display_name_with_default | h}"
></h3>
<div
class=
"section-published-date"
>
<
%
if
section
.
start
is
not
None:
start_date_str =
section.start.strftime('%m/%d/%Y')
start_time_str =
section.start.strftime('%H:%M')
else:
start_date_str =
''
start_time_str =
''
%
>
%if section.start is None:
<span
class=
"published-status"
>
${_("This section has not been released.")}
</span>
<a
href=
"#"
class=
"schedule-button"
data-date=
""
data-time=
""
data-id=
"${section.location}"
>
${_("Schedule")}
</a>
%else:
<span
class=
"published-status"
><strong>
${_("Will Release:")}
</strong>
${date_utils.get_default_time_display(section.start)}
</span>
<a
href=
"#"
class=
"edit-button"
data-date=
"${start_date_str}"
data-time=
"${start_time_str}"
data-id=
"${section.location}"
>
${_("Edit")}
</a>
%endif
</div>
</div>
<div
class=
"gradable-status"
data-initial-status=
"${subsection.format if subsection.format is not None else _('Not Graded')}"
>
<div
class=
"item-actions"
>
<a
href=
"#"
data-tooltip=
"${_('Delete this section')}"
class=
"delete-button delete-section-button"
><span
class=
"delete-icon"
></span></a>
<span
data-tooltip=
"${_('Drag to reorder')}"
class=
"drag-handle section-drag-handle"
></span>
</div>
</header>
<div
class=
"subsection-list"
>
<div
class=
"list-header"
>
<a
href=
"#"
class=
"new-subsection-item"
data-category=
"${new_subsection_category}"
>
<span
class=
"new-folder-icon"
></span>
${_("New Subsection")}
</a>
</div>
<ol
class=
"sortable-subsection-list"
data-id=
"${section.location.url()}"
>
% for subsection in section.get_children():
<li
class=
"courseware-subsection branch collapsed id-holder is-draggable"
data-id=
"${subsection.location}"
data-parent-id=
"${section.location.url()}"
>
<
%
include
file=
"widgets/_ui-dnd-indicator-before.html"
/>
<div
class=
"section-item"
>
<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])}"
>
<span
class=
"folder-icon"
></span>
<span
class=
"subsection-name"
><span
class=
"subsection-name-value"
>
${subsection.display_name_with_default}
</span></span>
</a>
</div>
<div
class=
"gradable-status"
data-initial-status=
"${subsection.format if subsection.format is not None else _('Not Graded')}"
>
</div>
<div
class=
"item-actions"
>
<a
href=
"#"
data-tooltip=
"${_('Delete this subsection')}"
class=
"delete-button delete-subsection-button"
><span
class=
"delete-icon"
></span></a>
<span
data-tooltip=
"${_('Drag to reorder')}"
class=
"drag-handle subsection-drag-handle"
></span>
</div>
</div>
${units.enum_units(subsection)}
<
%
include
file=
"widgets/_ui-dnd-indicator-after.html"
/>
</li>
% endfor
<li
class=
"ui-splint ui-splint-indicator"
>
<
%
include
file=
"widgets/_ui-dnd-indicator-initial.html"
/>
</li>
</ol>
</div>
<div
class=
"item-actions"
>
<a
href=
"#"
data-tooltip=
"${_('Delete this subsection')}"
class=
"delete-button delete-subsection-button"
><span
class=
"delete-icon"
></span></a>
<span
data-tooltip=
"${_('Drag to reorder')}"
class=
"drag-handle subsection-drag-handle"
></span>
</div>
</div>
${units.enum_units(subsection)}
<
%
include
file=
"widgets/_ui-dnd-indicator-after.html"
/>
</li>
% endfor
<li
class=
"ui-splint ui-splint-indicator"
>
<
%
include
file=
"widgets/_ui-dnd-indicator-initial.html"
/>
</li>
</ol>
</div>
<
%
include
file=
"widgets/_ui-dnd-indicator-after.html"
/>
</section>
% endfor
</article>
<
%
include
file=
"widgets/_ui-dnd-indicator-after.html"
/>
</section>
% endfor
</article>
</div>
</div>
</div>
<footer></footer>
...
...
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