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.

39 lines
1.9 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( gettext("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. gettext("This server has %s slots, %s of which are free."), [server.users, (server.users - server.users_online)]
  19. ) );
  20. buf.push( interpolate(
  21. ngettext( "Currently, there is %s channel.", "Currently, there are %s channels.", server.channel_cnt ),
  22. [server.channel_cnt] ) );
  23. if( server.uptime ){
  24. buf.push( interpolate( gettext("This server is running since %s."), [server.upsince] ) );
  25. }
  26. buf.push( String.format( '<a href="{0}">{1}</a>', server.minurl, gettext( "Switch to minimal view" ) ) );
  27. res = ['<div class="mumble-ext" id="serverstuffz">', String.format( "<h2>{0}</h2><br />", server.name ), '<ul>'];
  28. for( var i = 0; i < buf.length; i++ )
  29. res.push( '<li>'+buf[i]+'</li>' );
  30. res.push( '</ul><br /><br />' );
  31. if( server.motd ){
  32. res.push( String.format( '<h2>{0}:</h2>', gettext("Welcome message") ) );
  33. res.push( String.format( '<div style="padding: 10px">{0}</div>', server.motd ) );
  34. }
  35. res.push( '</div>' );
  36. return res.join('');
  37. }