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
43e6bbb2
Commit
43e6bbb2
authored
Jul 09, 2012
by
Matthew Mongeau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added info page content
parent
c47cdc7f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
4 deletions
+26
-4
common/lib/xmodule/xmodule/course_module.py
+22
-0
lms/templates/info.html
+4
-4
No files found.
common/lib/xmodule/xmodule/course_module.py
View file @
43e6bbb2
...
...
@@ -61,3 +61,25 @@ class CourseDescriptor(SequenceDescriptor):
return
self
.
number
raise
KeyError
(
"Invalid about key "
+
str
(
section_key
))
def
get_info_section
(
self
,
section_key
):
"""
This returns the snippet of html to be rendered on the course info page, given the key for the section.
Valid keys:
- handouts
- guest_handouts
- updates
- guest_updates
"""
# Many of these are stored as html files instead of some semantic markup. This can change without effecting
# this interface when we find a good format for defining so many snippets of text/html.
if
section_key
in
[
'handouts'
,
'guest_handouts'
,
'updates'
,
'guest_updates'
]:
try
:
with
self
.
system
.
resources_fs
.
open
(
path
(
"info"
)
/
section_key
+
".html"
)
as
htmlFile
:
return
htmlFile
.
read
()
except
IOError
:
return
"! About section missing !"
raise
KeyError
(
"Invalid about key "
+
str
(
section_key
))
lms/templates/info.html
View file @
43e6bbb2
...
...
@@ -7,17 +7,17 @@
<div
class=
"info-wrapper"
>
% if user.is_authenticated():
<section
class=
"updates"
>
${
updates
}
${
course.get_info_section('updates')
}
</section>
<section
aria-label=
"Handout Navigation"
class=
"handouts"
>
${
handouts
}
${
course.get_info_section('handouts')
}
</section>
% else:
<section
class=
"updates"
>
${
guest_updates
}
${
course.get_info_section('guest_updates')
}
</section>
<section
aria-label=
"Handout Navigation"
class=
"handouts"
>
${
guest_handouts
}
${
course.get_info_section('guest_handouts')
}
</section>
% 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