Forked mumble-django project from https://bitbucket.org/Svedrin/mumble-django
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.7 KiB

  1. // kate: space-indent on; indent-width 4; replace-tabs on;
  2. function renderserverinfos( server ){
  3. var buf = [];
  4. if( server.connecturl ){
  5. buf.push( String.format( '{0}: <a href="{1}">{1}</a>', gettext("Server Address"), server.connecturl ) );
  6. }
  7. if( server.url ){
  8. buf.push( String.format( '{0}: <a href="{1}">{1}</a>', gettext("Website"), server.url ) );
  9. }
  10. buf.push( interpolate( "This server is running Murmur version %s.", [server.prettyversion] ) );
  11. buf.push( interpolate(
  12. ngettext( "Currently, %s user is registered.", "Currently, %s users are registered.", server.users_regged ),
  13. [server.users_regged] ) );
  14. buf.push( interpolate(
  15. ngettext( "Currently, %s user is online.", "Currently, %s users are online.", server.users_online ),
  16. [server.users_online] ) );
  17. buf.push( interpolate(
  18. ngettext( "Currently, there is %s channel.", "Currently, there are %s channels.", server.channel_cnt ),
  19. [server.channel_cnt] ) );
  20. if( server.uptime ){
  21. buf.push( interpolate( "This server is running since %s.", [server.upsince] ) );
  22. }
  23. buf.push( String.format( '<a href="{0}">{1}</a>', server.minurl, gettext( "Switch to minimal view" ) ) );
  24. res = ['<div class="mumble-ext" id="serverstuffz">', '<ul>'];
  25. for( var i = 0; i < buf.length; i++ )
  26. res.push( '<li>'+buf[i]+'</li>' );
  27. res.push( '</ul><br /><br />' );
  28. if( server.motd ){
  29. res.push( String.format( '<b>{0}:</b><br />', gettext("Welcome message") ) );
  30. res.push( String.format( '<div style="padding: 10px">{0}</div>', server.motd ) );
  31. }
  32. res.push( '</div>' );
  33. return res.join('');
  34. }