2018-07-24 04:33:00 -04:00
|
|
|
const Mn = require('backbone.marionette');
|
|
|
|
const App = require('../../../main');
|
|
|
|
const ItemView = require('./item');
|
|
|
|
const template = require('./main.ejs');
|
2018-07-08 21:22:10 -04:00
|
|
|
|
|
|
|
const TableBody = Mn.CollectionView.extend({
|
|
|
|
tagName: 'tbody',
|
|
|
|
childView: ItemView
|
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = Mn.View.extend({
|
|
|
|
tagName: 'table',
|
2020-02-18 23:55:06 -05:00
|
|
|
className: 'table table-hover table-outline table-vcenter card-table',
|
2018-07-08 21:22:10 -04:00
|
|
|
template: template,
|
|
|
|
|
|
|
|
regions: {
|
|
|
|
body: {
|
|
|
|
el: 'tbody',
|
|
|
|
replaceElement: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2018-07-24 04:33:00 -04:00
|
|
|
templateContext: {
|
2018-07-25 18:23:32 -04:00
|
|
|
canManage: App.Cache.User.canManage('streams')
|
2018-07-24 04:33:00 -04:00
|
|
|
},
|
|
|
|
|
2018-07-08 21:22:10 -04:00
|
|
|
onRender: function () {
|
|
|
|
this.showChildView('body', new TableBody({
|
|
|
|
collection: this.collection
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
});
|