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
486baced
Commit
486baced
authored
Jun 12, 2013
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up HTML structure in textbooks page
parent
4509dc03
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
50 deletions
+49
-50
cms/templates/js/textbook-edit.underscore
+24
-22
cms/templates/js/textbook-show.underscore
+23
-25
cms/templates/textbooks.html
+2
-3
No files found.
cms/templates/js/textbook-edit.underscore
View file @
486baced
<% if (errors) { %>
<div id="edit_textbook_error" class="message message-status message-status error" name="edit_textbook_error">
<%= errors %>
</div>
<% } %>
<form class="edit-textbook" id="edit_textbook_form">
<% if (errors) { %>
<div id="edit_textbook_error" class="message message-status message-status error" name="edit_textbook_error">
<%= errors %>
</div>
<% } %>
<fieldset class="textbook">
<legend class="sr"><%= gettext("Textbook information") %></legend>
<div class="input-wrap field text required add-textbook-name">
<label for="textbook-name-input"><%= gettext("Textbook Name") %></label>
<input id="textbook-name-input" name="textbook-name" type="text" placeholder="<%= gettext("Introduction to Cookie Baking") %>" value="<%= name %>">
<span class="tip tip-stacked"><%= gettext("the title/name of the text book as you would like your students to see it.") %></span>
</div>
</fieldset>
<fieldset class="chapters">
<legend class="sr"><%= gettext("Chapter(s) information") %></legend>
<ol class="chapters list-input enum"></ol>
</fieldset>
<fieldset class="textbook">
<legend class="sr"><%= gettext("Textbook information") %></legend>
<div class="input-wrap field text required add-textbook-name">
<label for="textbook-name-input"><%= gettext("Textbook Name") %></label>
<input id="textbook-name-input" name="textbook-name" type="text" placeholder="<%= gettext("Introduction to Cookie Baking") %>" value="<%= name %>">
<span class="tip tip-stacked"><%= gettext("the title/name of the text book as you would like your students to see it.") %></span>
</div>
</fieldset>
<fieldset class="chapters">
<legend class="sr"><%= gettext("Chapter(s) information") %></legend>
<ol class="chapters list-input enum"></ol>
</fieldset>
<div class="actions">
<button class="action action-add-chapter"><i class="icon-plus"></i> <%= gettext("Add a Chapter") %></button>
<button class="action action-primary" type="submit"><%= gettext("Save") %></button>
<button class="action action-secondary action-cancel"><%= gettext("Cancel") %></button>
</div>
<div class="actions">
<button class="action action-add-chapter"><i class="icon-plus"></i> <%= gettext("Add a Chapter") %></button>
<button class="action action-primary" type="submit"><%= gettext("Save") %></button>
<button class="action action-secondary action-cancel"><%= gettext("Cancel") %></button>
</div>
</form>
cms/templates/js/textbook-show.underscore
View file @
486baced
<li class="textbook">
<span class="name"><%= name %></span>
<% if(chapters.length > 1) {%>
<a href="#" class="chapter-toggle
<% if(showChapters){ print('hide'); } else { print('show'); } %>-chapters">
<i class="icon-chevron-<% if(showChapters){ print('down'); } else { print('right'); } %>"></i>
<%= chapters.length %> PDF Chapters
</a>
<% } else if(chapters.length === 1) { %>
<%= chapters.at(0).get("asset_path") %>
<% } %>
<a href="#" class="view"><%= gettext("view in course") %></a>
<button class="edit"><%= gettext("Edit") %></button>
<button class="delete"><%= gettext("Delete") %></button>
<% if(showChapters) { %>
<hr>
<ol class="chapters">
<% chapters.each(function(chapter) { %>
<li><span class="chapter-name"><%= chapter.get('name') %></span>
<span class="chapter-asset-path"><%= chapter.get('asset_path') %></span>
</li>
<% }) %>
</ol>
<% } %>
</li>
<span class="name"><%= name %></span>
<% if(chapters.length > 1) {%>
<a href="#" class="chapter-toggle
<% if(showChapters){ print('hide'); } else { print('show'); } %>-chapters">
<i class="icon-chevron-<% if(showChapters){ print('down'); } else { print('right'); } %>"></i>
<%= chapters.length %> PDF Chapters
</a>
<% } else if(chapters.length === 1) { %>
<%= chapters.at(0).get("asset_path") %>
<% } %>
<a href="#" class="view"><%= gettext("view in course") %></a>
<button class="edit"><%= gettext("Edit") %></button>
<button class="delete"><%= gettext("Delete") %></button>
<% if(showChapters) { %>
<hr>
<ol class="chapters">
<% chapters.each(function(chapter) { %>
<li><span class="chapter-name"><%= chapter.get('name') %></span>
<span class="chapter-asset-path"><%= chapter.get('asset_path') %></span>
</li>
<% }) %>
</ol>
<% } %>
cms/templates/textbooks.html
View file @
486baced
...
...
@@ -72,6 +72,7 @@ CMS.Views.TextbookShow = Backbone.View.extend({
this
.
template
=
_
.
template
(
$
(
"#show-textbook-tpl"
).
text
());
this
.
listenTo
(
this
.
model
,
"change"
,
this
.
render
);
},
tagName
:
"li"
,
events
:
{
"click .edit"
:
"editTextbook"
,
"click .delete"
:
"removeSelf"
,
...
...
@@ -108,9 +109,7 @@ CMS.Views.TextbookEdit = Backbone.View.extend({
this
.
listenTo
(
chapters
,
"all"
,
this
.
render
);
this
.
listenTo
(
this
.
model
.
collection
,
"editOne"
,
this
.
remove
);
},
tagName
:
"form"
,
className
:
"edit-textbook"
,
id
:
"edit_textbook_form"
,
tagName
:
"li"
,
render
:
function
()
{
this
.
$el
.
html
(
this
.
template
({
name
:
this
.
model
.
escape
(
'name'
),
...
...
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