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
6abd1ec6
Commit
6abd1ec6
authored
Jul 27, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #309 from MITx/feature/tutorials_fix
Add optional hide_from_toc attribute to XML elements
parents
aa855eec
72341569
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
4 deletions
+7
-4
common/lib/xmodule/xmodule/x_module.py
+2
-1
common/lib/xmodule/xmodule/xml_module.py
+1
-1
lms/djangoapps/courseware/module_render.py
+2
-0
lms/templates/accordion.html
+2
-2
No files found.
common/lib/xmodule/xmodule/x_module.py
View file @
6abd1ec6
...
@@ -104,7 +104,8 @@ class HTMLSnippet(object):
...
@@ -104,7 +104,8 @@ class HTMLSnippet(object):
"""
"""
Return the html used to display this snippet
Return the html used to display this snippet
"""
"""
raise
NotImplementedError
(
"get_html() must be provided by specific modules"
)
raise
NotImplementedError
(
"get_html() must be provided by specific modules - not present in {0}"
.
format
(
self
.
__class__
))
class
XModule
(
HTMLSnippet
):
class
XModule
(
HTMLSnippet
):
...
...
common/lib/xmodule/xmodule/xml_module.py
View file @
6abd1ec6
...
@@ -88,7 +88,7 @@ class XmlDescriptor(XModuleDescriptor):
...
@@ -88,7 +88,7 @@ class XmlDescriptor(XModuleDescriptor):
# The attributes will be removed from the definition xml passed
# The attributes will be removed from the definition xml passed
# to definition_from_xml, and from the xml returned by definition_to_xml
# to definition_from_xml, and from the xml returned by definition_to_xml
metadata_attributes
=
(
'format'
,
'graceperiod'
,
'showanswer'
,
'rerandomize'
,
metadata_attributes
=
(
'format'
,
'graceperiod'
,
'showanswer'
,
'rerandomize'
,
'start'
,
'due'
,
'graded'
,
'name'
,
'slug'
)
'start'
,
'due'
,
'graded'
,
'name'
,
'slug'
,
'hide_from_toc'
)
# A dictionary mapping xml attribute names to functions of the value
# A dictionary mapping xml attribute names to functions of the value
# that return the metadata key and value
# that return the metadata key and value
...
...
lms/djangoapps/courseware/module_render.py
View file @
6abd1ec6
...
@@ -56,7 +56,9 @@ def toc_for_course(user, request, course, active_chapter, active_section):
...
@@ -56,7 +56,9 @@ def toc_for_course(user, request, course, active_chapter, active_section):
active
=
(
chapter
.
metadata
.
get
(
'display_name'
)
==
active_chapter
and
active
=
(
chapter
.
metadata
.
get
(
'display_name'
)
==
active_chapter
and
section
.
metadata
.
get
(
'display_name'
)
==
active_section
)
section
.
metadata
.
get
(
'display_name'
)
==
active_section
)
hide_from_toc
=
section
.
metadata
.
get
(
'hide_from_toc'
,
'false'
)
.
lower
()
==
'true'
if
not
hide_from_toc
:
sections
.
append
({
'name'
:
section
.
metadata
.
get
(
'display_name'
),
sections
.
append
({
'name'
:
section
.
metadata
.
get
(
'display_name'
),
'format'
:
section
.
metadata
.
get
(
'format'
,
''
),
'format'
:
section
.
metadata
.
get
(
'format'
,
''
),
'due'
:
section
.
metadata
.
get
(
'due'
,
''
),
'due'
:
section
.
metadata
.
get
(
'due'
,
''
),
...
...
lms/templates/accordion.html
View file @
6abd1ec6
...
@@ -12,11 +12,11 @@
...
@@ -12,11 +12,11 @@
${section['format']} ${"due " + section['due'] if 'due' in section and section['due'] != '' else ''}
${section['format']} ${"due " + section['due'] if 'due' in section and section['due'] != '' else ''}
</span>
</span>
</p>
</p>
</a>
</a>
</li>
% endfor
% endfor
</ul>
</ul>
</
%
def>
</
%
def>
% for chapter in toc:
% for chapter in toc:
${make_chapter(chapter)}
${make_chapter(chapter)}
...
...
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