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,29 @@
define([
'underscore',
'backbone',
'i18n'
], function( _, Backbone, i18n, bootstrap) {
var DcFieldsView = Backbone.View.extend({
tagName: "div",
className: "input-append",
events: {
"change select": "onChange"
},
render: function() {
var template = _.template($("#dc_fields_template").html(), {
dces_elements: this.collection.toJSON()
});
this.$el.html(template);
return this;
},
onChange: function(e) {
var index = $(e.target)[0].selectedIndex;
this.$el.closest('table').find('.dces-help-block').empty().append(this.collection.at(index).get('definition'));
}
});
return DcFieldsView;
});