nginx-proxy-manager/frontend/js/app/nginx/access/list/item.js

34 lines
801 B
JavaScript
Raw Normal View History

2018-07-24 02:56:39 -04:00
const Mn = require('backbone.marionette');
const App = require('../../../main');
const template = require('./item.ejs');
module.exports = Mn.View.extend({
template: template,
tagName: 'tr',
ui: {
edit: 'a.edit',
delete: 'a.delete'
},
events: {
'click @ui.edit': function (e) {
e.preventDefault();
2018-08-19 04:54:17 -04:00
App.Controller.showNginxAccessListForm(this.model);
2018-07-24 02:56:39 -04:00
},
'click @ui.delete': function (e) {
e.preventDefault();
2018-08-19 04:54:17 -04:00
App.Controller.showNginxAccessListDeleteConfirm(this.model);
2018-07-24 02:56:39 -04:00
}
},
templateContext: {
2018-08-19 04:54:17 -04:00
canManage: App.Cache.User.canManage('access_lists')
2018-07-24 02:56:39 -04:00
},
initialize: function () {
this.listenTo(this.model, 'change', this.render);
}
});