added edit policy button
parent
03b301b43b
commit
3d760cad8b
|
@ -270,9 +270,7 @@ var PolicyListView = Backbone.View.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
events:{
|
events:{
|
||||||
'click .btn-save':'savePolicy',
|
'click .btn-cancel':'cancel'
|
||||||
'click .btn-cancel':'cancel',
|
|
||||||
'click #add-email':'addPolicy'
|
|
||||||
},
|
},
|
||||||
|
|
||||||
cancel:function(e) {
|
cancel:function(e) {
|
||||||
|
@ -329,7 +327,7 @@ var PolicyListView = Backbone.View.extend({
|
||||||
|
|
||||||
_.each(this.model.models, function (policy) {
|
_.each(this.model.models, function (policy) {
|
||||||
|
|
||||||
var view = new PolicyView({model: policy, systemScopeList: _self.options.systemScopeList});
|
var view = new PolicyView({model: policy, systemScopeList: _self.options.systemScopeList, rs: _self.options.rs});
|
||||||
view.parentView = _self;
|
view.parentView = _self;
|
||||||
$('#policy-table', this.el).append(view.render().el);
|
$('#policy-table', this.el).append(view.render().el);
|
||||||
|
|
||||||
|
@ -360,9 +358,15 @@ var PolicyView = Backbone.View.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
events:{
|
events:{
|
||||||
|
'click .btn-edit':'editPolicy',
|
||||||
'click .btn-remove':'removePolicy'
|
'click .btn-remove':'removePolicy'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
editPolicy:function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
app.navigate('user/policy/' + this.options.rs.get("id") + '/' + this.model.get('id'), {trigger: true});
|
||||||
|
},
|
||||||
|
|
||||||
removePolicy:function(e) {
|
removePolicy:function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
|
|
@ -129,6 +129,7 @@
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<div class="btn-group pull-right">
|
<div class="btn-group pull-right">
|
||||||
|
<button class="btn btn-edit"><i class="icon-edit"></i> <span data-i18n="policy.policy-table.edit">Edit Policy</span></button>
|
||||||
<button class="btn btn-danger btn-remove"><i class="icon-trash icon-white"></i> <span data-i18n="policy.policy-table.remove">Remove</span></button>
|
<button class="btn btn-danger btn-remove"><i class="icon-trash icon-white"></i> <span data-i18n="policy.policy-table.remove">Remove</span></button>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
Loading…
Reference in New Issue