Commit Graph

25 Commits

Author SHA1 Message Date
David Baumgold
0d3490374e Refactor textbooks to use locator URLs
STUD-945
2013-12-05 13:13:28 -05:00
David Baumgold
d97921e6e2 Convert Studio JS to use require.js 2013-10-04 13:43:50 -04:00
Peter Fogg
ce1a13f32c Generalize file uploader.
Previously the file upload dialog was PDF- and textbook-specific. The
changes are adding parameters to the FileUpload model for the file
type, and adding an onSuccess callback to the UploadDialog view. Also
moved upload-specific SASS into its own file.
2013-08-21 09:42:00 -04:00
David Baumgold
fe8587566f All textbook chapters must have name and asset_path
Previously, for a textbook with only one chapter, we allowed that chapter to
not have a title -- under the assumption that it would be shown as a monolithic
textbook, instead of a chaptered textbook. However, the UI doesn't support that
idea, the code was getting a bit messy, and there was no real benefit to the idea
of not having to specify a chapter title. This commit removes that special case,
and ensures that all textbook chapters must have a name and an asset path.
2013-07-09 19:16:43 -04:00
David Baumgold
f9a10855d9 Add notes about JS validation functions returning non-i18n error messages 2013-07-09 19:16:42 -04:00
David Baumgold
7506562f50 Another lettuce test, and fixes to make it work 2013-07-09 19:16:11 -04:00
David Baumgold
11c5c14998 Add error class to invalid fields on PDF textbooks form 2013-07-09 19:16:09 -04:00
Frances Botsford
2321a2c563 more updates to PDF textbook UI 2013-07-09 19:16:09 -04:00
David Baumgold
70a011770e Show a warning if the user tries to leave the page with unsaved textbook changes 2013-07-09 19:16:08 -04:00
David Baumgold
fedbf4585b Prevent saving when textbook is in invalid state 2013-07-09 19:16:08 -04:00
David Baumgold
74b9703def Reset model attributes when textbook editing is cancelled 2013-07-09 19:16:08 -04:00
David Baumgold
9797b34c4e Pluralize CMS.URL.TEXTBOOK 2013-07-09 19:16:08 -04:00
David Baumgold
77ae9a6a78 PDF Textbooks: fetch/save individual textbooks
Created a few RESTful API endpoints, which required creating and assigning
arbitrary IDs to PDF textbooks. Changed the Backbone views to save individual
models, instead of saving a whole collection.
2013-07-09 19:16:07 -04:00
David Baumgold
7b502ced1c Add validation functions for PDF Textbook models 2013-07-09 19:16:07 -04:00
David Baumgold
7856db1e09 Provide correct path to Chapter model 2013-07-09 19:16:07 -04:00
David Baumgold
dc5123c836 Allow multiple textbook edit forms on the page simultaneously 2013-07-09 19:16:07 -04:00
David Baumgold
404c36b8f4 PDF textbooks: namespace JS variables for URLs 2013-07-09 19:16:07 -04:00
David Baumgold
696a795c12 Don't remove all chapters on closing EditTextbook view
Previously, the code would dynamically add a chapter on render() if the textbook
had no chapters, and would remove all empty chapters when the edit view was closed.
Now, the render method doesn't modify the model at all anymore (yay!) and when the
edit view is closed, remove all empty chapters but be sure to leave at least one
left.
2013-07-09 19:16:07 -04:00
David Baumgold
5836286fda PDF textbooks: unified naming conventions 2013-07-09 19:16:06 -04:00
David Baumgold
c2ef6a53f5 PDF textbook upload: show success message for 2 seconds following successful upload 2013-07-09 19:16:06 -04:00
David Baumgold
cae5c324a6 modifications to Backbone textbook structure
Textbooks now have an empty chapterset by default, instead of one with one empty
chapter. The TextbookEdit view dynamically adds an empty chapter if the chapterset
is empty; the close button removes all empty chapters from the chapterset.
2013-07-09 19:16:06 -04:00
Frances Botsford
e059060cf3 updated textbook page html and sass, and added basic styling for error on wrong file type 2013-07-09 19:16:05 -04:00
David Baumgold
e8b79dc696 PDF textbooks only accept PDF files
All other file types will trigger a validation error
2013-07-09 19:16:05 -04:00
David Baumgold
207453a37c Further basic tests for Backbone models 2013-07-09 19:16:03 -04:00
David Baumgold
40098f6593 renamed textbooks.js to textbook.js 2013-07-09 19:16:03 -04:00