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

View File

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