2018-07-16 03:00:52 -04:00
|
|
|
const Mn = require('backbone.marionette');
|
|
|
|
const Controller = require('../../controller');
|
|
|
|
const template = require('./item.ejs');
|
|
|
|
|
|
|
|
module.exports = Mn.View.extend({
|
|
|
|
template: template,
|
|
|
|
tagName: 'tr',
|
|
|
|
|
|
|
|
ui: {
|
2018-08-01 07:18:17 -04:00
|
|
|
meta: 'a.meta'
|
2018-07-16 03:00:52 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
events: {
|
2018-08-01 07:18:17 -04:00
|
|
|
'click @ui.meta': function (e) {
|
2018-07-16 03:00:52 -04:00
|
|
|
e.preventDefault();
|
2018-08-01 07:18:17 -04:00
|
|
|
Controller.showAuditMeta(this.model);
|
2018-07-16 03:00:52 -04:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
templateContext: {
|
2018-08-01 07:18:17 -04:00
|
|
|
more: function() {
|
|
|
|
switch (this.object_type) {
|
|
|
|
case 'redirection-host':
|
|
|
|
case 'stream':
|
|
|
|
case 'proxy-host':
|
|
|
|
return this.meta.domain_names.join(', ');
|
|
|
|
}
|
2018-07-16 03:00:52 -04:00
|
|
|
|
2018-08-01 07:18:17 -04:00
|
|
|
return '#' + (this.object_id || '?');
|
|
|
|
}
|
2018-07-16 03:00:52 -04:00
|
|
|
}
|
|
|
|
});
|