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
cf1b0a86
Commit
cf1b0a86
authored
Jan 30, 2012
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Seq module makes nicer class types for Kyle's video styling
parent
811995a2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletions
+16
-1
courseware/modules/seq_module.py
+16
-1
No files found.
courseware/modules/seq_module.py
View file @
cf1b0a86
...
@@ -9,6 +9,10 @@ from mitxmako.shortcuts import render_to_response, render_to_string
...
@@ -9,6 +9,10 @@ from mitxmako.shortcuts import render_to_response, render_to_string
from
x_module
import
XModule
from
x_module
import
XModule
# HACK: This shouldn't be hard-coded to two types
# OBSOLETE: This obsoletes 'type'
class_priority
=
[
'video'
,
'problem'
]
class
SequentialModule
(
XModule
):
class
SequentialModule
(
XModule
):
''' Layout module which lays out content in a temporal sequence
''' Layout module which lays out content in a temporal sequence
'''
'''
...
@@ -55,10 +59,21 @@ class SequentialModule(XModule):
...
@@ -55,10 +59,21 @@ class SequentialModule(XModule):
return
{
'content'
:
content
,
return
{
'content'
:
content
,
"destroy_js"
:
m
[
'destroy_js'
],
"destroy_js"
:
m
[
'destroy_js'
],
'init_js'
:
m
[
'init_js'
],
'init_js'
:
m
[
'init_js'
],
'type'
:
m
[
'type'
]}
'type'
:
m
[
'type'
]}
## Returns a set of all types of all sub-children
child_classes
=
[
set
([
i
.
tag
for
i
in
e
.
iter
()])
for
e
in
self
.
xmltree
]
self
.
contents
=
[(
e
.
get
(
"name"
),
j
(
self
.
render_function
(
e
)))
\
self
.
contents
=
[(
e
.
get
(
"name"
),
j
(
self
.
render_function
(
e
)))
\
for
e
in
self
.
xmltree
]
for
e
in
self
.
xmltree
]
for
(
content
,
element_class
)
in
zip
(
self
.
contents
,
child_classes
):
new_class
=
'other'
for
c
in
class_priority
:
if
c
in
element_class
:
new_class
=
c
content
[
1
][
'type'
]
=
new_class
js
=
""
js
=
""
...
...
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