diff --git a/pyweb/mumble/mmobjects.py b/pyweb/mumble/mmobjects.py index 69a6af7..dd3e784 100644 --- a/pyweb/mumble/mmobjects.py +++ b/pyweb/mumble/mmobjects.py @@ -82,11 +82,13 @@ class mmChannel( object ): doc="A string ready to be used in an id property of an HTML tag." ); - show = property( + top_or_not_empty = property( lambda self: self.parent is None or self.parent.chanid == 0 or self.playerCount > 0, doc="True if this channel needs to be shown because it is root, a child of root, or has players." ); + show = property( lambda self: settings.SHOW_EMPTY_SUBCHANS or self.top_or_not_empty ); + def __str__( self ): return '' % ( self.name, self.chanid ); diff --git a/pyweb/settings.py b/pyweb/settings.py index 869e563..d53e214 100644 --- a/pyweb/settings.py +++ b/pyweb/settings.py @@ -82,6 +82,9 @@ ACCOUNT_ACTIVATION_DAYS = 30 # Default mumble port. If your server runs under this port, it will not be included in the links in the Channel Viewer. MUMBLE_DEFAULT_PORT = 64738 +# Should subchannels be shown, even if there are no players in them? +SHOW_EMPTY_SUBCHANS = False + # Protect the registration form for private servers? # If set to True, people will need to enter the server password in order to create accounts. PROTECTED_MODE = False