Browse Source

add SHOW_EMPTY_SUBCHANS setting. fixes #54

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
57054778b8
  1. 4
      pyweb/mumble/mmobjects.py
  2. 3
      pyweb/settings.py

4
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." 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, 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." 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 ): def __str__( self ):
return '<Channel "%s" (%d)>' % ( self.name, self.chanid ); return '<Channel "%s" (%d)>' % ( self.name, self.chanid );

3
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. # 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 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? # Protect the registration form for private servers?
# If set to True, people will need to enter the server password in order to create accounts. # If set to True, people will need to enter the server password in order to create accounts.
PROTECTED_MODE = False PROTECTED_MODE = False

Loading…
Cancel
Save