From f56857b9ff2a057b5dc6fbbaf51343be262a0b6f Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Sun, 17 Apr 2011 01:01:08 +0200 Subject: [PATCH] display total number and number of free slots. see #138 --- pyweb/mumble/media/js/rendermumbleserver.js | 3 +++ pyweb/mumble/views.py | 1 + 2 files changed, 4 insertions(+) diff --git a/pyweb/mumble/media/js/rendermumbleserver.js b/pyweb/mumble/media/js/rendermumbleserver.js index e014bcd..9cb1b8e 100644 --- a/pyweb/mumble/media/js/rendermumbleserver.js +++ b/pyweb/mumble/media/js/rendermumbleserver.js @@ -15,6 +15,9 @@ function renderserverinfos( server ){ buf.push( interpolate( ngettext( "Currently, %s user is online.", "Currently, %s users are online.", server.users_online ), [server.users_online] ) ); + buf.push( interpolate( + gettext("This server has %s slots, %s of which are free."), [server.users, (server.users - server.users_online)] + ) ); buf.push( interpolate( ngettext( "Currently, there is %s channel.", "Currently, there are %s channels.", server.channel_cnt ), [server.channel_cnt] ) ); diff --git a/pyweb/mumble/views.py b/pyweb/mumble/views.py index 5ee838f..d15a7b7 100644 --- a/pyweb/mumble/views.py +++ b/pyweb/mumble/views.py @@ -112,6 +112,7 @@ def serverinfo( request, server ): 'connecturl': srv.connecturl, 'prettyversion': srv.prettyversion, 'url': srv.url, + 'users': (srv.users or srv.server.getDefaultConf()['users']), 'users_regged': srv.users_regged, 'users_online': srv.users_online, 'channel_cnt': srv.channel_cnt,