only show manage home if its used

This commit is contained in:
j 2017-02-07 14:32:41 +01:00
parent 620c8a7d96
commit b055b3e666
2 changed files with 4 additions and 2 deletions

View file

@ -56,7 +56,7 @@
"canImportItems": {}, "canImportItems": {},
"canManageDocuments": {"staff": true, "admin": true}, "canManageDocuments": {"staff": true, "admin": true},
"canManageEntities": {"staff": true, "admin": true}, "canManageEntities": {"staff": true, "admin": true},
"canManageHome": {"staff": true, "admin": true}, "canManageHome": {},
"canManagePlacesAndEvents": {"staff": true, "admin": true}, "canManagePlacesAndEvents": {"staff": true, "admin": true},
"canManageTitlesAndNames": {"staff": true, "admin": true}, "canManageTitlesAndNames": {"staff": true, "admin": true},
"canManageUsers": {"staff": true, "admin": true}, "canManageUsers": {"staff": true, "admin": true},

View file

@ -230,7 +230,9 @@ pandora.ui.mainMenu = function() {
{ id: 'places', title: Ox._('Manage Places...'), disabled: !pandora.site.capabilities.canManagePlacesAndEvents[pandora.user.level] }, { id: 'places', title: Ox._('Manage Places...'), disabled: !pandora.site.capabilities.canManagePlacesAndEvents[pandora.user.level] },
{ id: 'events', title: Ox._('Manage Events...'), disabled: !pandora.site.capabilities.canManagePlacesAndEvents[pandora.user.level] }, { id: 'events', title: Ox._('Manage Events...'), disabled: !pandora.site.capabilities.canManagePlacesAndEvents[pandora.user.level] },
{}, {},
{ id: 'managehome', title: Ox._('Manage Home...'), disabled: !pandora.site.capabilities.canManageHome[pandora.user.level] }, Ox.isEmpty(pandora.site.capabilities.canManageHome) ? [] : [
{ id: 'managehome', title: Ox._('Manage Home...'), disabled: !pandora.site.capabilities.canManageHome[pandora.user.level] }
],
{ id: 'users', title: Ox._('Manage Users...'), disabled: !pandora.site.capabilities.canManageUsers[pandora.user.level] }, { id: 'users', title: Ox._('Manage Users...'), disabled: !pandora.site.capabilities.canManageUsers[pandora.user.level] },
{ id: 'statistics', title: Ox._('Statistics...'), disabled: !pandora.site.capabilities.canManageUsers[pandora.user.level] }, { id: 'statistics', title: Ox._('Statistics...'), disabled: !pandora.site.capabilities.canManageUsers[pandora.user.level] },
{}, {},