|
|
|
@ -729,33 +729,33 @@ var AppRouter = Backbone.Router.extend({
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.breadCrumbView.collection.reset(); |
|
|
|
|
this.breadCrumbView.collection.add([ |
|
|
|
|
{text:$.t('admin.home'), href:""}, |
|
|
|
|
{text:$.t('whitelist.manage'), href:"manage/#admin/whitelists"}, |
|
|
|
|
{text:$.t('whitelist.new'), href:"manage/#admin/whitelist/new/" + cid} |
|
|
|
|
]); |
|
|
|
|
|
|
|
|
|
this.updateSidebar('admin/whitelists'); |
|
|
|
|
|
|
|
|
|
////
|
|
|
|
|
var whiteList = this.whiteListList.get(id); |
|
|
|
|
whiteList = new WhiteListModel({id: id}); |
|
|
|
|
|
|
|
|
|
var client = this.clientList.get(cid); |
|
|
|
|
|
|
|
|
|
// if there's no client this is an error
|
|
|
|
|
if (client != null) { |
|
|
|
|
|
|
|
|
|
this.breadCrumbView.collection.reset(); |
|
|
|
|
this.breadCrumbView.collection.add([ |
|
|
|
|
{text:$.t('admin.home'), href:""}, |
|
|
|
|
{text:$.t('whitelist.manage'), href:"manage/#admin/whitelists"}, |
|
|
|
|
{text:$.t('whitelist.new'), href:"manage/#admin/whitelist/new/" + cid} |
|
|
|
|
]); |
|
|
|
|
|
|
|
|
|
var whiteList = new WhiteListModel(); |
|
|
|
|
whiteList.set({ |
|
|
|
|
clientId: client.get('clientId'), |
|
|
|
|
allowedScopes: client.get('scope') |
|
|
|
|
}, { silent: true }); |
|
|
|
|
|
|
|
|
|
this.whiteListFormView = new WhiteListFormView({model: whiteList, client: client, systemScopeList: this.systemScopeList}); |
|
|
|
|
$('#content').html(this.whiteListFormView.render().el); |
|
|
|
|
setPageTitle($.t('whitelist.new')); |
|
|
|
|
} else { |
|
|
|
|
console.log('ERROR: no client found for ' + cid); |
|
|
|
|
if (!client) { |
|
|
|
|
client = new ClientModel({id: cid}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var view = new WhiteListFormView({model: whiteList, client: client, systemScopeList: this.systemScopeList}); |
|
|
|
|
|
|
|
|
|
view.load( |
|
|
|
|
function() { |
|
|
|
|
$('#content').html(view.render().el); |
|
|
|
|
view.delegateEvents(); |
|
|
|
|
setPageTitle($.t('whitelist.manage')); |
|
|
|
|
} |
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -776,21 +776,20 @@ var AppRouter = Backbone.Router.extend({
|
|
|
|
|
this.updateSidebar('admin/whitelists'); |
|
|
|
|
|
|
|
|
|
var whiteList = this.whiteListList.get(id); |
|
|
|
|
if (whiteList != null) { |
|
|
|
|
var client = app.clientList.getByClientId(whiteList.get('clientId')); |
|
|
|
|
|
|
|
|
|
// if there's no client, this is an error
|
|
|
|
|
if (client != null) { |
|
|
|
|
this.whiteListFormView = new WhiteListFormView({model: whiteList, client: client, systemScopeList: this.systemScopeList}); |
|
|
|
|
$('#content').html(this.whiteListFormView.render().el); |
|
|
|
|
setPageTitle($.t('whitelist.edit')); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
console.log('ERROR: no client found for ' + whiteList.get('clientId')); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
console.error('ERROR: no whitelist found for id ' + id); |
|
|
|
|
if (!whiteList) { |
|
|
|
|
whiteList = new WhiteListModel({id: id}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var view = new WhiteListFormView({model: whiteList, clientList: this.clientList, systemScopeList: this.systemScopeList}); |
|
|
|
|
|
|
|
|
|
view.load( |
|
|
|
|
function() { |
|
|
|
|
$('#content').html(view.render().el); |
|
|
|
|
view.delegateEvents(); |
|
|
|
|
setPageTitle($.t('whitelist.manage')); |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
approvedSites:function() { |
|
|
|
|