Add admin field application

This commit is contained in:
Nicolas Le Goff
2013-05-12 19:51:29 +02:00
committed by Romain Neutron
parent 7199d38ab3
commit 05dc3659af
23 changed files with 1017 additions and 118 deletions

View File

@@ -0,0 +1,33 @@
define([
'underscore',
'backbone'
], function(_, Backbone) {
var FieldModel = Backbone.Model.extend({
initialize : function(attributes, options) {
if (attributes && ! "sbas-id" in attributes) {
throw "You must set a sbas id";
}
},
urlRoot: function () {
return '/admin/fields/'+ this.get('sbas-id') +'/fields';
},
defaults: {
"business": false,
"type": "string",
"thumbtitle": "0",
"tbranch": "",
"separator": "",
"required": false,
"report": true,
"readonly": false,
"multi": false,
"indexable": true,
"dces-element": null,
"vocabulary-type": null,
"vocabulary-restricted": false
}
});
// Return the model for the module
return FieldModel;
});