item.js 761 B

1234567891011121314151617181920212223242526272829303132
  1. const Mn = require('backbone.marionette');
  2. const Controller = require('../../controller');
  3. const template = require('./item.ejs');
  4. module.exports = Mn.View.extend({
  5. template: template,
  6. tagName: 'tr',
  7. ui: {
  8. meta: 'a.meta'
  9. },
  10. events: {
  11. 'click @ui.meta': function (e) {
  12. e.preventDefault();
  13. Controller.showAuditMeta(this.model);
  14. }
  15. },
  16. templateContext: {
  17. more: function() {
  18. switch (this.object_type) {
  19. case 'redirection-host':
  20. case 'stream':
  21. case 'proxy-host':
  22. return this.meta.domain_names.join(', ');
  23. }
  24. return '#' + (this.object_id || '?');
  25. }
  26. }
  27. });