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
b41d2374
Commit
b41d2374
authored
Jul 01, 2013
by
Frances Botsford
Committed by
David Baumgold
Jul 09, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PDF Textbooks: implemented "View Live" link
parent
2a92a140
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
cms/static/js/views/textbook.js
+4
-1
cms/templates/js/show-textbook.underscore
+1
-1
cms/templates/textbooks.html
+6
-1
No files found.
cms/static/js/views/textbook.js
View file @
b41d2374
...
...
@@ -12,7 +12,10 @@ CMS.Views.ShowTextbook = Backbone.View.extend({
"click .hide-chapters"
:
"hideChapters"
},
render
:
function
()
{
this
.
$el
.
html
(
this
.
template
(
this
.
model
.
attributes
));
var
attrs
=
$
.
extend
({},
this
.
model
.
attributes
);
attrs
.
bookindex
=
this
.
model
.
collection
.
indexOf
(
this
.
model
);
attrs
.
course
=
window
.
section
.
attributes
;
this
.
$el
.
html
(
this
.
template
(
attrs
));
return
this
;
},
editTextbook
:
function
(
e
)
{
...
...
cms/templates/js/show-textbook.underscore
View file @
b41d2374
...
...
@@ -34,7 +34,7 @@
<ul class="actions textbook-actions">
<li class="action action-view">
<
button class="view"><%= gettext("View Live") %></button
>
<
a href="//<%= CMS.URL.LMS_BASE %>/courses/<%= course.org %>/<%= course.num %>/<%= course.url_name %>/pdfbook/<%= bookindex %>/" class="view"><%= gettext("View Live") %></a
>
</li>
<li class="action action-edit">
<button class="edit"><%= gettext("Edit") %></button>
...
...
cms/templates/textbooks.html
View file @
b41d2374
...
...
@@ -18,9 +18,14 @@
<script
type=
"text/javascript"
>
CMS
.
URL
.
UPLOAD_ASSET
=
"${upload_asset_url}"
CMS
.
URL
.
TEXTBOOKS
=
"${textbook_url}"
CMS
.
URL
.
LMS_BASE
=
"${settings.LMS_BASE}"
window
.
section
=
new
CMS
.
Models
.
Section
({
id
:
"${course.id}"
,
name
:
"${course.display_name_with_default | h}"
name
:
"${course.display_name_with_default | h}"
,
url_name
:
"${course.location.name | h}"
,
org
:
"${course.location.org | h}"
,
num
:
"${course.location.course | h}"
,
revision
:
"${course.location.revision | h}"
});
var
textbooks
=
new
CMS
.
Collections
.
TextbookSet
(
$
{
json
.
dumps
(
course
.
pdf_textbooks
)},
{
parse
:
true
});
var
tbView
=
new
CMS
.
Views
.
ListTextbooks
({
collection
:
textbooks
});
...
...
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