/*jshint multistr:true */ // Field Info // // For each field // // Id / Label / type / format // Editor -- to change type (and possibly format) // Editor for show/hide ... // Summaries of fields // // Top values / number empty // If number: max, min average ... // Box to boot transform editor ... this.recline = this.recline || {}; this.recline.View = this.recline.View || {}; (function($, my) { my.Fields = Backbone.View.extend({ className: 'recline-fields-view well', template: ' \
\ {{#fields}} \
\
\

\ {{label}} ({{id}}) \ \ {{type}} \ More information » \ \ \

\
\
\
\ {{type}} \
\
\
\ {{/fields}} \
\ ', events: { }, initialize: function(model) { _.bindAll(this, 'render'); this.el = $(this.el); this.model.fields.bind('all', this.render); this.render(); }, render: function() { var tmplData = { fields: this.model.fields.toJSON() }; var templated = Mustache.render(this.template, tmplData); this.el.html(templated); // this.el.hide(); this.el.find('.collapse').collapse() } }); })(jQuery, recline.View);