main.js 778 B

1234567891011121314151617181920212223242526272829303132
  1. const Mn = require('backbone.marionette');
  2. const App = require('../../../main');
  3. const ItemView = require('./item');
  4. const template = require('./main.ejs');
  5. const TableBody = Mn.CollectionView.extend({
  6. tagName: 'tbody',
  7. childView: ItemView
  8. });
  9. module.exports = Mn.View.extend({
  10. tagName: 'table',
  11. className: 'table table-hover table-outline table-vcenter card-table',
  12. template: template,
  13. regions: {
  14. body: {
  15. el: 'tbody',
  16. replaceElement: true
  17. }
  18. },
  19. templateContext: {
  20. canManage: App.Cache.User.canManage('certificates')
  21. },
  22. onRender: function () {
  23. this.showChildView('body', new TableBody({
  24. collection: this.collection
  25. }));
  26. }
  27. });