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
8e00f6dc
Commit
8e00f6dc
authored
Apr 14, 2014
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore the ability to drag at any level inside a vertical and clean up templates.
parent
c1fd0ca3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
13 deletions
+34
-13
cms/templates/studio_xblock_wrapper.html
+0
-3
common/lib/xmodule/xmodule/vertical_module.py
+17
-1
lms/templates/vert_module.html
+2
-9
lms/templates/vert_module_studio_view.html
+15
-0
No files found.
cms/templates/studio_xblock_wrapper.html
View file @
8e00f6dc
...
...
@@ -36,9 +36,6 @@
</a>
</li>
% endif
<li
class=
"action-item drag"
>
<span
data-tooltip=
"${_('Drag to reorder')}"
class=
"drag-handle action"
></span>
</li>
</ul>
</div>
</header>
...
...
common/lib/xmodule/xmodule/vertical_module.py
View file @
8e00f6dc
...
...
@@ -17,6 +17,22 @@ class VerticalModule(VerticalFields, XModule):
''' Layout module for laying out submodules vertically.'''
def
student_view
(
self
,
context
):
# When rendering a Studio preview, use a different template to support drag and drop.
if
context
and
context
[
'runtime_type'
]
==
'studio'
:
return
self
.
studio_preview_view
(
context
)
return
self
.
render_view
(
context
,
'vert_module.html'
)
def
studio_preview_view
(
self
,
context
):
"""
Renders the Studio preview view, which supports drag and drop.
"""
return
self
.
render_view
(
context
,
'vert_module_studio_view.html'
)
def
render_view
(
self
,
context
,
template_name
):
"""
Helper method for rendering student_view and the Studio version.
"""
fragment
=
Fragment
()
contents
=
[]
...
...
@@ -29,7 +45,7 @@ class VerticalModule(VerticalFields, XModule):
'content'
:
rendered_child
.
content
})
fragment
.
add_content
(
self
.
system
.
render_template
(
'vert_module.html'
,
{
fragment
.
add_content
(
self
.
system
.
render_template
(
template_name
,
{
'items'
:
contents
}))
return
fragment
...
...
lms/templates/vert_module.html
View file @
8e00f6dc
<
%!
from
django
.
utils
.
translation
import
ugettext
as
_
%
>
<div
class=
"vert-mod"
>
<ol
class=
"vertical-container"
>
% for idx, item in enumerate(items):
<li
class=
"vertical-element is-draggable"
>
% for idx, item in enumerate(items):
<div
class=
"vert vert-${idx}"
data-id=
"${item['id']}"
>
${item['content']}
</div>
</li>
% endfor
</ol>
% endfor
</div>
lms/templates/vert_module_studio_view.html
0 → 100644
View file @
8e00f6dc
<
%!
from
django
.
utils
.
translation
import
ugettext
as
_
%
>
<div
class=
"vert-mod"
>
<ol
class=
"vertical-container"
>
% for idx, item in enumerate(items):
<li
class=
"vertical-element is-draggable"
>
<div
class=
"vert vert-${idx}"
data-id=
"${item['id']}"
>
<span
data-tooltip=
"${_('Drag to reorder')}"
class=
"drag-handle action"
></span>
${item['content']}
</div>
</li>
% endfor
</ol>
</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