class Helios.Views.Entities extends Backbone.View template: JST['entities'] el: "[role='main']" events: 'change #entities': -> window.app.navigate(@$el.find("#entities").val(), {trigger: true}) initialize: -> @collection.on 'reset', @render render: => @$el.html(@template(entities: @collection)) @ class Helios.Views.Entity extends Backbone.View el: "[role='main']" initialize: -> @model.on 'reset', @render @collection = @model.get('resources') @collection.fetch({success: @render}) render: => if @collection @datagrid = new Backbone.Datagrid({ collection: @collection, columns: @collection.first().attributes.keys, paginated: true, perPage: 20 }) @$el.find("#datagrid").html(@datagrid.el) @ class Helios.Views.Devices extends Backbone.View template: JST['devices'] el: "[role='main']" render: => @$el.html(@template()) if @collection @datagrid = new Backbone.Datagrid({ collection: @collection, columns: Helios.Models.Device.fields, paginated: true, perPage: 20 }) @$el.find("#datagrid").html(@datagrid.el) @ class Helios.Views.Receipts extends Backbone.View template: JST['receipts'] el: "[role='main']" render: => @$el.html(@template()) if @collection console.log("receipts") @datagrid = new Backbone.Datagrid({ collection: @collection, columns: Helios.Models.Receipt.fields, paginated: true, perPage: 20 }) @$el.find("#datagrid").html(@datagrid.el) @ class Helios.Views.Passes extends Backbone.View template: JST['passes'] el: "[role='main']" render: => @$el.html(@template()) if @collection console.log("passes") @datagrid = new Backbone.Datagrid({ collection: @collection, columns: Helios.Models.Pass.fields, paginated: true, perPage: 20 }) @$el.find("#datagrid").html(@datagrid.el) @