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
109ccf6c
Commit
109ccf6c
authored
May 31, 2013
by
Frances Botsford
Committed by
David Baumgold
Jul 09, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial html, sass, and js for textbook uploader; added alternate upload CTA in content area
parent
cd7a4483
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
67 additions
and
9 deletions
+67
-9
cms/static/sass/views/_textbooks.scss
+29
-3
cms/templates/js/chapter.underscore
+1
-1
cms/templates/js/textbook.underscore
+1
-1
cms/templates/js/upload-dialog.underscore
+18
-4
cms/templates/textbooks.html
+18
-0
No files found.
cms/static/sass/views/_textbooks.scss
View file @
109ccf6c
...
...
@@ -3,6 +3,13 @@
body
.course.textbooks
{
.no-textbook-content
{
margin
:
$baseline
*
2
;
padding
:
$baseline
*
2
;
background-color
:
#ddd
;
text-align
:
center
;
}
form
{
@include
box-sizing
(
border-box
);
@include
box-shadow
(
0
1px
2px
$shadow-l1
);
...
...
@@ -17,14 +24,22 @@ body.course.textbooks {
.action-add-chapter
{
@extend
.t-action2
;
@include
grey-button
;
//
@include grey-button;
@include
transition
(
all
.15s
);
display
:
block
;
width
:
100%
;
margin-bottom
:
(
$baseline
*
1
.5
);
border
:
1px
solid
#B3C4DA
;
padding
:
(
$baseline
/
5
)
$baseline
;
border-radius
:
5px
;
border
:
none
;
padding
:
$baseline
;
background-color
:
#DFE5EF
;
color
:
#8EABBE
;
font-weight
:
600
;
&
:hover
{
background
:
#5597DD
;
color
:
#fff
;
}
}
.action-primary
{
...
...
@@ -214,5 +229,16 @@ body.course.textbooks {
}
}
.wrapper-prompt-assetupload
.prompt
{
width
:
$baseline
*
20
;
h2
{
color
:
$gray
;
font-weight
:
bold
;
}
}
}
cms/templates/js/chapter.underscore
View file @
109ccf6c
...
...
@@ -10,5 +10,5 @@
<span class="tip tip-stacked"><%= gettext("provide the path to a file added to this course or upload a new one") %></span>
<button class="action action-uploadasset"><%= gettext("Upload Asset") %></button>
</div>
<a class="action action-close"><i class="icon-remove-sign"></i> <span class="sr">
delete chapter
</span></a>
<a class="action action-close"><i class="icon-remove-sign"></i> <span class="sr">
<%= gettext("delete chapter") %>
</span></a>
</li>
cms/templates/js/textbook.underscore
View file @
109ccf6c
<form id="edit_textbook_form" class="edit-textbook">
<div id="edit_textbook_error" class="message message-status message-status error" name="edit_textbook_error"></div>
<fieldset>
<legend class="sr">
Required information to edit or add a textbook and chapters
</legend>
<legend class="sr">
<%= gettext("Required information to edit or add a textbook and chapters") %>
</legend>
<ol class="list-input">
<li class="add-textbook-name field text required">
<div class="input-wrap">
...
...
cms/templates/js/upload-dialog.underscore
View file @
109ccf6c
<div id="prompt-assetupload" class="wrapper wrapper-prompt wrapper-prompt-assetupload" aria-describedby="prompt-assetupload-description" aria-labelledby="prompt-assetupload-title" role="dialog" aria-hidden="false">
<div class="prompt confirm">
<div class="copy">
<form class="upload-dialog" method="POST" action="<%= url %>" enctype="multipart/form-data">
<h
3><%= title %></h3
>
<p><%= message %></p>
<h
2><%= title %></h2
>
<p
id="prompt-assetupload-description" class="message"
><%= message %></p>
<input type="file" name="file" />
<% if(uploading) { %>
<% if (uploadedBytes && totalBytes) { %>
...
...
@@ -10,7 +14,17 @@
<% } %>
<% } %>
<div class="actions">
<input type="button" class="button action-upload" value="Upload" <% if (!selectedFile) { %>disabled="disabled"<% } %> />
<input type="button" class="button action-cancel" value="Cancel" />
<h3 class="sr"><%= gettext('Form Actions') %></h3>
<ul>
<li class="nav-item">
<input type="button" class="button action-upload" value="<%= gettext('Upload') %>" <% if (!selectedFile) { %>disabled="disabled"<% } %> />
</li>
<li class="nav-item">
<input type="button" class="button action-cancel" value="<%= gettext('Cancel') %>" />
</li>
</ul>
</div>
</form>
</div>
</div>
cms/templates/textbooks.html
View file @
109ccf6c
...
...
@@ -115,6 +115,9 @@ CMS.Views.ChapterEdit = Backbone.View.extend({
})
var
view
=
new
CMS
.
Views
.
UploadDialog
({
model
:
msg
,
chapter
:
this
.
model
})
$
(
".wrapper-view"
).
append
(
view
.
render
().
el
)
$body
.
addClass
(
'prompt-is-shown'
);
$
(
'.wrapper-prompt'
).
addClass
(
'is-shown'
).
attr
(
'aria-hidden'
,
'false'
);
}
})
CMS
.
Models
.
FileUpload
=
Backbone
.
Model
.
extend
({
...
...
@@ -169,6 +172,9 @@ CMS.Views.UploadDialog = Backbone.View.extend({
removeSelf
:
function
(
e
)
{
if
(
e
&&
e
.
preventDefault
)
{
e
.
preventDefault
();
}
this
.
remove
();
$body
.
removeClass
(
'prompt-is-shown'
);
$
(
'.wrapper-prompt'
).
removeClass
(
'is-shown'
).
attr
(
'aria-hidden'
,
'true'
);
},
upload
:
function
(
e
)
{
this
.
model
.
set
(
'uploading'
,
true
);
...
...
@@ -220,6 +226,8 @@ $(function() {
})
})
</script>
</
%
block>
<
%
block
name=
"content"
>
...
...
@@ -253,7 +261,17 @@ $(function() {
</ul>
</nav>
</div>
<div
class=
"no-textbook-content"
>
<p>
You haven't added any textbooks to this course yet.
</p>
<p><a
href=
"#"
class=
"button upload-button new-button"
>
Add your first textbook
</a></p>
</div>
</div>
</section>
</div>
</
%
block>
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