@ -503,8 +503,6 @@ var AppRouter = Backbone.Router.extend({
"user/approved" : "approvedSites" ,
"user/tokens" : "tokens" ,
"user/profile" : "profile" ,
"user/policy" : "policy" ,
"user/policy/:rsid" : "editPolicy" ,
"dev/dynreg" : "dynReg" ,
"dev/dynreg/new" : "newDynReg" ,
@ -536,7 +534,6 @@ var AppRouter = Backbone.Router.extend({
this . clientStats = new StatsModel ( ) ;
this . accessTokensList = new AccessTokenCollection ( ) ;
this . refreshTokensList = new RefreshTokenCollection ( ) ;
this . resourceSetList = new ResourceSetCollection ( ) ;
this . breadCrumbView = new BreadCrumbView ( {
collection : new Backbone . Collection ( )
@ -1071,62 +1068,13 @@ var AppRouter = Backbone.Router.extend({
this . updateSidebar ( 'user/profile' ) ;
var v iew = new UserProfileView ( { model : getUserInfo ( ) } ) ;
$ ( '#content' ) . html ( v iew. render ( ) . el ) ;
this . userProfileV iew = new UserProfileView ( { model : getUserInfo ( ) } ) ;
$ ( '#content' ) . html ( this . userProfileV iew. render ( ) . el ) ;
setPageTitle ( $ . t ( 'admin.user-profile.show' ) ) ;
} ,
policy : function ( ) {
this . breadCrumbView . collection . reset ( ) ;
this . breadCrumbView . collection . add ( [
{ text : $ . t ( 'admin.home' ) , href : "" } ,
{ text : $ . t ( 'policy.resource-sets' ) , href : "manage/#user/policy" }
] ) ;
this . updateSidebar ( 'user/policy' ) ;
var view = new ResourceSetListView ( { model : this . resourceSetList , clientList : this . clientList , systemScopeList : this . systemScopeList } ) ;
view . load ( function ( ) {
$ ( '#content' ) . html ( view . render ( ) . el ) ;
setPageTitle ( $ . t ( 'policy.resource-sets' ) ) ;
} ) ;
} ,
editPolicy : function ( rsid ) {
this . breadCrumbView . collection . reset ( ) ;
this . breadCrumbView . collection . add ( [
{ text : $ . t ( 'admin.home' ) , href : "" } ,
{ text : $ . t ( 'policy.resource-sets' ) , href : "manage/#user/policy" } ,
{ text : $ . t ( 'policy.edit-policy' ) , href : "manage/#user/policy/" + rsid }
] ) ;
this . updateSidebar ( 'user/policy' ) ;
var rs = this . resourceSetList . get ( rsid ) ;
if ( rs == null ) {
// need to load it directly
var claims = new ClaimCollection ( ) ;
} else {
// the resource set is loaded, preload the claims
var claims = new ClaimCollection ( rs . get ( 'claimsRequired' ) ) ;
claims . isFetched = true ;
}
// set the URL for the collection
claims . url = 'api/claims/' + rsid ;
var view = new ClaimListView ( { model : claims , rs : rs } ) ;
view . load ( function ( ) {
$ ( '#content' ) . html ( view . render ( ) . el ) ;
setPageTitle ( $ . t ( 'policy.edit-policy' ) ) ;
} ) ;
} ,
updateSidebar : function ( item ) {
$ ( '.sidebar-nav li.active' ) . removeClass ( 'active' ) ;
@ -1154,8 +1102,7 @@ $(function () {
$ . get ( 'resources/template/whitelist.html' , _load ) ,
$ . get ( 'resources/template/dynreg.html' , _load ) ,
$ . get ( 'resources/template/rsreg.html' , _load ) ,
$ . get ( 'resources/template/token.html' , _load ) ,
$ . get ( 'resources/template/policy.html' , _load )
$ . get ( 'resources/template/token.html' , _load )
) . done ( function ( ) {
$ . ajaxSetup ( { cache : false } ) ;
app = new AppRouter ( ) ;