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
f9a10855
Commit
f9a10855
authored
Jul 02, 2013
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add notes about JS validation functions returning non-i18n error messages
parent
44185c3a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
cms/static/js/models/textbook.js
+6
-0
No files found.
cms/static/js/models/textbook.js
View file @
f9a10855
...
...
@@ -57,6 +57,8 @@ CMS.Models.Textbook = Backbone.AssociatedModel.extend({
chapters
:
this
.
get
(
'chapters'
).
toJSON
()
};
},
// NOTE: validation functions should return non-internationalized error
// messages. The messages will be passed through gettext in the template.
validate
:
function
(
attrs
,
options
)
{
if
(
!
attrs
.
name
)
{
return
{
...
...
@@ -129,6 +131,8 @@ CMS.Models.Chapter = Backbone.AssociatedModel.extend({
url
:
this
.
get
(
'asset_path'
)
};
},
// NOTE: validation functions should return non-internationalized error
// messages. The messages will be passed through gettext in the template.
validate
:
function
(
attrs
,
options
)
{
if
(
!
attrs
.
name
&&
!
attrs
.
asset_path
)
{
return
{
...
...
@@ -169,6 +173,8 @@ CMS.Models.FileUpload = Backbone.Model.extend({
"totalBytes"
:
0
,
"finished"
:
false
},
// NOTE: validation functions should return non-internationalized error
// messages. The messages will be passed through gettext in the template.
validate
:
function
(
attrs
,
options
)
{
if
(
attrs
.
selectedFile
&&
attrs
.
selectedFile
.
type
!==
"application/pdf"
)
{
return
{
...
...
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