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
aee7d856
Commit
aee7d856
authored
Mar 07, 2013
by
Brian Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug in tabs
parent
b5ab7660
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
0 deletions
+72
-0
lms/djangoapps/courseware/tabs.py
+1
-0
lms/templates/static_htmlbook.html
+71
-0
No files found.
lms/djangoapps/courseware/tabs.py
View file @
aee7d856
...
...
@@ -220,6 +220,7 @@ VALID_TAB_TYPES = {
'external_link'
:
TabImpl
(
key_checker
([
'name'
,
'link'
]),
_external_link
),
'textbooks'
:
TabImpl
(
null_validator
,
_textbooks
),
'pdf_textbooks'
:
TabImpl
(
null_validator
,
_pdf_textbooks
),
'html_textbooks'
:
TabImpl
(
null_validator
,
_html_textbooks
),
'progress'
:
TabImpl
(
need_name
,
_progress
),
'static_tab'
:
TabImpl
(
key_checker
([
'name'
,
'url_slug'
]),
_static_tab
),
'peer_grading'
:
TabImpl
(
null_validator
,
_peer_grading
),
...
...
lms/templates/static_htmlbook.html
0 → 100644
View file @
aee7d856
<
%
inherit
file=
"main.html"
/>
<
%
namespace
name=
'static'
file=
'static_content.html'
/>
<
%
block
name=
"title"
>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, maximum-scale=1"
>
<title>
${course.number} Textbook
</title>
</
%
block>
<
%
block
name=
"headextra"
>
<
%
static:css
group=
'course'
/>
<
%
static:js
group=
'courseware'
/>
</
%
block>
<
%
block
name=
"js_extra"
>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
var
options
=
{};
%
if
'url'
in
textbook
:
options
.
url
=
"${textbook['url']}"
;
%
endif
%
if
'chapters'
in
textbook
:
var
chptrs
=
[];
%
for
chap
in
textbook
[
'chapters'
]:
chptrs
.
push
(
"${chap['url']}"
);
%
endfor
options
.
chapters
=
chptrs
;
%
endif
%
if
chapter
is
not
None
:
options
.
chapterNum
=
$
{
chapter
};
%
endif
%
if
page
is
not
None
:
options
.
pageNum
=
$
{
page
};
%
endif
});
</script>
</
%
block>
<
%
include
file=
"/courseware/course_navigation.html"
args=
"active_page='htmltextbook/{0}'.format(book_index)"
/>
<div
id=
"outerContainer"
>
<div
id=
"mainContainer"
class=
"book-wrapper"
>
%if 'chapters' in textbook:
<section
aria-label=
"Textbook Navigation"
class=
"book-sidebar"
>
<ul
id=
"booknav"
class=
"treeview-booknav"
>
<
%
def
name=
"print_entry(entry, index_value)"
>
<li
id=
"htmlchapter-${index_value}"
>
<a
class=
"chapter"
>
${entry.get('title')}
</a>
</li>
</
%
def>
% for (index, entry) in enumerate(textbook['chapters']):
${print_entry(entry, index+1)}
% endfor
</ul>
</section>
%endif
<section
id=
"viewerContainer"
class=
"book"
>
<!-- <section class="page"> -->
<iframe
class=
"page"
id=
"bookpage"
src=
"${ textbook['chapters'][0]['url'] }"
>
<!-- </section> -->
</section>
</div>
<!-- mainContainer -->
</div>
<!-- outerContainer -->
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