Create a dedicated CMS.Models.Course Backbone model
Initialize on every page that has a context_course set
This commit is contained in:
10
cms/static/js/models/course.js
Normal file
10
cms/static/js/models/course.js
Normal file
@@ -0,0 +1,10 @@
|
||||
CMS.Models.Course = Backbone.Model.extend({
|
||||
defaults: {
|
||||
"name": ""
|
||||
},
|
||||
validate: function(attrs, options) {
|
||||
if (!attrs.name) {
|
||||
return gettext("You must specify a name");
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user