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): def get_config_schema(self):
schema = super(MusicBoxExtension, self).get_config_schema() schema = super(MusicBoxExtension, self).get_config_schema()
schema['musicbox'] = config.Boolean()
return schema return schema
def setup(self, registry): def setup(self, registry):

View File

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

View File

@ -13,7 +13,7 @@
if (wsLocation == location.hostname) { if (wsLocation == location.hostname) {
wsLocation = location.hostname + ':6680'; 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 () { $(document).bind("mobileinit", function () {
$.extend($.mobile, { $.extend($.mobile, {

View File

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

View File

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