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.

113 lines
3.5 KiB

16 years ago
16 years ago
  1. {% extends "index.htm" %}
  2. {% block headtags %}
  3. <meta http-equiv="refresh" content="30" />
  4. {% endblock %}
  5. {% block Headline %}
  6. {{ ServerObject.rootName }}
  7. {% endblock %}
  8. {% block LeftColumn %}
  9. {% include "mumble/content.htm" %}
  10. {% endblock %}
  11. {% block Content %}
  12. {% if user.is_authenticated %}
  13. <div id="mumble_registration">
  14. <h2>Server registration</h2>
  15. <form action="" method="post">
  16. {% if Registered %}
  17. You are registered on this server.<br />
  18. {% else %}
  19. You do not have an account on this server.<br />
  20. {% endif %}
  21. <table>
  22. {{ RegForm }}
  23. </table>
  24. <input type="hidden" name="mode" value="reg" />
  25. <input type="submit" />
  26. </form>
  27. </div>
  28. {% else %}
  29. <p>You need to be <a href="/accounts/login">logged in</a> to be able to register an account.</p>
  30. <noscript>
  31. <p>
  32. This area is used to display additional information for each channel and player, but requires JavaScript to be
  33. enabled in order to work correctly.
  34. </p>
  35. </noscript>
  36. {% endif %}
  37. {% if CurrentUserIsAdmin %}
  38. <div id="mumble_admin">
  39. <h2>Server administration</h2>
  40. <form action="" method="post">
  41. <table>
  42. {{ AdminForm }}
  43. </table>
  44. <input type="hidden" name="mode" value="admin" />
  45. <input type="submit" />
  46. </form>
  47. </div>
  48. <noscript>
  49. By the way, if you had enabled JavaScript, you could see a nifty Tab bar here :)
  50. </noscript>
  51. {% endif %}
  52. {% for item in ChannelTable %}
  53. {% if item.1.is_player %}
  54. <div id="mumble_{{ item.1.id }}" class="x-hide-display">
  55. Player {{ item.1.name }}
  56. Online since {{item.1.onlinesince|time:"H:i"}}<br />
  57. <a href="/accounts/profiles/{{item.1.mumbleuser.owner.id}}">{{item.1.mumbleuser.owner}}</a>
  58. </div>
  59. {% else %}
  60. <div id="mumble_{{ item.1.id }}" class="x-hide-display">
  61. Channel {{ item.1.name }}<br />
  62. <a href="mumble://{% if mumbleAccount %}{{ mumbleAccount.name }}@{% endif %}{{ DBaseObject.addr }}/{% for chan in item.2 %}{{ chan|urlencode }}/{% endfor %}{{ item.1.name|urlencode }}" class="dingen">Connect</a>
  63. </div>
  64. {% endif %}
  65. {% endfor %}
  66. {% endblock %}
  67. {% block HeadTag %}
  68. {% if CurrentUserIsAdmin %}
  69. <script type="text/javascript">
  70. Ext.onReady( function(){
  71. Ext.get( 'mumble_registration' ).addClass( 'x-hide-display' );
  72. Ext.get( 'mumble_admin' ).addClass( 'x-hide-display' );
  73. var cardpanel = new Ext.Panel({
  74. renderTo: 'col3_content',
  75. layout: 'card',
  76. id: 'mumble_container',
  77. height: 400,
  78. activeItem: 0,
  79. border: false,
  80. items: [ {
  81. id: 'mumble_tabpanel',
  82. xtype: 'tabpanel',
  83. defaults: { autoheight: true },
  84. activeTab: {{ DisplayTab }},
  85. items: [
  86. { contentEl: 'mumble_registration', title: 'Registration' },
  87. { contentEl: 'mumble_admin', title: 'Administration' },
  88. ]
  89. },
  90. {% for item in ChannelTable %}
  91. { contentEl: 'mumble_{{ item.1.id }}', id: 'carditem_{{ item.1.id }}' },
  92. {% endfor %}
  93. ],
  94. });
  95. Ext.get( 'link_server' ).on( 'click', function( event, target ){
  96. cardpanel.layout.setActiveItem( 'mumble_tabpanel' );
  97. event.preventDefault();
  98. });
  99. {% for item in ChannelTable %}
  100. Ext.get( 'link_{{ item.1.id }}' ).on( 'click', function( event, target ){
  101. cardpanel.layout.setActiveItem( 'carditem_{{ item.1.id }}' );
  102. event.preventDefault();
  103. });
  104. {% endfor %}
  105. } );
  106. </script>
  107. {% endif %}
  108. {% endblock %}