improve web interface navigation

This commit is contained in:
Sebastian Sdorra
2010-11-25 19:08:32 +01:00
parent afc56635ea
commit 6e9bbc96c9
2 changed files with 63 additions and 51 deletions

View File

@@ -33,6 +33,7 @@
var debug = typeof console != 'undefined'; var debug = typeof console != 'undefined';
var state = null; var state = null;
var admin = false;
// sonia.scm.api.rest.resources.UserResource.DUMMY_PASSWORT // sonia.scm.api.rest.resources.UserResource.DUMMY_PASSWORT
var dummyPassword = '__dummypassword__'; var dummyPassword = '__dummypassword__';
@@ -50,6 +51,7 @@ function loadState(s){
console.debug( s ); console.debug( s );
} }
state = s; state = s;
admin = s.user.admin;
// call login callback functions // call login callback functions
Ext.each(loginCallbacks, function(callback){ Ext.each(loginCallbacks, function(callback){
if ( Ext.isFunction(callback) ){ if ( Ext.isFunction(callback) ){

View File

@@ -109,7 +109,7 @@ Ext.onReady(function(){
console.debug('create main menu'); console.debug('create main menu');
} }
var panel = Ext.getCmp('navigationPanel'); var panel = Ext.getCmp('navigationPanel');
panel.addSections([{ panel.addSection({
title: 'Main', title: 'Main',
items: [{ items: [{
label: 'Repositories', label: 'Repositories',
@@ -117,7 +117,10 @@ Ext.onReady(function(){
addTabPanel('repositories', 'repositoryPanel', 'Repositories'); addTabPanel('repositories', 'repositoryPanel', 'Repositories');
} }
}] }]
},{ });
if ( admin ){
panel.addSections([{
title: 'Config', title: 'Config',
items: [{ items: [{
label: 'General', label: 'General',
@@ -131,7 +134,9 @@ Ext.onReady(function(){
} }
},{ },{
label: 'Server', label: 'Server',
fn: function(){console.debug( 'Server Config' );} fn: function(){
console.debug( 'Server Config' );
}
}] }]
},{ },{
title: 'Security', title: 'Security',
@@ -141,13 +146,18 @@ Ext.onReady(function(){
addTabPanel('users', 'userPanel', 'Users'); addTabPanel('users', 'userPanel', 'Users');
} }
}] }]
},{ }]);
}
panel.addSection({
title: 'Abmelden', title: 'Abmelden',
items: [{ items: [{
label: 'Abmelden', label: 'Abmelden',
fn: logout fn: logout
}] }]
}]); });
//fix hidden logout button
panel.doLayout();
} }
function createWelcomePanel(){ function createWelcomePanel(){