musicbox config option controls which navigation links are shown

This commit is contained in:
kingosticks 2015-03-06 00:20:35 +00:00
parent b94db6bfcc
commit 0bd7eff8d6
5 changed files with 6 additions and 4 deletions

View File

@ -19,6 +19,7 @@ class MusicBoxExtension(ext.Extension):
def get_config_schema(self):
schema = super(MusicBoxExtension, self).get_config_schema()
schema['musicbox'] = config.Boolean()
return schema
def setup(self, registry):

View File

@ -1,2 +1,3 @@
[musicbox_webclient]
enabled = true
musicbox = false

View File

@ -13,7 +13,7 @@
if (wsLocation == location.hostname) {
wsLocation = location.hostname + ':6680';
}
var isMusicBox = true; //set to true to remove buttons only for musicbox
var isMusicBox = {{musicbox}}; // Remove MusicBox only content (e.g. settings, system pages)
$(document).bind("mobileinit", function () {
$.extend($.mobile, {

View File

@ -30,7 +30,8 @@ class IndexHandler(tornado.web.RequestHandler):
def initialize(self, config, path):
ext_config = config[MusicBoxExtension.ext_name]
self.__dict = {
'version': MusicBoxExtension.version
'version': MusicBoxExtension.version,
'musicbox': int(ext_config['musicbox'])
}
self.__path = path
self.__title = string.Template('MusicBox on $hostname')

View File

@ -16,8 +16,7 @@ def test_get_config_schema():
ext = MusicBoxExtension()
schema = ext.get_config_schema()
# TODO Test the content of your config schema
assert 'musicbox' in schema
# TODO Write more tests